annotate src/hg-wrapper.c @ 20:c75924bd38e3

fix security hole relating to path for package user.
author Robert McIntyre <rlm@mit.edu>
date Thu, 10 Jan 2013 04:25:17 +0000
parents cd47c42f1d0a
children 5caff062fd36
rev   line source
rlm@12 1 #include <pipeline.h>
rlm@13 2 #include <unistd.h>
rlm@12 3
rlm@12 4 main( int argc, char ** argv){
rlm@20 5 pipecmd* p =
rlm@20 6 pipecmd_new("/pkg/hg-committer/hg");
rlm@13 7
rlm@12 8 int i;
rlm@12 9 for(i = 1; i < argc; i++){
rlm@12 10 pipecmd_arg(p, argv[i]);
rlm@12 11 }
rlm@12 12
rlm@13 13 setreuid(geteuid(), geteuid());
rlm@13 14 setregid(getegid(), getegid());
rlm@13 15
rlm@12 16 pipecmd_exec(p);
rlm@12 17 }