From owner-freebsd-current@FreeBSD.ORG Wed Apr 16 04:21:59 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC82C37B401; Wed, 16 Apr 2003 04:21:59 -0700 (PDT) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34C9C43FA3; Wed, 16 Apr 2003 04:21:56 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1]) h3GBLlhJ039037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Apr 2003 14:21:47 +0300 (EEST) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.12.9/8.12.8/Submit) id h3GBLl6M039032; Wed, 16 Apr 2003 14:21:47 +0300 (EEST) (envelope-from ru) Date: Wed, 16 Apr 2003 14:21:47 +0300 From: Ruslan Ermilov To: Brian Feldman Message-ID: <20030416112147.GA38592@sunbay.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="envbJBWh7q8WU6mo" Content-Disposition: inline User-Agent: Mutt/1.5.4i cc: current@FreeBSD.org Subject: umount(8) of a symlink X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2003 11:22:00 -0000 --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--