diff options
-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: /* |