Skip site navigation (1)Skip section navigation (2)
Date:      Thu,  5 Oct 2000 16:45:53 +0200 (CEST)
From:      pb@hert.org
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/21768: shouldn't trailing '/' on regular file symlink return EISDIR ?
Message-ID:  <20001005144553.7AA7D24@ender.tfz.net>

next in thread | raw e-mail | index | archive | help

>Number:         21768
>Category:       kern
>Synopsis:       shouldn't trailing '/' on regular file symlink return EISDIR ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 05 07:50:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Pascal Bouchareine [kalou]
>Release:        FreeBSD 5.x current
>Organization:
HERT
>Environment:

   $FreeBSD: src/sys/kern/vfs_lookup.c,v 1.40 2000/09/17 07:26:41 bp Exp $

>Description:

   Trailing slash after a symlink which points to a regular file resolves
   the link, where i think it should return EISDIR.

>How-To-Repeat:

   [ender][root]~# ln -s /etc/motd link
   [ender][root]~# file link
   link: symbolic link to /etc/motd
   [ender][root]~# file link/
   link/: ASCII text

>Fix:
	
--- vfs_lookup.c        Thu Oct  5 16:25:22 2000
+++ vfs_lookup.c.new    Thu Oct  5 16:24:44 2000
@@ -504,6 +504,14 @@
        }
 
        /*
+        * Check for bogus trailing slashes.
+        */
+       if (trailing_slash && dp->v_type != VDIR) {
+               error = ENOTDIR;
+               goto bad2;
+       }
+
+       /*
         * Check for symbolic link
         */
        if ((dp->v_type == VLNK) &&
@@ -515,14 +523,6 @@
                        goto bad2;
                }
                return (0);
-       }
-
-       /*
-        * Check for bogus trailing slashes.
-        */
-       if (trailing_slash && dp->v_type != VDIR) {
-               error = ENOTDIR;
-               goto bad2;
        }
 
 nextname:

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001005144553.7AA7D24>