summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/praliases
diff options
context:
space:
mode:
authorgshapiro <gshapiro@FreeBSD.org>2001-01-21 22:17:06 +0000
committergshapiro <gshapiro@FreeBSD.org>2001-01-21 22:17:06 +0000
commit167a83e7b8733416154f871e39e86ba77eb1554d (patch)
tree4f725bdbff499cf7343d2eaeec15f8a0f0926140 /contrib/sendmail/praliases
parentf84ac9120cb7d9f087e5dcb863c4bf25ba2985e6 (diff)
downloadFreeBSD-src-167a83e7b8733416154f871e39e86ba77eb1554d.zip
FreeBSD-src-167a83e7b8733416154f871e39e86ba77eb1554d.tar.gz
Import sendmail 8.11.2
Diffstat (limited to 'contrib/sendmail/praliases')
-rw-r--r--contrib/sendmail/praliases/praliases.86
-rw-r--r--contrib/sendmail/praliases/praliases.c43
2 files changed, 26 insertions, 23 deletions
diff --git a/contrib/sendmail/praliases/praliases.8 b/contrib/sendmail/praliases/praliases.8
index 0a63a79..91d4498 100644
--- a/contrib/sendmail/praliases/praliases.8
+++ b/contrib/sendmail/praliases/praliases.8
@@ -6,11 +6,11 @@
.\" the sendmail distribution.
.\"
.\"
-.\" $Id: praliases.8,v 8.15 2000/04/06 16:47:24 ca Exp $
+.\" $Id: praliases.8,v 8.15.4.2 2000/12/15 19:50:45 gshapiro Exp $
.\"
-.TH PRALIASES 8 "April 25, 1996"
+.TH PRALIASES 8 "$Date: 2000/12/15 19:50:45 $"
.SH NAME
-.B praliases
+praliases
\- display system mail aliases
.SH SYNOPSIS
.B praliases
diff --git a/contrib/sendmail/praliases/praliases.c b/contrib/sendmail/praliases/praliases.c
index 4c6c4d6..8db0cd1 100644
--- a/contrib/sendmail/praliases/praliases.c
+++ b/contrib/sendmail/praliases/praliases.c
@@ -21,7 +21,7 @@ static char copyright[] =
#endif /* ! lint */
#ifndef lint
-static char id[] = "@(#)$Id: praliases.c,v 8.59.4.10 2000/07/18 05:41:39 gshapiro Exp $";
+static char id[] = "@(#)$Id: praliases.c,v 8.59.4.15 2000/10/24 00:42:59 geir Exp $";
#endif /* ! lint */
#include <sys/types.h>
@@ -56,6 +56,8 @@ BITMAP256 DontBlameSendmail;
extern void syserr __P((const char *, ...));
+# define DELIMITERS " ,/"
+# define PATH_SEPARATOR ':'
int
main(argc, argv)
@@ -170,7 +172,7 @@ main(argc, argv)
break;
b = p;
- p = strpbrk(p, " ,/");
+ p = strpbrk(p, DELIMITERS);
/* find end of spec */
if (p != NULL)
@@ -244,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;
@@ -262,6 +264,7 @@ praliases(filename, argc, argv)
{
while (isascii(*db_name) && isspace(*db_name))
db_name++;
+
if (*db_name != '-')
break;
while (*db_name != '\0' &&
@@ -313,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)
@@ -341,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:
OpenPOWER on IntegriCloud