From: Christophe Rhodes Date: Mon, 15 Mar 2004 13:27:50 +0000 (+0000) Subject: 0.8.8.25: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=146f785ee2ee14077b815fd3cb17454774b04379;p=sbcl.git 0.8.8.25: Don't allow the system to be built as root ... id(1) check early in the build. Fix the SB-POSIX test suite ... rewrite mkdir.error.3 not to assume that / is unwriteable; ... continue to assume that the user is not (fake)root, but nonetheless try to clean up a bit more if we are. --- diff --git a/NEWS b/NEWS index 0b1ee32..1183175 100644 --- a/NEWS +++ b/NEWS @@ -2320,6 +2320,11 @@ changes in sbcl-0.8.9 relative to sbcl-0.8.8: should matter to you only if you rebind the printer control variables and then find you want different bindings in the debugger than in the ordinary execution of your program.) + * minor incompatible change: the system no longer allows itself to + be built as root. This is primarily to allow the SB-POSIX contrib + module's test suite to assume that it is being run as an ordinary + user, with the attendant filesystem permissions semantics that + entails. * The runtime build system has been tweaked to support building (on SPARC/SunOS) using a C compiler which invokes Sun's own assembler and linker. (thanks to Nikodemus Siivola) diff --git a/contrib/sb-posix/posix-tests.lisp b/contrib/sb-posix/posix-tests.lisp index 469b739..c304f7d 100644 --- a/contrib/sb-posix/posix-tests.lisp +++ b/contrib/sb-posix/posix-tests.lisp @@ -96,10 +96,22 @@ #.sb-posix::eexist) (deftest mkdir.error.3 - (handler-case - (sb-posix:mkdir "/almost-certainly-does-not-exist" 0) - (sb-posix:syscall-error (c) - (sb-posix:syscall-errno c))) + (let* ((dir (merge-pathnames + (make-pathname :directory '(:relative "mkdir.error.3")) + *test-directory*)) + (dir2 (merge-pathnames + (make-pathname :directory '(:relative "does-not-exist")) + dir))) + (sb-posix:mkdir dir 0) + (handler-case + (sb-posix:mkdir dir2 0) + (sb-posix:syscall-error (c) + (sb-posix:rmdir dir) + (sb-posix:syscall-errno c)) + (:no-error (result) + (sb-posix:rmdir dir2) + (sb-posix:rmdir dir) + result))) #.sb-posix::eacces) (deftest rmdir.1 @@ -129,7 +141,6 @@ (sb-posix:syscall-errno c))) #.sb-posix::enotdir) -#-sunos ; Apparently gives EINVAL on SunOS 8, which doesn't make sense (deftest rmdir.error.3 (handler-case (sb-posix:rmdir "/") @@ -171,7 +182,11 @@ (sb-posix:chmod dir (logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec)) (sb-posix:rmdir dir2) (sb-posix:rmdir dir) - (sb-posix:syscall-errno c)))) + (sb-posix:syscall-errno c)) + (:no-error (result) + (sb-posix:chmod dir (logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec)) + (sb-posix:rmdir dir) + result))) #.sb-posix::eacces) (deftest stat.1 @@ -200,7 +215,7 @@ (< (- atime unix-now) 10)) t) -(deftest stat.2 +(deftest stat.4 (let* ((stat (sb-posix:stat (make-pathname :directory '(:absolute :up)))) (mode (sb-posix::stat-mode stat))) ;; it's logically possible for / to be writeable by others... but @@ -235,7 +250,12 @@ (sb-posix:chmod dir (logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec)) (sb-posix:unlink file) (sb-posix:rmdir dir) - (sb-posix:syscall-errno c)))) + (sb-posix:syscall-errno c)) + (:no-error (result) + (sb-posix:chmod dir (logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec)) + (sb-posix:unlink file) + (sb-posix:rmdir dir) + result))) #.sb-posix::eacces) ;;; stat-mode tests diff --git a/make-config.sh b/make-config.sh index ff693d1..7664551 100644 --- a/make-config.sh +++ b/make-config.sh @@ -18,6 +18,9 @@ echo //entering make-config.sh +echo //checking that we are not root +if [ `id -u` -eq 0 ] ; then echo 'Argh! we are (fake)root!'; exit 1; fi; + echo //ensuring the existence of output/ directory if [ ! -d output ] ; then mkdir output; fi