/[monit]/monit/spawn.c
ViewVC logotype

Diff of /monit/spawn.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by hauk, Fri Feb 28 23:00:29 2003 UTC revision 1.19 by hauk, Wed Apr 30 23:24:22 2003 UTC
# Line 144  void  spawn(Process_T P, Command_T C) { Line 144  void  spawn(Process_T P, Command_T C) {
144         * Redirect the standard file descriptors         * Redirect the standard file descriptors
145         */         */
146        redirect_stdfd();        redirect_stdfd();
147          
148          /*
149           * Switch uid and gid if requested
150           */
151          if(c->has_gid) {
152            if(0 == setgid(c->gid)) {
153              log("Failed to change gid to '%d' for '%s'\n",
154                  c->gid, c->arg[0]);
155            }
156          }
157          if(c->has_uid) {
158            if(0 == setuid(c->uid)) {
159              log("Failed to change uid to '%d' for '%s'\n",
160                  c->uid, c->arg[0]);
161            }
162          }
163            
164        /*        /*
165         * The exec statement done by the second child         * The exec statement done by the second child
166         */         */
# Line 219  static Command_T copy_command(Command_T Line 235  static Command_T copy_command(Command_T
235        P->arg[i]= xstrdup(C->arg[i]);        P->arg[i]= xstrdup(C->arg[i]);
236    P->arg[i]= NULL;    P->arg[i]= NULL;
237    
238      P->uid= C->uid;
239      P->gid= C->gid;
240      P->has_uid= C->has_uid;
241      P->has_gid= C->has_gid;
242    
243    return P;    return P;
244        
245  }  }

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26