2 #include <kernelplat.h>
6 /* -------------------------------------------------------------------------- */
8 static void re_exec_as_other();
10 /* -------------------------------------------------------------------------- */
12 int main(int argc, char* argv[])
14 c_init(0, cilux_version, cilux_ciux, 0);
21 void re_exec_as_other()
27 struct passwd* pw=getpwnam(other);
28 if(!pw){ printf("fail: getpwnam(\"%s\");\n", other); exit(1); }
38 printf("Failed to fork\n");
41 printf("pid %d\n", pid);
47 if(setgroups(0,0)== -1){
48 printf("fail: setgroups(0,0)\n");
52 printf("fail: setgid(%d)\n", gid);
55 if(initgroups(other, gid)== -1){
56 printf("fail: initgroups(\"%s\",%d)\n", other, gid);
60 printf("fail: setuid(%d)\n", uid);
66 /* -------------------------------------------------------------------------- */