aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Murray <markm@FreeBSD.org>2001-08-11 14:22:32 +0000
committerMark Murray <markm@FreeBSD.org>2001-08-11 14:22:32 +0000
commit8cc3b02f98596bb081302a43898f8a3cf0638453 (patch)
treea3fb320556331569c84bc29a847aa3dde5da0dae
parent537db852910c3eef4e381892fdbe0855896aedc6 (diff)
downloadsrc-8cc3b02f98596bb081302a43898f8a3cf0638453.tar.gz
src-8cc3b02f98596bb081302a43898f8a3cf0638453.zip
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)
Notes
Notes: svn path=/head/; revision=81528
-rw-r--r--usr.bin/su/Makefile4
-rw-r--r--usr.bin/su/su.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/su/Makefile b/usr.bin/su/Makefile
index 8a349da53f2c..ccf65365effa 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 008a815bd6aa..0231180f43e8 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:
/*