From 727dfb7de533c3b7bbabb63c0ddf39a440866578 Mon Sep 17 00:00:00 2001
From: dtc <dtc>
Date: Sat, 19 Dec 1998 16:03:58 +0000
Subject: [PATCH] Check for illegal characters in unix file names; from Peter
 Van Eynde.

---
 code/filesys.lisp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/code/filesys.lisp b/code/filesys.lisp
index cebaf1382..879f9b2de 100644
--- a/code/filesys.lisp
+++ b/code/filesys.lisp
@@ -6,7 +6,7 @@
 ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/filesys.lisp,v 1.53 1998/07/16 13:30:47 pw Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/filesys.lisp,v 1.54 1998/12/19 16:03:58 dtc Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -271,6 +271,13 @@
 	    (unless (= tail-start tail-end)
 	      (setf pieces (butlast pieces))
 	      (extract-name-type-and-version namestr tail-start tail-end)))
+	;; PVE: Make sure there are no illegal characters in the name
+	;; such as #\Null and #\/.
+	(when (and (stringp name)
+                   (find-if #'(lambda (x)
+				(or (char= x #\Null) (char= x #\/)))
+			    name))
+	  (error 'parse-error))
 	;; Now we have everything we want.  So return it.
 	(values nil ; no host for unix namestrings.
 		nil ; no devices for unix namestrings.
@@ -649,7 +656,9 @@
       (let ((names (names)))
 	(when names
 	  (when (cdr names)
-	    (error "~S is ambiguous:~{~%  ~A~}" pathname names))
+	    (error 'simple-file-error
+		   :format-control "~S is ambiguous:~{~%  ~A~}"
+		   :format-arguments (list pathname names)))
 	  (return (car names))))))))
 
 
-- 
GitLab