URI:
       Use setegid instead of setgid - utmp - simple login manager  
  HTML git clone git://git.suckless.org/utmp
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 2583293ac5eb66e988cb0492ca707779b8ea2be6
   DIR parent 4a855c000f1d300a44c784ed88d78a11d41cdca7
  HTML Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
       Date:   Sun, 22 Feb 2015 16:25:34 +0000
       
       Use setegid instead of setgid
       
       The definition of seteigd is better than the definition of
       setgid, which behaviour depends of _POSIX_SAVED_IDS.
       
       Diffstat:
         M bsd.c                               |       4 ++--
         M posix.c                             |       4 ++--
         M utmp.c                              |       5 -----
       
       3 files changed, 4 insertions(+), 9 deletions(-)
       ---
   DIR diff --git a/bsd.c b/bsd.c
       @@ -44,9 +44,9 @@ addutmp(void)
                strncpy(utmp.ut_host, host, sizeof(utmp.ut_host));
                time(&utmp.ut_time);
        
       -        setgid(egid);
       +        setegid(egid);
                login(&utmp);
       -        setgid(gid);
       +        setegid(gid);
        }
        
        void
   DIR diff --git a/posix.c b/posix.c
       @@ -98,10 +98,10 @@ addutmp(void)
                utmp.ut_tv.tv_usec = 0;
                 /* don't use no standard fields host and session */
        
       -        setgid(egid);
       +        setegid(egid);
                if(!pututxline(&utmp))
                        die("error adding utmp entry:%s", strerror(errno));
       -        setgid(gid);
       +        setegid(gid);
                endutxent();
        }
        
   DIR diff --git a/utmp.c b/utmp.c
       @@ -14,11 +14,6 @@
        #include <sys/wait.h>
        
        
       -#ifndef _POSIX_SAVED_IDS
       -#error "This program needs saved id behaviour"
       -#endif
       -
       -
        struct passwd *pw;
        gid_t egid, gid;