Bug 4369 - showacls doesn't work for files in directories
showacls doesn't work for files in directories
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: smbclient
3.0.23d
x86 Linux
: P3 minor
: none
Assigned To: Lars Müller
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-05 23:01 UTC by David Leonard (550 5.7.1 Unable to deliver)
Modified: 2007-03-06 20:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Leonard (550 5.7.1 Unable to deliver) 2007-02-05 23:01:53 UTC
The showacls command toggles the view of file ACLs in smbclient.
This works well for files in the root directory of a share, but doesn't work when the file is in a subdirectory.
If a file of the same name exists in the root directory, then showacls will show its ACLs.
Comment 1 David Leonard (550 5.7.1 Unable to deliver) 2007-02-05 23:36:26 UTC
Here is an example of the symptoms

$ smbclient //bri100685/common
OS=[Unix] Server=[Samba 3.0.23d-Quest-171]
smb: \> cd tmp
smb: \tmp\> dir
  .                                   D        0  Tue Feb  6 15:10:56 2007
  ..                                  D        0  Tue Feb  6 15:09:57 2007
  foo.txt                                     54  Tue Feb  6 15:10:56 2007

                64507 blocks of size 33553920. 53285 blocks available
smb: \tmp\> showacls
smb: \tmp\> dir
FILENAME:\foo.txt
MODE:
SIZE:54
MTIME:Tue Feb  6 15:10:56 2007
display_finfo() Failed to open \foo.txt: NT_STATUS_OBJECT_NAME_NOT_FOUND

                64507 blocks of size 33553920. 53285 blocks available


And here is a fix

Index: samba/source/client/client.c
===================================================================
--- samba/source/client/client.c
+++ samba/source/client/client.c
@@ -712,6 +712,9 @@
                pstrcat(mask,"*");
        }

+       if (showacls)
+           pstrcpy(cwd, cur_dir);
+
        do_list(mask, attribute, display_finfo, recurse, True);

        rc = do_dskattr();
Comment 2 Jeremy Allison 2007-03-06 20:27:38 UTC
Applied, thanks !
Jeremy.