execve problem???

From: Java Boy (javaboy_at_zapo.net)
Date: 08/07/03


Date: 6 Aug 2003 17:44:50 -0700

HI there...
    I compile the following code(as root) and sets the setuid bit...
as it gives a shell to any user but when the setuid bit is set the
shell should have the privileges of root but in my case it doesn't
have those privileges. I'm using redhat 7.1

#include<stdio.h>
#include<unistd.h>

int main()
{
 char *file[2];
 file[0]="/bin/sh";
 file[1]=NULL;
 execve(file[0],file ,NULL);

return 0;
}

Thanks!



Relevant Pages

  • execve problem???
    ... I compile the following code(as root) and sets the setuid bit... ... as it gives a shell to any user but when the setuid bit is set the ... shell should have the privileges of root but in my case it doesn't ...
    (alt.os.linux)
  • Re: [patch, 2.6.11-rc2] sched: RLIMIT_RT_CPU_RATIO feature
    ... The programs in question can be setuid ... setuid root is precisely what we are attempting to ... then the the program immediately and irrevocably drops root privileges ... either change policy to RT or fork another task that needs the same ...
    (Linux-Kernel)
  • Silly Little Question about SETUID
    ... I recently helped a non-privileged user set the setuid bit on a shell ... I used vi on it as root to make a small fix to it and it continued ...
    (SunManagers)
  • Re: root daemon dropping privileges temporarily?
    ... the program is launched as root and does setuid() after it ... > the software is running as root. ... I ran into a different scheme, this one separates privileges and seems ... I think the only way the parent (root, authenticator) can be compromised is ...
    (comp.unix.programmer)
  • Re: root daemon dropping privileges temporarily?
    ... the program is launched as root and does setuid() after it ... > the software is running as root. ... I ran into a different scheme, this one separates privileges and seems ... I think the only way the parent (root, authenticator) can be compromised is ...
    (comp.os.linux.security)