umount(8) of a symlink

From: Ruslan Ermilov <ru_at_FreeBSD.org>
Date: Wed, 16 Apr 2003 14:21:47 +0300
Hi!

If /mnt is a symlink, "mount ... /mnt" succeeds, but "umount /mnt"
does not.  Any objections to this patch?

%%%
Index: umount.c
===================================================================
RCS file: /home/ncvs/src/sbin/umount/umount.c,v
retrieving revision 1.22.2.1
diff -u -r1.22.2.1 umount.c
--- umount.c	13 Dec 2001 01:27:15 -0000	1.22.2.1
+++ umount.c	16 Apr 2003 11:19:26 -0000
_at__at_ -626,9 +626,10 _at__at_
 		if (ISDOT(name + 1) || ISDOTDOT(name + 1))
 			strcpy(realname, "/");
 		else {
-			if ((dirname = strrchr(name + 1, '/')) == NULL)
-				snprintf(realname, MAXPATHLEN, "%s", name);
-			else
+			if ((dirname = strrchr(name + 1, '/')) == NULL) {
+				if ((realpath(name, realname)) == NULL)
+					return (NULL);
+			} else
 				havedir = 1;
 		}
 	} else {
%%%


Cheers,
-- 
Ruslan Ermilov		Sysadmin and DBA,
ru_at_sunbay.com		Sunbay Software AG,
ru_at_FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

Received on Wed Apr 16 2003 - 02:21:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:03 UTC