Index: ossp-pkg/lmtp2nntp/example.conf RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/example.conf,v rcsdiff -q -kk '-r1.12' '-r1.13' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/example.conf,v' 2>/dev/null --- example.conf 2002/01/31 15:32:51 1.12 +++ example.conf 2002/01/31 15:42:31 1.13 @@ -49,7 +49,7 @@ timeoutnntpconnect 360 #see --timeoutnntpconnect timeoutnntpread 60 #see --timeoutnntpread timeoutnntpwrite 60 #see --timeoutnntpwrite -uid gate #see -u aka --uid +user gate #see -u aka --user # -v aka --version is not available in the configfile newsgroup "test" newsgroup "alt.test" #see man page for information about newsgroup Index: ossp-pkg/lmtp2nntp/lmtp2nntp_config.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_config.c,v rcsdiff -q -kk '-r1.32' '-r1.33' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_config.c,v' 2>/dev/null --- lmtp2nntp_config.c 2002/01/31 15:32:51 1.32 +++ lmtp2nntp_config.c 2002/01/31 15:42:31 1.33 @@ -29,6 +29,7 @@ #include #include #include +#include /* third party (included) */ #include "lmtp2nntp_argz.h" @@ -747,6 +748,32 @@ catch (ex) rethrow; + /* --user SINGLE */ + try { + struct passwd *sPasswd; + + if ( (val_get(ctx->val, "option.user", &ov) != VAL_OK) + || (ov->ndata != 1) + || (ov->data.s == NULL) + ) throw(0,0,0); + log1(ctx, TRACE, "--user = \"%s\"", ov->data.s); + + if (isdigit((int)ov->data.s[0])) { + if ((sPasswd = getpwuid((uid_t)atoi(ov->data.s))) == NULL) { + log1(ctx, ERROR, "option --user, uid (%s) not found", ov->data.s); + throw(0,0,0); + } + } + else { + if ((sPasswd = getpwnam(optarg)) == NULL) { + log1(ctx, ERROR, "option --user, name (%s) not found", ov->data.s); + throw(0,0,0); + } + } + ctx->option_uid = sPasswd->pw_uid; + } + catch (ex) + rethrow; CUS: return; } Index: ossp-pkg/lmtp2nntp/lmtp2nntp_main.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_main.c,v rcsdiff -q -kk '-r1.25' '-r1.26' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_main.c,v' 2>/dev/null --- lmtp2nntp_main.c 2002/01/31 15:32:51 1.25 +++ lmtp2nntp_main.c 2002/01/31 15:42:31 1.26 @@ -36,7 +36,6 @@ #include #include #include -#include /* third party (included) */ #include "lmtp2nntp_argz.h" @@ -357,7 +356,6 @@ int i; /* general purpose scratch int, index ... */ pid_t pid; FILE *fd; - struct passwd *sPasswd; /* drop effective uid/gid priviledges */ seteuid(getuid()); @@ -444,21 +442,6 @@ /* read in the arguments */ while ((i = getopt(argc, argv, "C:DKP:Va:b:c:d:g:h:l:m:n:o:r:s:t:u:v")) != -1) { switch (i) { - case 'u': /*POD [B<-u> I] */ - if (isdigit((int)optarg[0])) { - if ((sPasswd = getpwuid((uid_t)atoi(optarg))) == NULL) { - fprintf(stderr, "%s:Error: uid \"%s\" not found for -u option.\n", ctx->progname, optarg); - CU(ERR_EXECUTION); - } - } - else { - if ((sPasswd = getpwnam(optarg)) == NULL) { - fprintf(stderr, "%s:Error: loginname \"%s\" not found for -u option.\n", ctx->progname, optarg); - CU(ERR_EXECUTION); - } - } - ctx->option_uid = sPasswd->pw_uid; - break; case 'v': /*POD [B<-v>] (version)*/ fprintf(stdout, "%s\n", lmtp2nntp_version.v_gnu); CU(0); Index: ossp-pkg/lmtp2nntp/lmtp2nntp_option.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_option.c,v rcsdiff -q -kk '-r1.6' '-r1.7' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_option.c,v' 2>/dev/null --- lmtp2nntp_option.c 2002/01/31 15:32:51 1.6 +++ lmtp2nntp_option.c 2002/01/31 15:42:31 1.7 @@ -626,7 +626,7 @@ (void)option_register(o, "nodename", 'n', OPT_SINGLE, &stdsyntax, "m/.*/", "foo21", "nodename" ); (void)option_register(o, "operationmode", 'o', OPT_SINGLE, &stdsyntax, "m/.*/", "foo22", "post|feed" ); (void)option_register(o, "l2spec", 'l', OPT_SINGLE, &stdsyntax, "m/.*/", "L2 channel tree textual specification", "l2spec" ); - (void)option_register(o, "uid", 'u', OPT_SINGLE, &stdsyntax, "m/.*/", "foo24", "number|name" ); + (void)option_register(o, "user", 'u', OPT_SINGLE, &stdsyntax, "m/.*/", "foo24", "uid|name" ); (void)option_register(o, "restrictheader", 'r', OPT_SINGLE, &stdsyntax, "m/.*/", "foo25", "regex" ); (void)option_register(o, "newsgroup", NUL, OPT_MULTI, &stdsyntax, "m/.*/", "foo26", "newsgroup");