[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

setresuid problem



Hi all.

I'm having problems with setresuid system call.

For example, in following program all setresuid calls fail:

#include <unistd.h>
#include <sys/types.h>

/* avoid "implicit declaration..." */
int setresuid(uid_t ruid, uid_t euid, uid_t suid);

int main()
{
        int i;
        i = setresuid(13, 13, 0);
        i = setresuid((uid_t)-1, 0, (uid_t)-1);
        i = setresuid(0, 0, 0);
        exit(0);
}

Strace output:
execve("./kk", ["./kk"], [/* 20 vars */]) = 0
brk(0)                                  = 0x120100ab0
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=01, st_size=880681123, ...}) = 0
mmap(0, 4831835376, PROT_READ, 0 /* MAP_??? */, 0, 0) = 0x15555566000
close(3)                                = 0
open("/lib/libc.so.6.1", O_RDONLY)      = 3
mmap(0, 0, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x15555568000
munmap(0x15555568000, 8192)             = 0
mmap(0, 8192, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x15555668000
mprotect(0x15555732000, 1131048, PROT_NONE) = 0
mmap(0x15555768000, 1131048, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x15555768000
mmap(0x1555583c000, 1131048, PROT_NONE, 0 /* MAP_??? */, 0, 0) = 0x1555583c000
close(3)                                = 0
personality(PER_LINUX)                  = 0
osf_getsysinfo(0x2d, 0x11ffffb30, 0x11ffffb98, 0, 0x300000000) = 0
osf_setsysinfo(0xe, 0x11ffffb30, 0x11ffffb98, 0, 0x300000000) = 0
getxpid()                               = 24521
SYS_343(0xd, 0xd, 0, 0, 0x5fc8)         = -1 EPERM (Operation not permitted)
SYS_343(0xffffffffffffffff, 0, 0xffffffffffffffff, 0x1, 0x5fc8) = -1 EPERM (Operation not permitted)
SYS_343(0, 0, 0, 0x1, 0x5fc8)           = -1 EPERM (Operation not permitted)
exit(0)                                 = ?

# grep setresuid `find /usr/include -name '*.h' -type f`|less
./asm/unistd.h:#define __NR_setresuid                   343
./syscall-list.h:#define SYS_setresuid __NR_setresuid

# nm -D /lib/libc.so.6.1 |grep setresuid
000000000009dcf8 T setresuid

Kernel 2.0.30 + alpha_patches-2.0.30-0.3 + rtc.diff + traps.diff
Libc:
ii  libc6.1         2.0.5c-0.1     The GNU C library version 2 (run-time files)
ii  libc6.1-dev     2.0.5c-0.1     The GNU C library version 2 (development fil

In i386 setresuid() just doesn't exist (but it has man page...:-?)
Should I #undef setresuid? squid's autoconf finds it, but then
fails to execute...

Ideas?

Regards,
-- 
Roberto Lumbreras Pastor  *  mailto:rover@lander.es
Lander Internet - Spain   *  http://www.lander.es/
Tel +34 1 556.28.83       *  Fax +34 1 556.30.01

* Linux is FREE, and if you don't like it YOU can CHANGE it. *


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-alpha-request@lists.debian.org . Trouble? 
e-mail to templin@bucknell.edu .


Reply to: