summaryrefslogtreecommitdiffstats
path: root/usr.bin/su
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-09-07 16:20:38 +0000
committermarkm <markm@FreeBSD.org>2001-09-07 16:20:38 +0000
commit0c5fbd643b66df381a714aa62efea551e98afae8 (patch)
tree00df23ba8a144e75f5326d9ffc2d411263350eec /usr.bin/su
parentcefec83f16afb81d6b3c9846ad58cbb207bbd5a4 (diff)
downloadFreeBSD-src-0c5fbd643b66df381a714aa62efea551e98afae8.zip
FreeBSD-src-0c5fbd643b66df381a714aa62efea551e98afae8.tar.gz
Back out (with prejudice) the last WARNS=2 fix. I cannot understand
its failure mode, and will revisit it later.
Diffstat (limited to 'usr.bin/su')
-rw-r--r--usr.bin/su/Makefile4
-rw-r--r--usr.bin/su/su.c16
2 files changed, 9 insertions, 11 deletions
diff --git a/usr.bin/su/Makefile b/usr.bin/su/Makefile
index 7d20843..ccf6536 100644
--- a/usr.bin/su/Makefile
+++ b/usr.bin/su/Makefile
@@ -6,7 +6,9 @@ PROG= su
DPADD+= ${LIBUTIL} ${LIBPAM}
LDADD+= -lutil ${MINUSLPAM}
-WARNS?= 2
+# 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 a5e454a..8f03a4c 100644
--- a/usr.bin/su/su.c
+++ b/usr.bin/su/su.c
@@ -114,17 +114,13 @@ main(int argc, char *argv[])
struct pam_conv conv = {misc_conv, NULL};
enum tristate iscsh;
login_cap_t *lc;
- union {
- const char **a;
- char * const b[1];
- } np;
uid_t ruid;
gid_t gid;
int asme, ch, asthem, fastlogin, prio, i, setwhat, retcode,
statusp, child_pid, child_pgrp, ret_pid;
char *username, *cleanenv, *class, shellbuf[MAXPATHLEN],
myhost[MAXHOSTNAMELEN + 1];
- const char *p, *user, *shell, *mytty, **nargv;
+ const char *p, *user, *shell, *mytty, **nargv, **np;
shell = class = cleanenv = NULL;
asme = asthem = fastlogin = statusp = 0;
@@ -169,7 +165,7 @@ main(int argc, char *argv[])
nargv[argc + 3] = NULL;
for (i = argc; i >= optind; i--)
nargv[i + 3] = argv[i];
- np.a = &nargv[i + 3];
+ np = &nargv[i + 3];
argv += optind;
@@ -382,18 +378,18 @@ main(int argc, char *argv[])
if (iscsh == YES) {
if (fastlogin)
- *np.a-- = "-f";
+ *np-- = "-f";
if (asme)
- *np.a-- = "-m";
+ *np-- = "-m";
}
/* csh strips the first character... */
- *np.a = asthem ? "-su" : iscsh == YES ? "_su" : "su";
+ *np = asthem ? "-su" : iscsh == YES ? "_su" : "su";
if (ruid != 0)
syslog(LOG_NOTICE, "%s to %s%s", username, user,
ontty());
- execv(shell, np.b);
+ execv(shell, np);
err(1, "%s", shell);
}
}
OpenPOWER on IntegriCloud