1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00

Make swat use popt

This commit is contained in:
Jelmer Vernooij 0001-01-01 00:00:00 +00:00
parent 06c7a16b2d
commit 3cd1650d38
2 changed files with 19 additions and 15 deletions

View File

@ -363,7 +363,8 @@ SWAT_OBJ1 = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \
SWAT_OBJ = $(SWAT_OBJ1) $(PRINTING_OBJ) $(LIBSMB_OBJ) $(LOCKING_OBJ) \
$(PARAM_OBJ) $(PASSDB_OBJ) $(SECRETS_OBJ) $(KRBCLIENT_OBJ) \
$(UBIQX_OBJ) $(LIB_OBJ) $(GROUPDB_OBJ) $(PLAINTEXT_AUTH_OBJ)
$(UBIQX_OBJ) $(LIB_OBJ) $(GROUPDB_OBJ) $(PLAINTEXT_AUTH_OBJ) \
$(POPT_LIB_OBJ)
SMBSH_OBJ = smbwrapper/smbsh.o smbwrapper/shared.o \
$(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
@ -707,10 +708,10 @@ bin/wrepld@EXEEXT@: $(WREPL_OBJ) bin/.dummy
@echo Linking $@
@$(CC) $(FLAGS) -o $@ $(WREPL_OBJ) $(LDFLAGS) $(LIBS)
bin/swat@EXEEXT@: $(SWAT_OBJ) bin/.dummy
bin/swat@EXEEXT@: $(SWAT_OBJ) @BUILD_POPT@ bin/.dummy
@echo Linking $@
@$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINTLIBS) \
$(AUTHLIBS) $(LIBS)
$(AUTHLIBS) $(LIBS) @BUILD_POPT@
bin/rpcclient@EXEEXT@: $(RPCCLIENT_OBJ) @BUILD_POPT@ bin/.dummy
@echo Linking $@

View File

@ -1261,10 +1261,16 @@ static void printers_page(void)
**/
int main(int argc, char *argv[])
{
extern char *optarg;
extern int optind;
int opt;
char *page;
poptContext pc;
struct poptOption long_options[] = {
POPT_AUTOHELP
{ "disable-authentication", 'a', POPT_ARG_VAL, &demo_mode, TRUE, "Disable authentication (demo mode)" },
{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_version},
{ NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile},
{ 0, 0, 0, 0 }
};
fault_setup(NULL);
umask(S_IWGRP | S_IWOTH);
@ -1288,16 +1294,13 @@ static void printers_page(void)
close(2);
open("/dev/null", O_WRONLY);
while ((opt = getopt(argc, argv,"s:a")) != EOF) {
switch (opt) {
case 's':
pstrcpy(dyn_CONFIGFILE,optarg);
break;
case 'a':
demo_mode = True;
break;
}
}
pc = poptGetContext("swat", argc, (const char **) argv, long_options, 0);
/* Parse command line options */
while((opt = poptGetNextOpt(pc)) != -1) { }
poptFreeContext(pc);
setup_logging(argv[0],False);
load_config(True);