Mercurial > pkg
comparison src/hg-wrapper.cpp @ 16:cd47c42f1d0a
reorganizing.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Wed, 09 Jan 2013 11:38:31 +0000 |
parents | defaults/hg-wrapper.cpp@e056798af879 |
children |
comparison
equal
deleted
inserted
replaced
15:48c7c2099978 | 16:cd47c42f1d0a |
---|---|
1 #include <cstdlib> | |
2 #include <vector> | |
3 #include <string> | |
4 #include <unistd.h> | |
5 #include <boost/algorithm/string/join.hpp> | |
6 | |
7 /** This a simple wrapper script to call | |
8 mercurial as a semi-privleged user. */ | |
9 | |
10 main( int argc, char ** argv){ | |
11 std::vector<std::string> input(argv, argv+argc); | |
12 input[0] = std::string("hg"); | |
13 std::string command = boost::algorithm::join(input, " "); | |
14 setreuid(geteuid(), geteuid()); | |
15 setregid(getegid(), getegid()); | |
16 return system(command.c_str()); | |
17 } |