[BACK]Return to su.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / su

Diff for /src/usr.bin/su/su.c between version 1.22 and 1.23

version 1.22, 1997/06/20 02:12:40 version 1.23, 1997/06/20 21:59:17
Line 90 
Line 90 
         uid_t ruid;          uid_t ruid;
         int asme, ch, asthem, fastlogin, prio;          int asme, ch, asthem, fastlogin, prio;
         enum { UNSET, YES, NO } iscsh = UNSET;          enum { UNSET, YES, NO } iscsh = UNSET;
         char *user, *shell, *avshell, *username, **cleanenv, **np;          char *user, *shell, *avshell, *username, *k, **np;
         char shellbuf[MAXPATHLEN], avshellbuf[MAXPATHLEN];          char shellbuf[MAXPATHLEN], avshellbuf[MAXPATHLEN];
   
         asme = asthem = fastlogin = 0;          asme = asthem = fastlogin = 0;
Line 234 
Line 234 
         if (!asme) {          if (!asme) {
                 if (asthem) {                  if (asthem) {
                         p = getenv("TERM");                          p = getenv("TERM");
                         if ((cleanenv = calloc(1, sizeof (char *))) == NULL)  #ifdef KERBEROS
                           k = getenv("KRBTKFILE");
   #endif
                           if ((environ = calloc(1, sizeof (char *))) == NULL)
                                 errx(1, "calloc");                                  errx(1, "calloc");
                         environ = cleanenv;  
                         (void)setenv("PATH", _PATH_DEFPATH, 1);                          (void)setenv("PATH", _PATH_DEFPATH, 1);
                         if (p)                          if (p)
                                 (void)setenv("TERM", p, 1);                                  (void)setenv("TERM", p, 1);
   #ifdef KERBEROS
                           if (k)
                                   (void)setenv("KRBTKFILE", k, 1);
   #endif
   
                         seteuid(pwd->pw_uid);                          seteuid(pwd->pw_uid);
                         setegid(pwd->pw_gid);                          setegid(pwd->pw_gid);

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23