[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#189192: marked as done (glob() busted when symlinks to directories used in path)



Your message dated Tue, 19 Aug 2003 09:20:02 +0900
with message-id <80n0e6lcr1.wl@oris.opensource.jp>
and subject line Bug#189192: Fixed in glibc CVS
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 15 Apr 2003 23:24:37 +0000
>From sfrost@ns.snowman.net Tue Apr 15 18:24:37 2003
Return-path: <sfrost@ns.snowman.net>
Received: from ns2.snowman.net (relay.snowman.net) [66.93.83.121] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 195Zn2-0007GA-00; Tue, 15 Apr 2003 18:24:36 -0500
Received: from ns.snowman.net (ns.snowman.net [10.10.0.2])
	by relay.snowman.net (8.12.9/8.12.9/Debian-1) with ESMTP id h3FNOZhm023995
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL)
	for <submit@bugs.debian.org>; Tue, 15 Apr 2003 19:24:35 -0400
Received: from ns.snowman.net (localhost [127.0.0.1])
	by ns.snowman.net (8.12.9/8.12.9/Debian-1) with ESMTP id h3FNOZg3031594
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL)
	for <submit@bugs.debian.org>; Tue, 15 Apr 2003 19:24:35 -0400
Received: (from sfrost@localhost)
	by ns.snowman.net (8.12.9/8.12.9/Debian-1) id h3FNOZPf031592
	for submit@bugs.debian.org; Tue, 15 Apr 2003 19:24:35 -0400
Date: Tue, 15 Apr 2003 19:24:35 -0400
From: Stephen Frost <sfrost@snowman.net>
To: submit@bugs.debian.org
Subject: glob() busted when symlinks to directories used in path
Message-ID: <20030415232434.GB18064@ns.snowman.net>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="PEIAKu/WMn1b1Hv9"
Content-Disposition: inline
X-Editor: Vim http://www.vim.org/
X-Info: http://www.snowman.net
X-Operating-System: Linux/2.4.20 (i686)
X-Uptime: 16:57:54 up 115 days, 16:07, 14 users,  load average: 0.15, 0.05, 0.01
User-Agent: Mutt/1.5.4i
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-2.6 required=4.0
	tests=HAS_PACKAGE,PGP_SIGNATURE_2,SPAM_PHRASE_00_01,USER_AGENT,
	      USER_AGENT_MUTT
	version=2.44
X-Spam-Level: 


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

Package: glibc
Version: 2.3.1-16
Severity: normal

glob() is busted in glibc because it does not correctly handle the
situation where a symlink is part of a path.  For example:

There exists a symlink:
/data/a -> /data1/a

/data1/a is a directory which contains:
abc
def
xyz

A glob() call using the pattern: /data/*/* will fail.  This is because
around line 1373 of glob.c there exists the following code:

-------
#ifdef HAVE_D_TYPE
                  /* If we shall match only directories use the information
                     provided by the dirent call if possible.  */
                  if ((flags & GLOB_ONLYDIR)
                      && d->d_type !=3D DT_UNKNOWN && d->d_type !=3D DT_DIR)
                    continue;
#endif           =20
-------

When a path element is a symlink the d_type for it is DT_LINK.  DT_LINK
should probably be added to the statement above as another valid type.
Of course, another check will need to be made if you want to be sure the
symlink points to a directory.  This check should probably work on any
type of file and be outside the #ifdef above so that GLOB_ONLYDIR will
work when HAVE_D_TYPE isn't defined (as I read it this isn't the case
currently).

	Stephen

--PEIAKu/WMn1b1Hv9
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+nJSyrzgMPqB3kigRAnNuAJ9mnbAsTxEsbeA3V9EgRQcIBiRS4wCfXTnH
HgyVo2Riqy+4JNBji3ti0I8=
=hbWm
-----END PGP SIGNATURE-----

--PEIAKu/WMn1b1Hv9--

---------------------------------------
Received: (at 189192-done) by bugs.debian.org; 19 Aug 2003 00:20:15 +0000
>From gotom@debian.or.jp Mon Aug 18 19:20:04 2003
Return-path: <gotom@debian.or.jp>
Received: from oris.opensource.jp (oris.opensource.gr.jp) [218.44.239.73] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 19ouEG-0000uE-00; Mon, 18 Aug 2003 19:20:04 -0500
Received: from oris.opensource.jp (oris.opensource.jp [218.44.239.73])
	by oris.opensource.gr.jp (Postfix) with ESMTP
	id B91FDC33C7; Tue, 19 Aug 2003 09:20:02 +0900 (JST)
Date: Tue, 19 Aug 2003 09:20:02 +0900
Message-ID: <80n0e6lcr1.wl@oris.opensource.jp>
From: GOTO Masanori <gotom@debian.or.jp>
To: Stephen Frost <sfrost@snowman.net>, 189192-done@bugs.debian.org
Subject: Re: Bug#189192: Fixed in glibc CVS
In-Reply-To: <20030604123957.GF8524@ns.snowman.net>
References: <20030604123957.GF8524@ns.snowman.net>
User-Agent: Wanderlust/2.9.9 (Unchained Melody) SEMI/1.14.3 (Ushinoya)
 FLIM/1.14.3 (=?ISO-8859-4?Q?Unebigory=F2mae?=) APEL/10.3 Emacs/21.2
 (i386-debian-linux-gnu) MULE/5.0 (SAKAKI)
MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya")
Content-Type: text/plain; charset=US-ASCII
Delivered-To: 189192-done@bugs.debian.org
X-Spam-Status: No, hits=-13.5 required=4.0
	tests=BAYES_20,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,
	      REFERENCES,REPLY_WITH_QUOTES,USER_AGENT
	autolearn=ham version=2.53-bugs.debian.org_2003_8_17
X-Spam-Level: 
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_8_17 (1.174.2.15-2003-03-30-exp)

At Wed, 4 Jun 2003 08:39:58 -0400,
Stephen Frost wrote:
> This bug appears to have been fixed in glibc CVS.  Specifically version
> 1.47 of sysdeps/generic/glob.c viewable here:
> http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/generic/glob.c?cvsroot=glibc
> There were changes to the globtest.sh to test for the bug in the future
> too.

Thanks for your notification, I've confirmed it.  Yes, it's fixed in
2.3.2-2.  I close this bug.

Regards,
-- gotom



Reply to: