[gollem] VFS_smb.php Directory Listing broken

Chuck Hagenbuch chuck at horde.org
Fri May 29 14:20:59 UTC 2009


Quoting Michael Herde <herde at tu-harburg.de>:

> Horde 3.3.4 with Gollem H3 (1.1) - we found out that
>
> VFS_smb.php (v 1.1.2.2)  line 385 ff of function listFolder()
>
>                 // Split into columns at every six spaces
>                 $split1 = preg_split('/\s{6,}/', trim($res[$r]));
>                 // If the file name isn't . or ..
>
> turns out a broken directory listing if there is a long filename in
> conjunction with more than one Attribute setted (i.e. DA) because
> there are less than 6 expected spaces between the name of the item
> and the attribute list. the attribute list is more the one entry in
> this case. Only if we hafe 6 or more spaces in between here the regex
> will match correctly.
>
> Example output of manualy listing of smbclient:
> smb: \1b\rztmh\windows\test\> ls
>   .                                   D        0  Wed May 27 15:18:42 2009
>   ..                                  D        0  Thu May 28 16:04:56 2009
>   SystemHiddenReadonlyArchive     DAHSR        0  Wed May 27 14:17:21 2009
>   Ein ziemlich langer Ordner mit vielen Buchstaben, der nicht kurz
> ist      D        0  Wed May 27 14:14:11 2009
>   Eine ziemlich lange Datei mit vielen Buchstaben, die nicht kurz
> ist.txt      A        0  Wed May 27 14:14:42 2009
>   Ordner mit Sonderzeichen & ( ) _ - toll      D        0  Wed May 27
> 14:15:05 2009
>   Datei mit SOnderzeichen ¿ ? § µ ° juhuuu.txt      A        0  Wed
> May 27 14:15:38 2009
>   SystemHiddenReadonlyArchive.txt   AHSR        0  Wed May 27 14:16:32 2009
>   SystemHiddenReadonlyArchive.txte    AHR       31  Wed May 27 15:18:42 2009
>
>                 49152 blocks of size 65536. 2 blocks available
>
>
> turns out this strange broken directory listing
>   "SystemHiddenReadonlyArchive     DAHSR"     0  Wed May 27 14:17:21 2009
> as to see in the attached screenshot.
>
> I'm not shure wether this is buggy or is it due to the settings of
> the smbclient command line or environment. Any advice ?? Or should i
> post
> it as a bug ? The regex should match the attribute column [DHARS] in
> an appropriate way.

If you could file it as a bug with the raw listing as a text  
attachment, we should be able to create a unit test for it.

-chuck


More information about the gollem mailing list