diff options
author | markm <markm@FreeBSD.org> | 2001-08-11 14:22:32 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-08-11 14:22:32 +0000 |
commit | 69d76f8cf43a08a167a1d6e5d199614e28cc00db (patch) | |
tree | a3fb320556331569c84bc29a847aa3dde5da0dae | |
parent | 384d536a125c6024cf7043f11aa952cde9c8c87e (diff) | |
download | FreeBSD-src-69d76f8cf43a08a167a1d6e5d199614e28cc00db.zip FreeBSD-src-69d76f8cf43a08a167a1d6e5d199614e28cc00db.tar.gz |
WARNS=2 type cleanup.
WARNS=2 cannot be enable because of an unresolvable conflict in arg 2
of execv(). Document this in the Makefile.
Reviewed by: bde (su.c only)
-rw-r--r-- | usr.bin/su/Makefile | 4 | ||||
-rw-r--r-- | usr.bin/su/su.c | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/su/Makefile b/usr.bin/su/Makefile index 8a349da..ccf6536 100644 --- a/usr.bin/su/Makefile +++ b/usr.bin/su/Makefile @@ -6,6 +6,10 @@ PROG= su DPADD+= ${LIBUTIL} ${LIBPAM} LDADD+= -lutil ${MINUSLPAM} +# Cannot be enabled because of a truly nasty warning/problem +# concering execv(2)'s second argument. +#WARNS?= 2 + BINMODE=4555 INSTALLFLAGS=-fschg diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index 008a815..0231180 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -67,7 +67,7 @@ static const char rcsid[] = #include <security/pam_appl.h> #include <security/pam_misc.h> -#define PAM_END do { \ +#define PAM_END() do { \ int local_ret; \ if (pamh != NULL && creds_set) { \ local_ret = pam_setcred(pamh, PAM_DELETE_CRED); \ @@ -120,9 +120,9 @@ main(int argc, char *argv[]) gid_t gid; int asme, ch, asthem, fastlogin, prio, i, setwhat, retcode, statusp, child_pid, child_pgrp, ret_pid; - char *p, *user, *shell, *username, *cleanenv, **nargv, **np, - *class, *mytty, shellbuf[MAXPATHLEN], + char *username, *cleanenv, *class, shellbuf[MAXPATHLEN], myhost[MAXHOSTNAMELEN + 1]; + const char *p, *user, *shell, *mytty, **nargv, **np; shell = class = cleanenv = NULL; asme = asthem = fastlogin = statusp = 0; @@ -325,11 +325,11 @@ main(int argc, char *argv[]) } if (ret_pid == -1) err(1, "waitpid"); - PAM_END; + PAM_END(); exit(statusp); case -1: err(1, "fork"); - PAM_END; + PAM_END(); exit(1); case 0: /* |