Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#62062 - 22/01/2002 15:39 FTP DIR globbing
bonzi
pooh-bah

Registered: 13/09/1999
Posts: 2401
Loc: Croatia
Is ftp command DIR supposed to do filename globbing (HiJack 136)? While DIR by itself seems to work OK, DIR followed by a glob pattern (e.g. 1* in fids directory) return a small subset of files actually there, or nothing at all. I think it returns the first consecutive range of files matching the pattern (i.e. that it expects filenames sorted, while theay are not).

BTW, I have noticed that when no connections are active two kftpd and khttpd threads each are there, one 'alive' and one zombie. Zombies disappear when I connect. I suppose that is OK...
_________________________
Dragi "Bonzi" Raos Q#5196 MkII #080000376, 18GB green MkIIa #040103247, 60GB blue

Top
#62063 - 22/01/2002 21:41 Re: FTP DIR globbing [Re: bonzi]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14481
Loc: Canada
Hmmph! Looks like a bug in kftpd. I don't see the bug in the code, though, but it definitely misbehaves with the globbing.

Darn.. Have a look, will you, at the "glob_match()" routine in kftpd.c in the hijack patch.. maybe pull out that one routine (standalone) and build a small test program around it. I just don't see the bug right now, and some other clever eyeballs are needed here.

Thanks.
-ml

Top
#62064 - 22/01/2002 21:56 Re: FTP DIR globbing [Re: bonzi]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14481
Loc: Canada
Yeah, don't worry about the Zombies.. there should only ever be one (of each kind) around, and that behaviour is "normal" -- the alternative would be to have a special thread just to "wait" for the children dying off.. too much fuss.

A "zombie" is a child thread/process which has died, and whose parent process has not yet done a "wait()" syscall for it.. so the corpse just stays in limbo, not responding to anything (very zombie-like) until the irresponsible parent stops partying and shows up at the cemetary to pay final respects (by invoking "wait()").

With kftpd/khttpd, I only wait() for dead offspring as needed, and also do a quick poll after each new incoming connection.. which explains the behaviour you see.

Cheers

Top
#62065 - 22/01/2002 22:30 Hijack v138 [was: FTP DIR globbing] [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14481
Loc: Canada
Ahh.. never mind. I found it.

Globbing is fine.. the problem is that a buffer is getting used for two purposes simultaneously.. oops.

I'll put out a v138 shortly with the fix.

Thanks!


Edited by mlord (22/01/2002 22:31)

Top
#62066 - 22/01/2002 22:31 Re: Hijack v138 [was: FTP DIR globbing] [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14481
Loc: Canada
Err.. make that v138 (already have a v137 release..)

Top
#62067 - 23/01/2002 01:20 Re: FTP DIR globbing [Re: mlord]
bonzi
pooh-bah

Registered: 13/09/1999
Posts: 2401
Loc: Croatia
Your bugs are really moving targets. You fixed this one three releases ago! There goes my shot at fame...
_________________________
Dragi "Bonzi" Raos Q#5196 MkII #080000376, 18GB green MkIIa #040103247, 60GB blue

Top
#62068 - 23/01/2002 01:21 Re: FTP DIR globbing [Re: mlord]
bonzi
pooh-bah

Registered: 13/09/1999
Posts: 2401
Loc: Croatia
That's what I thought. Excellent description of zombies, BTW! :-)
_________________________
Dragi "Bonzi" Raos Q#5196 MkII #080000376, 18GB green MkIIa #040103247, 60GB blue

Top
#62069 - 23/01/2002 01:59 Re: Hijack v138 [was: FTP DIR globbing] [Re: mlord]
bonzi
pooh-bah

Registered: 13/09/1999
Posts: 2401
Loc: Croatia
Er, still (or again) does not work in v140, getting just a screenfull or so of files.
_________________________
Dragi "Bonzi" Raos Q#5196 MkII #080000376, 18GB green MkIIa #040103247, 60GB blue

Top
#62070 - 23/01/2002 08:07 Hijack v141: FTP globbing now "perfect" [Re: bonzi]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14481
Loc: Canada
Ahh.. don't ya just love nested bugs..

Okay, the filldir() routine sometimes has no glob matches over a long stretch, which causes it to return nothing, which cases the readdir() loop to think it has finished.

Fixed in v141.

Thanks again.

Top
#62071 - 23/01/2002 09:06 Re: Hijack v141: FTP globbing now "perfect" [Re: mlord]
bonzi
pooh-bah

Registered: 13/09/1999
Posts: 2401
Loc: Croatia
Yes, that's exactly how it bahaved.

I tried with few examples on v141 (BTW, kernel install via /proc/empeg_kernel works like charm), and it seems to be OK. now.

Thanks!
_________________________
Dragi "Bonzi" Raos Q#5196 MkII #080000376, 18GB green MkIIa #040103247, 60GB blue

Top