Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Apr 2003 14:21:47 +0300
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Brian Feldman <green@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   umount(8) of a symlink
Message-ID:  <20030416112147.GA38592@sunbay.com>

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

--envbJBWh7q8WU6mo
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi!

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

%%%
Index: umount.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
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
@@ -626,9 +626,10 @@
 		if (ISDOT(name + 1) || ISDOTDOT(name + 1))
 			strcpy(realname, "/");
 		else {
-			if ((dirname =3D strrchr(name + 1, '/')) =3D=3D NULL)
-				snprintf(realname, MAXPATHLEN, "%s", name);
-			else
+			if ((dirname =3D strrchr(name + 1, '/')) =3D=3D NULL) {
+				if ((realpath(name, realname)) =3D=3D NULL)
+					return (NULL);
+			} else
 				havedir =3D 1;
 		}
 	} else {
%%%


Cheers,
--=20
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software AG,
ru@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

--envbJBWh7q8WU6mo
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+nTzLUkv4P6juNwoRAmPSAJ9uSvE8DI/6Ek+7yIsPGqWom6sV2gCfefhW
Ra2Snv3kvMPdinNXn8CKj10=
=V4Ks
-----END PGP SIGNATURE-----

--envbJBWh7q8WU6mo--



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