Date: Sun, 2 Apr 2006 20:02:18 +0100 From: Chris <chrcoluk@gmail.com> To: "FreeBSD Stable" <freebsd-stable@freebsd.org> Subject: make problems as non root user Message-ID: <3aaaa3a0604021202q63e58630q45b5d35750739c9d@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
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 denie= d. 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 */]) =3D 0 readlink("/etc/malloc.conf", 0xbfbfec30, 63) =3D -1 ENOENT (No such file or directory) issetugid(0x808565b) =3D 0 mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) =3D 0x2808= 7000 break(0x8091000) =3D 0 break(0x8092000) =3D 0 sysarch(0xa, 0xbfbfecc0) =3D 0 break(0x8093000) =3D 0 getrlimit(RLIMIT_NOFILE, {rlim_cur=3D578297877454292699, rlim_max=3D578297877454292699}) =3D 0 setrlimit(RLIMIT_NOFILE, {rlim_cur=3D578302322745444059, rlim_max=3D578301970558125787}) =3D 0 __sysctl([134645467.134645467], 2, 0xbfbfdf60, 0xbfbfdf54, "machdep.ispc98", 14) =3D -1 ENOENT (No such file or directory) syscall_416(0x14, 0xbfbfdfb0, 0) =3D 0 break(0x8094000) =3D 0 break(0x8095000) =3D 0 break(0x8096000) =3D 0 break(0x8097000) =3D 0 __getcwd(0xbfbfe0c0, 1024) =3D -1 ENOTDIR (Not a directory) stat("/", {st_mode=3DS_IFCHR|S_ISGID|0440, st_rdev=3Dmakedev(110, 543621225), ...}) =3D 0 lstat(".", {st_mode=3D0, st_size=3D0, ...}) =3D 0 stat("..", {st_mode=3D0, st_size=3D0, ...}) =3D 0 open("..", O_RDONLY|O_NONBLOCK) =3D 3 fstat(3, {st_mode=3D0, st_size=3D0, ...}) =3D 0 fcntl(3, F_SETFD, FD_CLOEXEC) =3D 0 __sysctl([sysctl.0], 2, "", [0], NULL, 0) =3D 0 syscall_397(0x3, 0xbfbfdca0) =3D 0 break(0x8098000) =3D 0 fstat(3, {st_mode=3D0, st_size=3D0, ...}) =3D 0 getdirentries(3, /* 21 entries */, 4096, [0]) =3D 512 lseek(3, 0, SEEK_SET) =3D 0 close(3) =3D 0 lstat("../", {st_mode=3D0, st_size=3D0, ...}) =3D 0 stat("../..", {st_mode=3D0, st_size=3D0, ...}) =3D 0 open("../..", O_RDONLY|O_NONBLOCK) =3D -1 EACCES (Permission denied) write(2, "\0\0\0\0\0\0", 6make: ) =3D 6 write(2, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 18Permission denied ) =3D 18 exit(2) =3D ? and from success the first part of the strace execve(0xbfbfe830, [0xbfbfecf8], [/* 0 vars */]) =3D 0 readlink("/etc/malloc.conf", 0xbfbfec30, 63) =3D -1 ENOENT (No such file or directory) issetugid(0x808565b) =3D 0 mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) =3D 0x2808= 7000 break(0x8091000) =3D 0 break(0x8092000) =3D 0 sysarch(0xa, 0xbfbfecc0) =3D 0 break(0x8093000) =3D 0 getrlimit(RLIMIT_NOFILE, {rlim_cur=3D578297877454292699, rlim_max=3D578297877454292699}) =3D 0 setrlimit(RLIMIT_NOFILE, {rlim_cur=3D578302322745444059, rlim_max=3D578301970558125787}) =3D 0 __sysctl([134645467.134645467], 2, 0xbfbfdf60, 0xbfbfdf54, "machdep.ispc98", 14) =3D -1 ENOENT (No such file or directory) syscall_416(0x14, 0xbfbfdfb0, 0) =3D 0 break(0x8094000) =3D 0 break(0x8095000) =3D 0 break(0x8096000) =3D 0 break(0x8097000) =3D 0 __getcwd("", 1024) =3D 0 stat("include", {st_mode=3D0400, st_size=3D12129123790600, ...}) =3D 0 stat", 0xbfbfdf70) =3D -1 ENOENT (No such file or directory) stat("obj", 0xbfbfdf70) =3D -1 ENOENT (No such file or dire= ctory) stat("AKE", 0xbfbfdf70) =3D -1 ENOENT (No such file or dire= ctory) stat(".", {st_mode=3DS_IFBLK|S_ISUID|0546, st_rdev=3Dmakedev(101, 572522604), ...}) =3D 0 open(".", O_RDONLY|O_NONBLOCK) =3D 3 fstat(3, {st_mode=3DS_IFBLK|S_ISUID|0546, st_rdev=3Dmakedev(101, 572522604), ...}) =3D 0 fcntl(3, F_SETFD, FD_CLOEXEC) =3D 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) =3D 0 syscall_397(0x3, 0xbfbfdd30) =3D 0 getdirentries(3, /* 26 entries */, 4096, [0]) =3D 512 getdirentries(3, /* 0 entries */, 4096, [512]) =3D 0 lseek(3, 0, SEEK_SET) =3D 0 close(3) =3D 0 gettimeofday({1, 0}, NULL) =3D 0 stat("", {st_mode=3D0, st_size=3D0, ...}) =3D 0 open("", O_RDONLY|O_NONBLOCK) =3D 3 fstat(3, {st_mode=3D0, st_size=3D0, ...}) =3D 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3aaaa3a0604021202q63e58630q45b5d35750739c9d>