diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-15 21:09:13 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-01-15 21:09:13 +0000 |
commit | 5062bcecfa81a7e0dd07894d6e93655a97239964 (patch) | |
tree | fd0e0dd2a71271dbe81c195cd9fbdd57fb7c20fb /gnu/usr.sbin/sendmail/praliases | |
parent | 91deaea81040227b9ba537ff047f1f863f75fc31 (diff) |
sendmail 8.11.2 with BSD Makefiles
Diffstat (limited to 'gnu/usr.sbin/sendmail/praliases')
-rw-r--r-- | gnu/usr.sbin/sendmail/praliases/praliases.1 | 4 | ||||
-rw-r--r-- | gnu/usr.sbin/sendmail/praliases/praliases.c | 52 |
2 files changed, 31 insertions, 25 deletions
diff --git a/gnu/usr.sbin/sendmail/praliases/praliases.1 b/gnu/usr.sbin/sendmail/praliases/praliases.1 index c3f8cff4680..ca7b92ff244 100644 --- a/gnu/usr.sbin/sendmail/praliases/praliases.1 +++ b/gnu/usr.sbin/sendmail/praliases/praliases.1 @@ -6,9 +6,9 @@ .\" the sendmail distribution. .\" .\" -.\" $Sendmail: praliases.8,v 8.14 2000/03/17 07:32:46 gshapiro Exp $ +.\" $Sendmail: praliases.8,v 8.15.4.2 2000/12/15 19:50:45 gshapiro Exp $ .\" -.Dd April 25, 1996 +.Dd December 15, 2000 .Dt PRALIASES 1 .Os .Sh NAME diff --git a/gnu/usr.sbin/sendmail/praliases/praliases.c b/gnu/usr.sbin/sendmail/praliases/praliases.c index e559fab9bc9..0b5ab03076b 100644 --- a/gnu/usr.sbin/sendmail/praliases/praliases.c +++ b/gnu/usr.sbin/sendmail/praliases/praliases.c @@ -21,7 +21,7 @@ static char copyright[] = #endif /* ! lint */ #ifndef lint -static char id[] = "@(#)$Sendmail: praliases.c,v 8.59 2000/03/17 07:32:47 gshapiro Exp $"; +static char id[] = "@(#)$Sendmail: praliases.c,v 8.59.4.15 2000/10/24 00:42:59 geir Exp $"; #endif /* ! lint */ #include <sys/types.h> @@ -33,6 +33,7 @@ static char id[] = "@(#)$Sendmail: praliases.c,v 8.59 2000/03/17 07:32:47 gshapi #endif /* EX_OK */ #include <sysexits.h> + #ifndef NOT_SENDMAIL # define NOT_SENDMAIL #endif /* ! NOT_SENDMAIL */ @@ -55,6 +56,9 @@ BITMAP256 DontBlameSendmail; extern void syserr __P((const char *, ...)); +# define DELIMITERS " ,/" +# define PATH_SEPARATOR ':' + int main(argc, argv) int argc; @@ -71,6 +75,7 @@ main(argc, argv) extern char *optarg; extern int optind; + clrbitmap(DontBlameSendmail); RunAsUid = RealUid = getuid(); RunAsGid = RealGid = getgid(); @@ -82,12 +87,12 @@ main(argc, argv) snprintf(rnamebuf, sizeof rnamebuf, "%s", pw->pw_name); } else - snprintf(rnamebuf, sizeof rnamebuf, - "Unknown UID %d", (int) RealUid); + (void) snprintf(rnamebuf, sizeof rnamebuf, "Unknown UID %d", + (int) RealUid); RunAsUserName = RealUserName = rnamebuf; cfile = _PATH_SENDMAILCF; - while ((ch = getopt(argc, argv, "C:f:")) != EOF) + while ((ch = getopt(argc, argv, "C:f:")) != -1) { switch ((char)ch) { case 'C': @@ -167,7 +172,7 @@ main(argc, argv) break; b = p; - p = strpbrk(p, " ,/"); + p = strpbrk(p, DELIMITERS); /* find end of spec */ if (p != NULL) @@ -241,7 +246,7 @@ praliases(filename, argc, argv) SMDB_DBPARAMS params; SMDB_USER_INFO user_info; - colon = strchr(filename, ':'); + colon = strchr(filename, PATH_SEPARATOR); if (colon == NULL) { db_name = filename; @@ -259,6 +264,7 @@ praliases(filename, argc, argv) { while (isascii(*db_name) && isspace(*db_name)) db_name++; + if (*db_name != '-') break; while (*db_name != '\0' && @@ -310,20 +316,20 @@ praliases(filename, argc, argv) { #if 0 /* skip magic @:@ entry */ - if (db_key.data.size == 2 && - db_key.data.data[0] == '@' && - db_key.data.data[1] == '\0' && - db_value.data.size == 2 && - db_value.data.data[0] == '@' && - db_value.data.data[1] == '\0') + if (db_key.size == 2 && + db_key.data[0] == '@' && + db_key.data[1] == '\0' && + db_value.size == 2 && + db_value.data[0] == '@' && + db_value.data[1] == '\0') continue; #endif /* 0 */ printf("%.*s:%.*s\n", - (int) db_key.data.size, - (char *) db_key.data.data, - (int) db_value.data.size, - (char *) db_value.data.data); + (int) db_key.size, + (char *) db_key.data, + (int) db_value.size, + (char *) db_value.data); } if (result != SMDBE_OK && result != SMDBE_LAST_ENTRY) @@ -338,19 +344,19 @@ praliases(filename, argc, argv) { memset(&db_key, '\0', sizeof db_key); memset(&db_value, '\0', sizeof db_value); - db_key.data.data = *argv; - db_key.data.size = strlen(*argv) + 1; + db_key.data = *argv; + db_key.size = strlen(*argv) + 1; if (database->smdb_get(database, &db_key, &db_value, 0) == SMDBE_OK) { printf("%.*s:%.*s\n", - (int) db_key.data.size, - (char *) db_key.data.data, - (int) db_value.data.size, - (char *) db_value.data.data); + (int) db_key.size, + (char *) db_key.data, + (int) db_value.size, + (char *) db_value.data); } else - printf("%s: No such key\n", (char *) db_key.data.data); + printf("%s: No such key\n", (char *) db_key.data); } fatal: |