Date: Thu, 9 Aug 2001 22:25:09 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Mark Murray <mark@grondar.za> Cc: <audit@FreeBSD.ORG> Subject: Re: [patch] su(1) WARNS=2 cleanup Message-ID: <20010809220814.J15145-100000@besplex.bde.org> In-Reply-To: <200108082136.f78LaNf12227@grimreaper.grondar.za>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 8 Aug 2001, Mark Murray wrote: > > Removing all the casts and "fixing" the types of nargv and np gives the > > following patch. Now there is a fundamental fatal type mismatch between > > np and execv(2)'s second parameter. np needs to have type > > > > char const * <non-const> * > > > > so that it can be initialized without warnings, but it needs to have type > > > > char <non-const> * const * > > > > so that it can be passed to execv(). These requirements are incompatible. > > np must be cast to hide the apparent bug that it is incompatible with > > execve()'s second arg, but -Wcast-qual shows that the cast is a bug. > > So this means that unless something "heavyweight" got done, this is > unfixable? Yes. Heavyweight means fixing the C standard. Other alternatives for the type of execv()'s second parameter, including the correct one (with 2 "const"s) cause even more problems. POSIX.1-200x is a good reference for this. > OK to commit the rest, minus the execv() arg 2 (non-)fix? > (And obviously not the WARNS=2) Just the type changes and the PAM_END changes. Is that the rest? Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010809220814.J15145-100000>