11 /* -------------------------------------------------------------------------- */
13 static void re_exec_as_other();
15 /* -------------------------------------------------------------------------- */
17 int main(int argc, char* argv[])
19 c_init(0, cilux_version, cilux_ciux, 0);
26 void re_exec_as_other()
32 struct passwd* pw=getpwnam(other);
33 if(!pw){ printf("fail: getpwnam(\"%s\");\n", other); exit(1); }
43 printf("Failed to fork\n");
46 printf("pid %d\n", pid);
52 if(setgroups(0,0)== -1){
53 printf("fail: setgroups(0,0)\n");
57 printf("fail: setgid(%d)\n", gid);
60 if(initgroups(other, gid)== -1){
61 printf("fail: initgroups(\"%s\",%d)\n", other, gid);
65 printf("fail: setuid(%d)\n", uid);
71 /* -------------------------------------------------------------------------- */