Nope.  That is unsuitable use of issetugid.  This is not a setuid program.

> 2. Call and check issetugid() to ensure the information from getenv()
> is safe to use. If not, default to _PATH_TMP.
>
>
>Index: sbin/newfs/newfs.c
>===================================================================
>RCS file: /cvs/src/sbin/newfs/newfs.c,v
>retrieving revision 1.97
>diff -u -p -r1.97 newfs.c
>--- sbin/newfs/newfs.c 20 Jul 2014 01:38:40 -0000      1.97
>+++ sbin/newfs/newfs.c 16 Nov 2014 01:17:01 -0000
>@@ -794,7 +797,8 @@ gettmpmnt(char *mountpoint, size_t len)
>       struct statfs fs;
>       size_t n;
> 
>-      tmp = getenv("TMPDIR");
>+      if(issetugid() == 0)
>+              tmp = getenv("TMPDIR");
>       if (tmp == NULL || *tmp == '\0')
>               tmp = _PATH_TMP;
> 
>
>

Reply via email to