lkml.org 
[lkml]   [1998]   [Sep]   [10]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateThu, 10 Sep 1998 13:05:13 +0930 (CST)
FromAlan Modra <>
SubjectRe: symlinks and linux 2.1.120
On 9 Sep 1998, Kevin Buhr wrote:

> Good.  If it wasn't clear from my email, I'm not married to one or the
> other.  When I submitted the patch, it was to fix two related
> symlink-following behaviours that were *definitely* wrong and needed
> to be fixed, and I rather arbitrarily decided to follow oldname
> symlinks because it was consistent with D/UX 4.0, and it was what
> 2.1.72 was already doing.  (Therefore, this behaviour predates my
> patch, so I was wrong to claim responsibility.)

OK, this patch make linux-2.1 compatible with linux-2.0 and solaris.
I tested it too, even though it's such a trivial one :-)

--- linux-2.1.121/fs/namei.c.orig	Fri Aug  7 18:51:04 1998
+++ linux-2.1.121/fs/namei.c	Thu Sep 10 11:35:59 1998
@@ -84,6 +84,8 @@
 
 /* [16-Dec-97 Kevin Buhr] For security reasons, we change some symlink
  * semantics.  See the comments in "open_namei" and "do_link" below.
+ *
+ * [10-Sep-98 Alan Modra] Another symlink change.
  */
 
 static inline char * get_page(void)
@@ -992,20 +994,20 @@
 	struct inode *inode;
 	int error;
 
-	old_dentry = lookup_dentry(oldname, NULL, 1);
-	error = PTR_ERR(old_dentry);
-	if (IS_ERR(old_dentry))
-		goto exit;
-
 	/*
 	 * Hardlinks are often used in delicate situations.  We avoid
 	 * security-related surprises by not following symlinks on the
-	 * newname.  We *do* follow them on the oldname.  This is
-	 * the same as Digital Unix 4.0, for example.
+	 * newname.  --KAB
 	 *
-	 * Solaris 2.5.1 is similar, but for a laugh try linking from
-	 * a dangling symlink.                              --KAB
+	 * We don't follow them on the oldname either to be compatible
+	 * with linux 2.0, and to avoid hard-linking to directories
+	 * and other special files.  --ADM
 	 */
+	old_dentry = lookup_dentry(oldname, NULL, 0);
+	error = PTR_ERR(old_dentry);
+	if (IS_ERR(old_dentry))
+		goto exit;
+
 	new_dentry = lookup_dentry(newname, NULL, 0);
 	error = PTR_ERR(new_dentry);
 	if (IS_ERR(new_dentry))

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/faq.html

\
 
 \ /
  Last update: 2005-03-22 13:44    [from the cache]
©2003-2008