]>
git.saurik.com Git - apt.git/blob - test/interactive-helper/aptdropprivs.cc
3 #include <apt-pkg/cmndline.h>
4 #include <apt-pkg/configuration.h>
5 #include <apt-pkg/error.h>
6 #include <apt-pkg/fileutl.h>
10 int main(int const argc
, const char * argv
[])
12 CommandLine::Args Args
[] = {
13 {'c',"config-file",0,CommandLine::ConfigFile
},
14 {'o',"option",0,CommandLine::ArbItem
},
15 {0, "user", "APT::Sandbox::User", CommandLine::HasArg
},
19 CommandLine
CmdL(Args
, _config
);
20 if(CmdL
.Parse(argc
,argv
) == false || DropPrivileges() == false)
22 _error
->DumpErrors(std::cerr
, GlobalError::DEBUG
);
26 return execv(CmdL
.FileList
[0], const_cast<char**>(CmdL
.FileList
));