hello
in a c-prog (on solaris) i set the uid+euid to NEWuser, gid+egid to NEWgrp, using set(e)(uid|gid), sure NEWusr AND NEWgrp are well defined
in /etc/(passwd|group) both to abba,
then i create a file (it does not matter how, (f)open, creat, system, exec.. and so on);
as ROOT i run the program, AND the created file:
is owned by ROOT and has ROOT-grps grp
i expect: owner is the NEWusr and grp is NEWgrp.
the prog is owned by a normal-user:
---------------
if(getuid()) exit(1); /* user != root */
setuid(111); seteuid(111);
setguid(111); setegid(111);
system("ls -l >filename"
system("ls -l filename"
-----------------
the output: -rw-rw-r-- 1 root root 89879 Apr 19 15:34 filename
expected is:-rw-rw-r-- 1 abba abba 89879 Apr 19 15:34 filename
i also tried, setting usr+grp execflag on exec: chmod 6755 exec
any idea, thanks a lot, iribach
in a c-prog (on solaris) i set the uid+euid to NEWuser, gid+egid to NEWgrp, using set(e)(uid|gid), sure NEWusr AND NEWgrp are well defined
in /etc/(passwd|group) both to abba,
then i create a file (it does not matter how, (f)open, creat, system, exec.. and so on);
as ROOT i run the program, AND the created file:
is owned by ROOT and has ROOT-grps grp
i expect: owner is the NEWusr and grp is NEWgrp.
the prog is owned by a normal-user:
---------------
if(getuid()) exit(1); /* user != root */
setuid(111); seteuid(111);
setguid(111); setegid(111);
system("ls -l >filename"
system("ls -l filename"
-----------------
the output: -rw-rw-r-- 1 root root 89879 Apr 19 15:34 filename
expected is:-rw-rw-r-- 1 abba abba 89879 Apr 19 15:34 filename
i also tried, setting usr+grp execflag on exec: chmod 6755 exec
any idea, thanks a lot, iribach