summaryrefslogtreecommitdiff
path: root/usr/src/lib/nsswitch
diff options
context:
space:
mode:
authorJohn Sonnenschein <John.Sonnenschein@Sun.COM>2008-08-27 20:16:01 -0400
committerJohn Sonnenschein <John.Sonnenschein@Sun.COM>2008-08-27 20:16:01 -0400
commit66e150d7d3c0cb2de3c45c74612784ffd3e73de6 (patch)
tree6bf7bbb02dd4201a137e690849a601015d4e4e33 /usr/src/lib/nsswitch
parent4b56a00321e0ce508e55cc5e43e3ad7b00005a39 (diff)
downloadillumos-joyent-66e150d7d3c0cb2de3c45c74612784ffd3e73de6.tar.gz
Contributed by Vinay Simha B.N. <simhavcs@gmail.com> and Beeresh G. <beeresh@gmail.com>
6547525 "*NP*" could use a #define
Diffstat (limited to 'usr/src/lib/nsswitch')
-rw-r--r--usr/src/lib/nsswitch/ldap/common/getspent.c12
-rw-r--r--usr/src/lib/nsswitch/nisplus/common/getspent.c3
2 files changed, 6 insertions, 9 deletions
diff --git a/usr/src/lib/nsswitch/ldap/common/getspent.c b/usr/src/lib/nsswitch/ldap/common/getspent.c
index 707bf6ff44..a533300a08 100644
--- a/usr/src/lib/nsswitch/ldap/common/getspent.c
+++ b/usr/src/lib/nsswitch/ldap/common/getspent.c
@@ -19,11 +19,10 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
#include <shadow.h>
#include <stdlib.h>
@@ -63,7 +62,6 @@ _nss_ldap_shadow2str(ldap_backend_ptr be, nss_XbyY_args_t *argp)
unsigned long len = 0L;
char *tmp, *buffer = NULL;
char *pw_passwd = NULL;
- char np[] = "*NP*";
ns_ldap_result_t *result = be->result;
char **uid, **passwd, **flag, *flag_str;
@@ -87,7 +85,7 @@ _nss_ldap_shadow2str(ldap_backend_ptr be, nss_XbyY_args_t *argp)
* ACL does not allow userpassword to return or
* userpassword is not defined
*/
- pw_passwd = np;
+ pw_passwd = NOPWDRTR;
} else if (strcmp(passwd[0], "") == 0) {
/*
* An empty password is not supported
@@ -98,12 +96,12 @@ _nss_ldap_shadow2str(ldap_backend_ptr be, nss_XbyY_args_t *argp)
if ((tmp = strstr(passwd[0], "{crypt}")) != NULL ||
(tmp = strstr(passwd[0], "{CRYPT}")) != NULL) {
if (tmp != passwd[0])
- pw_passwd = np;
+ pw_passwd = NOPWDRTR;
else
pw_passwd = tmp + strlen("{crypt}");
} else {
- /* Replace it with *NP* */
- pw_passwd = np;
+ /* mark password as not retrievable */
+ pw_passwd = NOPWDRTR;
}
}
len += strlen(pw_passwd);
diff --git a/usr/src/lib/nsswitch/nisplus/common/getspent.c b/usr/src/lib/nsswitch/nisplus/common/getspent.c
index 025a43e3b2..4110d81dfb 100644
--- a/usr/src/lib/nsswitch/nisplus/common/getspent.c
+++ b/usr/src/lib/nsswitch/nisplus/common/getspent.c
@@ -30,7 +30,6 @@
* ("shadow") of the same table that stores vanilla passwd information.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/types.h>
#include <shadow.h>
@@ -205,7 +204,7 @@ nis_object2str(nobj, obj, be, argp)
* _nss_nisplus_getent(), but that's OK -- when we're doing
* enumerations we don't care what's in the argp->key union.
*/
- if (strncmp(passwd, "*NP*", passwdlen) == 0) {
+ if (strncmp(passwd, NOPWDRTR, passwdlen) == 0) {
be->flag = 1;
argp->key.uid = uid;
}