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

Diff for /src/usr.bin/doas/env.c between version 1.7 and 1.8

version 1.7, 2019/06/16 18:16:34 version 1.8, 2019/06/17 16:01:26
Line 85 
Line 85 
 createenv(const struct rule *rule, const struct passwd *mypw,  createenv(const struct rule *rule, const struct passwd *mypw,
     const struct passwd *targpw)      const struct passwd *targpw)
 {  {
           static const char *copyset[] = {
                   "DISPLAY", "TERM",
                   NULL
           };
         struct env *env;          struct env *env;
         u_int i;          u_int i;
   
Line 95 
Line 99 
         env->count = 0;          env->count = 0;
   
         addnode(env, "DOAS_USER", mypw->pw_name);          addnode(env, "DOAS_USER", mypw->pw_name);
           addnode(env, "HOME", targpw->pw_dir);
           addnode(env, "LOGNAME", targpw->pw_name);
           addnode(env, "PATH", getenv("PATH"));
           addnode(env, "SHELL", targpw->pw_shell);
           addnode(env, "USER", targpw->pw_name);
   
           fillenv(env, copyset);
   
         if (rule->options & KEEPENV) {          if (rule->options & KEEPENV) {
                 extern const char **environ;                  extern const char **environ;
   
Line 124 
Line 135 
                                 env->count++;                                  env->count++;
                         }                          }
                 }                  }
         } else {  
                 static const char *copyset[] = {  
                         "DISPLAY", "TERM",  
                         NULL  
                 };  
   
                 addnode(env, "HOME", targpw->pw_dir);  
                 addnode(env, "LOGNAME", targpw->pw_name);  
                 addnode(env, "PATH", getenv("PATH"));  
                 addnode(env, "SHELL", targpw->pw_shell);  
                 addnode(env, "USER", targpw->pw_name);  
   
                 fillenv(env, copyset);  
         }          }
   
         return env;          return env;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8