]> git.saurik.com Git - apt.git/blob - test/interactive-helper/aptdropprivs.cc
Don't download "optional" files not in Release :/.
[apt.git] / test / interactive-helper / aptdropprivs.cc
1 #include <config.h>
2
3 #include <apt-pkg/cmndline.h>
4 #include <apt-pkg/configuration.h>
5 #include <apt-pkg/error.h>
6 #include <apt-pkg/fileutl.h>
7
8 #include <unistd.h>
9
10 int main(int const argc, const char * argv[])
11 {
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},
16 {0,0,0,0}
17 };
18
19 CommandLine CmdL(Args, _config);
20 if(CmdL.Parse(argc,argv) == false || DropPrivileges() == false)
21 {
22 _error->DumpErrors(std::cerr, GlobalError::DEBUG);
23 return 42;
24 }
25
26 return execv(CmdL.FileList[0], const_cast<char**>(CmdL.FileList));
27 }