Chris Murphy
2018-Jan-05 18:15 UTC
[Samba] smbclient, cannot delete non-empty directory, no error message
On Fri, Jan 5, 2018 at 6:37 AM, lingpanda101 <lingpanda101 at gmail.com> wrote:> I would assume you would need to use 'rm -r' to remove a directory and > it's contents.That doesn't work and the man page doesn't list flags for any commands, plus it looks like rm is strictly for files not for directories. smb: \noperms\> rm -r test1 NT_STATUS_NO_SUCH_FILE listing \noperms\-r smb: \noperms\> rm test2 NT_STATUS_NO_SUCH_FILE listing \noperms\test2>I would also assume a error message would be expected with > 'rmdir' if the dir was not empty.This is a problem for gvfs-smb backend for GNOME which uses rmdir. Due to the silent failure, gvfs-smb assumes it succeeds, but it doesn't. gvfs-smb uses libsmbclient and so it really needs an error message to know that the command did not succeed and that it needs to fall back on other commands to complete the user action. Basically right now GNOME users can't delete directories that have files in them, that's pretty remarkable and not in a good way. Should I file a bug? This problem goes back over a year at the least, I'm rather surprised no one has run into this until now.>The man page for smbclient also suggests > you may use 'deltree'.That does work. Is there a reason for rmdir to exist? It sounds like deltree will remove either an empty or full directory, which makes rmdir superfluous/legacy. -- Chris Murphy
Jeremy Allison
2018-Jan-05 18:58 UTC
[Samba] smbclient, cannot delete non-empty directory, no error message
On Fri, Jan 05, 2018 at 11:15:54AM -0700, Chris Murphy via samba wrote:> On Fri, Jan 5, 2018 at 6:37 AM, lingpanda101 <lingpanda101 at gmail.com> wrote: > > > I would assume you would need to use 'rm -r' to remove a directory and > > it's contents. > > That doesn't work and the man page doesn't list flags for any > commands, plus it looks like rm is strictly for files not for > directories. > > smb: \noperms\> rm -r test1 > NT_STATUS_NO_SUCH_FILE listing \noperms\-r > > smb: \noperms\> rm test2 > NT_STATUS_NO_SUCH_FILE listing \noperms\test2 > > > >I would also assume a error message would be expected with > > 'rmdir' if the dir was not empty. > > This is a problem for gvfs-smb backend for GNOME which uses rmdir. Due > to the silent failure, gvfs-smb assumes it succeeds, but it doesn't. > gvfs-smb uses libsmbclient and so it really needs an error message to > know that the command did not succeed and that it needs to fall back > on other commands to complete the user action. > > Basically right now GNOME users can't delete directories that have > files in them, that's pretty remarkable and not in a good way. > > Should I file a bug? This problem goes back over a year at the least, > I'm rather surprised no one has run into this until now.Yes, please file a bug at bugzilla.samba.org.
Chris Murphy
2018-Jan-06 20:56 UTC
[Samba] smbclient, cannot delete non-empty directory, no error message
On Fri, Jan 5, 2018 at 11:58 AM, Jeremy Allison <jra at samba.org> wrote:> On Fri, Jan 05, 2018 at 11:15:54AM -0700, Chris Murphy via samba wrote:>> Basically right now GNOME users can't delete directories that have >> files in them, that's pretty remarkable and not in a good way. >> >> Should I file a bug? This problem goes back over a year at the least, >> I'm rather surprised no one has run into this until now. > > Yes, please file a bug at bugzilla.samba.org.https://bugzilla.samba.org/show_bug.cgi?id=13204 -- Chris Murphy
Seemingly Similar Threads
- smbclient, cannot delete non-empty directory, no error message
- smbclient, cannot delete non-empty directory, no error message
- smbclient, cannot delete non-empty directory, no error message
- Tar Failures Using smbclient from Samba 3.0.0beta2
- Samba seems to forget ACLs sometime