make problems as non root user
Chris
chrcoluk at gmail.com
Sun Apr 2 19:02:19 UTC 2006
Hi this is a problem that occured on freebsd5.x as well. Box running
6.0-release.
after a configure as a non root user and typing make I get permission denied.
ezbounce-1.50-pre8 # make
make: Permission denied
ezbounce-1.50-pre8 # which make
/usr/bin/make
ezbounce-1.50-pre8 # ls -l /usr/bin/make
-r-xr-xr-x 1 root wheel 284812 Mar 17 06:38 /usr/bin/make
and then doing this it will work
ezbounce-1.50-pre8 # cd ..
chrysalis # cd ezbounce-1.50-pre8
ezbounce-1.50-pre8 # make
cd src; make all
cd ../lib/ ; make all
g++ -D__EZBOUNCE__ -Wall -O2 -c dynbuff.cpp
.......
after speaking to someone else they also pointed out simply doing a cd
. makes it work also.
here is some strace outputs
strace from failure.
execve(0xbfbfe830, [0xbfbfecf8], [/* 0 vars */]) = 0
readlink("/etc/malloc.conf", 0xbfbfec30, 63) = -1 ENOENT (No such file
or directory)
issetugid(0x808565b) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0x28087000
break(0x8091000) = 0
break(0x8092000) = 0
sysarch(0xa, 0xbfbfecc0) = 0
break(0x8093000) = 0
getrlimit(RLIMIT_NOFILE, {rlim_cur=578297877454292699,
rlim_max=578297877454292699}) = 0
setrlimit(RLIMIT_NOFILE, {rlim_cur=578302322745444059,
rlim_max=578301970558125787}) = 0
__sysctl([134645467.134645467], 2, 0xbfbfdf60, 0xbfbfdf54,
"machdep.ispc98", 14) = -1 ENOENT (No such file or directory)
syscall_416(0x14, 0xbfbfdfb0, 0) = 0
break(0x8094000) = 0
break(0x8095000) = 0
break(0x8096000) = 0
break(0x8097000) = 0
__getcwd(0xbfbfe0c0, 1024) = -1 ENOTDIR (Not a directory)
stat("/", {st_mode=S_IFCHR|S_ISGID|0440, st_rdev=makedev(110,
543621225), ...}) = 0
lstat(".", {st_mode=0, st_size=0, ...}) = 0
stat("..", {st_mode=0, st_size=0, ...}) = 0
open("..", O_RDONLY|O_NONBLOCK) = 3
fstat(3, {st_mode=0, st_size=0, ...}) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
__sysctl([sysctl.0], 2, "", [0], NULL, 0) = 0
syscall_397(0x3, 0xbfbfdca0) = 0
break(0x8098000) = 0
fstat(3, {st_mode=0, st_size=0, ...}) = 0
getdirentries(3, /* 21 entries */, 4096, [0]) = 512
lseek(3, 0, SEEK_SET) = 0
close(3) = 0
lstat("../", {st_mode=0, st_size=0, ...}) = 0
stat("../..", {st_mode=0, st_size=0, ...}) = 0
open("../..", O_RDONLY|O_NONBLOCK) = -1 EACCES (Permission denied)
write(2, "\0\0\0\0\0\0", 6make: ) = 6
write(2, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 18Permission denied
) = 18
exit(2) = ?
and from success the first part of the strace
execve(0xbfbfe830, [0xbfbfecf8], [/* 0 vars */]) = 0
readlink("/etc/malloc.conf", 0xbfbfec30, 63) = -1 ENOENT (No such file
or directory)
issetugid(0x808565b) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0x28087000
break(0x8091000) = 0
break(0x8092000) = 0
sysarch(0xa, 0xbfbfecc0) = 0
break(0x8093000) = 0
getrlimit(RLIMIT_NOFILE, {rlim_cur=578297877454292699,
rlim_max=578297877454292699}) = 0
setrlimit(RLIMIT_NOFILE, {rlim_cur=578302322745444059,
rlim_max=578301970558125787}) = 0
__sysctl([134645467.134645467], 2, 0xbfbfdf60, 0xbfbfdf54,
"machdep.ispc98", 14) = -1 ENOENT (No such file or directory)
syscall_416(0x14, 0xbfbfdfb0, 0) = 0
break(0x8094000) = 0
break(0x8095000) = 0
break(0x8096000) = 0
break(0x8097000) = 0
__getcwd("", 1024) = 0
stat("include", {st_mode=0400, st_size=12129123790600, ...}) = 0
stat", 0xbfbfdf70) = -1 ENOENT (No such file or directory)
stat("obj", 0xbfbfdf70) = -1 ENOENT (No such file or directory)
stat("AKE", 0xbfbfdf70) = -1 ENOENT (No such file or directory)
stat(".", {st_mode=S_IFBLK|S_ISUID|0546, st_rdev=makedev(101,
572522604), ...}) = 0
open(".", O_RDONLY|O_NONBLOCK) = 3
fstat(3, {st_mode=S_IFBLK|S_ISUID|0546, st_rdev=makedev(101,
572522604), ...}) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
__sysctl([774382592.111236026], 2,
"\0\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
[2708037], NULL, 0) = 0
syscall_397(0x3, 0xbfbfdd30) = 0
getdirentries(3, /* 26 entries */, 4096, [0]) = 512
getdirentries(3, /* 0 entries */, 4096, [512]) = 0
lseek(3, 0, SEEK_SET) = 0
close(3) = 0
gettimeofday({1, 0}, NULL) = 0
stat("", {st_mode=0, st_size=0, ...}) = 0
open("", O_RDONLY|O_NONBLOCK) = 3
fstat(3, {st_mode=0, st_size=0, ...}) = 0
So the cwd is where it starts going wrong, I assume the configure cd's
to somewhere it doesnt like and it makes it go bad, when I added cd .
to the end of the configure script it works.
Some other info.
This happens with a lot of source apps, eggdrop, psybnc, ultimateircd etc.
It only happens as non root users.
It seems to only happen right after running configure, so if I do
anything like cd . or logout and relogin as the user there is no
problem. So to reoccur the problem run ./configure then make and bam
the access denied, simply typing make again will give same error but
then do anything else that requires a dir traversal it works.
this happened in freebsd 5.x as well but I believe it doesnt occur in
freebsd 4.x.
It is a nuisance because if I supply user accounts for shells user's
will tend to upgrade src tarballs and the compile their own stuff and
will hit this problem.
I dont know if it is a bug with make or not but I would like to know
what makes it break, let me know if you need more info, thanks.
Chris
More information about the freebsd-stable
mailing list