aboutsummaryrefslogtreecommitdiffstats
path: root/amd/info_passwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'amd/info_passwd.c')
-rw-r--r--amd/info_passwd.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/amd/info_passwd.c b/amd/info_passwd.c
index c8bf388b1d65..3c4486693c60 100644
--- a/amd/info_passwd.c
+++ b/amd/info_passwd.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997-2006 Erez Zadok
+ * Copyright (c) 1997-2014 Erez Zadok
* Copyright (c) 1990 Jan-Simon Pendry
* Copyright (c) 1990 Imperial College of Science, Technology & Medicine
* Copyright (c) 1990 The Regents of the University of California.
@@ -16,11 +16,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgment:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -94,11 +90,11 @@ passwd_init(mnt_map *m, char *map, time_t *tp)
int
passwd_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp)
{
- char *dir = 0;
+ char *dir = NULL;
struct passwd *pw;
if (STREQ(key, "/defaults")) {
- *pval = strdup("type:=nfs");
+ *pval = xstrdup("type:=nfs");
return 0;
}
pw = getpwnam(key);
@@ -123,7 +119,7 @@ passwd_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp)
char *p, *q;
char val[MAXPATHLEN];
char rhost[MAXHOSTNAMELEN];
- dir = strdup(pw->pw_dir);
+ dir = xstrdup(pw->pw_dir);
/*
* Find user name. If no / then Invalid...
@@ -180,13 +176,12 @@ passwd_search(mnt_map *m, char *map, char *key, char **pval, time_t *tp)
dlog("passwd_search: map=%s key=%s -> %s", map, key, val);
if (q)
*q = '.';
- *pval = strdup(val);
+ *pval = xstrdup(val);
return 0;
}
enoent:
- if (dir)
- XFREE(dir);
+ XFREE(dir);
return ENOENT;
}