diff options
author | markm <markm@FreeBSD.org> | 2001-09-12 19:15:02 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-09-12 19:15:02 +0000 |
commit | 12c7e49b74c6f21bec4a43fc126ad168736fadbf (patch) | |
tree | 669c8f446ca11f0c24f385553408046018009334 /usr.bin/su/su.c | |
parent | 4a2c71d741ee78b22189be71f0cc5d8a633a7425 (diff) | |
download | FreeBSD-src-12c7e49b74c6f21bec4a43fc126ad168736fadbf.zip FreeBSD-src-12c7e49b74c6f21bec4a43fc126ad168736fadbf.tar.gz |
Reinstate complete (and now correctly functioning) WARNS=2.
Diffstat (limited to 'usr.bin/su/su.c')
-rw-r--r-- | usr.bin/su/su.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index 8f03a4c..dec6a12 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -114,13 +114,17 @@ 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; + } 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, **np; + const char *p, *user, *shell, *mytty, **nargv; shell = class = cleanenv = NULL; asme = asthem = fastlogin = statusp = 0; @@ -165,7 +169,7 @@ main(int argc, char *argv[]) nargv[argc + 3] = NULL; for (i = argc; i >= optind; i--) nargv[i + 3] = argv[i]; - np = &nargv[i + 3]; + np.a = &nargv[i + 3]; argv += optind; @@ -378,18 +382,18 @@ main(int argc, char *argv[]) if (iscsh == YES) { if (fastlogin) - *np-- = "-f"; + *np.a-- = "-f"; if (asme) - *np-- = "-m"; + *np.a-- = "-m"; } /* csh strips the first character... */ - *np = asthem ? "-su" : iscsh == YES ? "_su" : "su"; + *np.a = asthem ? "-su" : iscsh == YES ? "_su" : "su"; if (ruid != 0) syslog(LOG_NOTICE, "%s to %s%s", username, user, ontty()); - execv(shell, np); + execv(shell, np.b); err(1, "%s", shell); } } |