Subject: glob.c patch

From: [email-masked] (Koos van den Hout _U nix and we all_)
Date: Mon, 15 Apr 1996 16:23:28 +0200 (MET DST)

Somebody already mailed me a patch to fix glob.c for recent Linux versions.
For as far as I can tell, the dirfd() macro is standard.

Quoting Leon Brouwers, who wrote :

> Hier is tie dan als diff -c 

*** ../../wu-ftpd-2.4.2-beta-10/src/glob.c	Mon Apr 15 10:52:25 1996
--- glob.c	Mon Apr 15 10:51:39 1996
***************
*** 281,287 ****
  			return;
  		goto patherr2;
  	}
! 	if (fstat(dirp->dd_fd, &stb) < 0)
  		goto patherr1;
  	if (!isdir(stb)) {
  		errno = ENOTDIR;
--- 281,291 ----
  			return;
  		goto patherr2;
  	}
! /* 
!  * This change was needed at least for linux with libc > 5.2.18 
!  * 			[email-masked]	      	04-15-96
!  */
! 	if (fstat(dirfd(dirp), &stb) < 0)
  		goto patherr1;
  	if (!isdir(stb)) {
  		errno = ENOTDIR;

-- 
  Koos van den Hout,     Internetter, Unix freak, ISFJ and BBS SysOp at large
  [email-masked] (Home)        BBS Koos z'n Doos (+31-30-6036637 28k8)
  [email-masked] (Work)  <-- finger -l for PGPkey    (+31-30-6056619 14k4)
  http://www.hvu.nl/~koos (WWW)    Looking for a license plate with "RFC 822"
  Quando Omni Flunkis Moritati (If all else fails - play dead)     KH106-RIPE

---

From: "W. James Showalter" <[email-masked]>
Date: Sun, 14 Apr 1996 15:03:04 -0400 (EDT)

I am running wu-ftp-beta-10 on SunOS 4.1.4.

>From some local tests, the ftpaccess path-filter option does not seem to work
as advertised.  According to the manual, the following example:

     path-filter anonymous,guest  /etc/pathmsg ^[-A-Za-z0-9._]*$  ^. ^- ^_

should allow alphanumeric file names including a .,-, or _ as long
as the name does not begin with a .,-, or _.  Yet I could not get it
to work as advertised.

Instead I tried the following:

     path-filter anonymous,guest  /etc/pathmsg ^[-A-Za-z0-9._]*$ ^[-._]

and it worked as expected.  I checked the FAQ and nothing has been
posted regarding this.  Has anyone else noticed this behavior?  Am I doing
something wrong?

Jim

---

From: [email-masked] (Koos van den Hout _U nix and we all_)
Date: Mon, 15 Apr 1996 23:31:18 +0200 (MET DST)

> posted regarding this.  Has anyone else noticed this behavior?  Am I doing

I recall changing the pathfilter too...

Yup :

path-filter anonymous /etc/paths.msg ^[-A-Za-z0-9\._]*$ ^\. ^-

Looks like ^. will be used as the regexp for 'any char at the beginning'.

I guess this is a bug in the sample config then (?).

                                             Grtx. KH

---

From: "W. James Showalter" <[email-masked]>
Date: Sun, 14 Apr 1996 20:10:29 -0400 (EDT)

You are right!  I overlooked the ^. and should have escaped the
period like you did.  I just didn't think of it.

Thanks,
Jim