diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-01 18:24:02 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2009-06-01 18:24:02 +0000 |
commit | 60ec726641e4fd8cec6667ccff45042632ca551d (patch) | |
tree | a0560d14497cf54780cb1a013a4d713a2c760a52 /usr.sbin/smtpd/lka.c | |
parent | 2d1386bf8aee8631a47cac75965392ee2b922f08 (diff) |
No need for save_getpwuid and such functions which call endpwent.
endpwent is not needed unless setpwent (with stayopen = 1) or getpwent
was used. getpwuid/getpwnam do not use getpwent; i think people must
be assuming this. we are going to improve the man pages for this.
ok gilles
Diffstat (limited to 'usr.sbin/smtpd/lka.c')
-rw-r--r-- | usr.sbin/smtpd/lka.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c index 52d011309c5..59c05af088f 100644 --- a/usr.sbin/smtpd/lka.c +++ b/usr.sbin/smtpd/lka.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka.c,v 1.52 2009/06/01 13:20:56 jacekm Exp $ */ +/* $OpenBSD: lka.c,v 1.53 2009/06/01 18:24:01 deraadt Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -800,7 +800,7 @@ lka_resolve_mail(struct smtpd *env, struct rule *rule, struct path *path) else if (aliases_exist(env, username)) path->flags |= F_PATH_ALIAS; else { - pw = safe_getpwnam(username); + pw = getpwnam(username); if (pw == NULL) return 0; (void)strlcpy(path->pw_name, pw->pw_name, @@ -829,7 +829,7 @@ lka_expand(char *buf, size_t len, struct path *path) for (p = path->rule.r_value.path; *p != '\0'; ++p) { if (p == path->rule.r_value.path && *p == '~') { if (*(p + 1) == '/' || *(p + 1) == '\0') { - pw = safe_getpwnam(path->pw_name); + pw = getpwnam(path->pw_name); if (pw == NULL) continue; @@ -855,7 +855,7 @@ lka_expand(char *buf, size_t len, struct path *path) *delim = '\0'; } - pw = safe_getpwnam(username); + pw = getpwnam(username); if (pw == NULL) continue; @@ -1114,7 +1114,7 @@ lka_resolve_path(struct smtpd *env, struct path *path) path->flags |= F_PATH_ALIAS; else { path->flags |= F_PATH_ACCOUNT; - pw = safe_getpwnam(username); + pw = getpwnam(username); if (pw == NULL) return 0; (void)strlcpy(path->pw_name, pw->pw_name, |