[PATCH app/xload 2/2] Don't try to use [gs]et[ug]id on Win32

Alan Coopersmith alan.coopersmith at oracle.com
Tue Apr 21 20:42:34 PDT 2015


On 04/21/15 05:44 AM, Jon TURNEY wrote:
> Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
> ---
>   xload.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/xload.c b/xload.c
> index 32adcdd..4c07102 100644
> --- a/xload.c
> +++ b/xload.c
> @@ -178,6 +178,8 @@ main(int argc, char **argv)
>       /* For security reasons, we reset our uid/gid after doing the necessary
>          system initialization and before calling any X routines. */
>       InitLoadPoint();
> +
> +#if !defined(_WIN32) || defined(__CYGWIN__)
>       /* reset gid first while still (maybe) root */
>       if (setgid(getgid()) == -1) {
>   	    fprintf(stderr, gettext("%s: setgid failed: %s\n"),
> @@ -189,6 +191,7 @@ main(int argc, char **argv)
>   		ProgramName, strerror(errno));
>   	    exit(1);
>       }
> +#endif
>
>       XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL);
>
>

You're not installing this with whatever the equivalent of
setuid/setgid bits is, are you?  If not, then this makes sense and is:

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list