summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/libsm/mbdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/libsm/mbdb.c')
-rw-r--r--contrib/sendmail/libsm/mbdb.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/contrib/sendmail/libsm/mbdb.c b/contrib/sendmail/libsm/mbdb.c
index 3bb514d..482ed70 100644
--- a/contrib/sendmail/libsm/mbdb.c
+++ b/contrib/sendmail/libsm/mbdb.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001-2003,2009 Sendmail, Inc. and its suppliers.
+ * Copyright (c) 2001-2003,2009 Proofpoint, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Id: mbdb.c,v 1.41 2009/06/19 22:02:26 guenther Exp $")
+SM_RCSID("@(#)$Id: mbdb.c,v 1.43 2014/01/08 17:03:15 ca Exp $")
#include <sys/param.h>
@@ -332,23 +332,16 @@ mbdb_pw_lookup(name, user)
pw = getpwnam(name);
if (pw == NULL)
{
-#if 0
+#if _FFR_USE_GETPWNAM_ERRNO
/*
- ** getpwnam() isn't advertised as setting errno.
- ** In fact, under FreeBSD, non-root getpwnam() on
- ** non-existant users returns NULL with errno = EPERM.
- ** This test won't work.
+ ** Only enable this code iff
+ ** user unknown <-> getpwnam() == NULL && errno == 0
+ ** (i.e., errno unchanged); see the POSIX spec.
*/
- switch (errno)
- {
- case 0:
- return EX_NOUSER;
- case EIO:
- return EX_OSERR;
- default:
+
+ if (errno != 0)
return EX_TEMPFAIL;
- }
-#endif /* 0 */
+#endif /* _FFR_USE_GETPWNAM_ERRNO */
return EX_NOUSER;
}
OpenPOWER on IntegriCloud