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