Update of /cvsroot/sbcl/sbcl/contrib/sb-posix
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31290/contrib/sb-posix
Modified Files:
macros.lisp posix-tests.lisp
Log Message:
0.8.7.22:
RIP (physical) PATHNAME-VERSION significance
... remove all internal discrimination based on the version
field if the pathname involved has the Unix host.
... parsing of a physical pathname namestring (i.e. again either
explicitly or implicitly on the Unix host) never produces
a version from the namestring.
... make :if-exists :new-version behave like :if-exists :error,
because despite weasel-words in CLHS someone might
legitimately expect :if-exists :new-version not to
clobber the old version.
... (this latter needs to be revisited, when OPEN is made aware
of logical pathnames and the wacky logic they impose; we
can support :new-version with LPNs, but only if OPEN is
clever).
... make pathnames more likely to be read/print consistent, by
throwing errors in more cases (we now pass PFD's test for
that, not that it's that stringent).
... throw errors on use of (:absolute :up) and friends in CL
operators, but...
... don't throw error on creation, and in fact test in sb-posix
that we can use #p"/../" for what it means.
Index: macros.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/contrib/sb-posix/macros.lisp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- macros.lisp 8 Nov 2003 21:08:13 -0000 1.6
+++ macros.lisp 27 Jan 2004 10:34:57 -0000 1.7
@@ -17,7 +17,8 @@
(write-char #\/ s))
(dolist (piece (cdr directory))
(etypecase piece
- (string (write-string piece s) (write-char #\/ s))))))
+ (string (write-string piece s) (write-char #\/ s))
+ ((member :up) (write-string "../" s))))))
(etypecase name
(null)
(string (write-string name s)))
Index: posix-tests.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/contrib/sb-posix/posix-tests.lisp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- posix-tests.lisp 28 Nov 2003 23:07:26 -0000 1.8
+++ posix-tests.lisp 27 Jan 2004 10:34:57 -0000 1.9
@@ -38,6 +38,18 @@
(sb-posix:chdir *current-directory*)
0)
+(deftest chdir.6
+ (sb-posix:chdir "/../")
+ 0)
+
+(deftest chdir.7
+ (sb-posix:chdir #p"/../")
+ 0)
+
+(deftest chdir.8
+ (sb-posix:chdir (make-pathname :directory '(:absolute :up)))
+ 0)
+
(deftest chdir.error.1
(let ((dne (make-pathname :directory '(:relative "chdir.does-not-exist"))))
(handler-case
@@ -188,6 +200,15 @@
(< (- atime unix-now) 10))
t)
+(deftest stat.2
+ (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
+ ;; if it is, either someone is playing with strange security
+ ;; modules or they want to know about it anyway.
+ (logand mode sb-posix::s-iwoth))
+ 0)
+
;;; FIXME: add tests for carrying a stat structure around in the
;;; optional argument to SB-POSIX:STAT
|