Bug 4533 - "delete veto files" appears to be....useless
"delete veto files" appears to be....useless
Status: RESOLVED INVALID
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.24
Other Linux
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
http://bugs.debian.org/310413
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-23 12:00 UTC by Christian Perrier
Modified: 2007-04-24 04:33 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 Christian Perrier 2007-04-23 12:00:13 UTC
This is Debian bug #310413.

Originally, the bug submitter said:

The "delete veto files" is broken since Samba 3.0.12.
Deleting a directory containing only veto files returns NT_STATUS_DIRECTORY_NOT_EMPTY instead of deleting all veto files/directories.

He then submitted a patch against 3.0.12. However, while trying to reproduce that bug....I found that "delete veto files=no" is apparently just not working.

A directory containing only vetoed files is deleted whatever the setting might be:

(the following was done as root, please don't laugh at me)

[public]
directory mask=0700
browseable=yes
comment=Public
read only=no
create mask=0770
public=yes
path=/var/tmp/samba-test
delete veto files=no
veto files = /*.tmp/

root@mykerinos:/var/tmp/samba-test> mkdir bar
root@mykerinos:/var/tmp/samba-test> echo foo >bar/bar.tmp
root@mykerinos:/var/tmp/samba-test> ls -l bar
total 4
-rw-rw-r-- 1 root bikinibottom 4 2007-04-23 18:55 bar.tmp

oot@mykerinos:/etc/whereami/profiles> smbclient //cc-mykerinos/public -U bubulle
Password:
Domain=[CC-MYKERINOS] OS=[Unix] Server=[Samba 3.0.24]
smb: \> dir
  .                                   D        0  Mon Apr 23 18:55:14 2007
  ..                                  D        0  Mon Apr 23 05:35:02 2007
  public                              D        0  Wed Feb 28 21:59:43 2007
  foo                                          0  Mon Apr 23 18:45:46 2007
  bar                                 D        0  Mon Apr 23 18:55:21 2007

                60675 blocks of size 32768. 24409 blocks available
smb: \> cd bar
smb: \bar\> dir
  .                                   D        0  Mon Apr 23 18:55:21 2007
  ..                                  D        0  Mon Apr 23 18:55:14 2007

                60675 blocks of size 32768. 24409 blocks available
smb: \bar\> cd ..
smb: \> rmdir bar

root@mykerinos:/var/tmp/samba-test> ls -l
total 0
-rw-rw-r-- 1 root    bikinibottom 0 2007-04-23 18:45 foo
-rw-rw-r-- 1 root    bikinibottom 0 2007-04-23 18:49 foo.tmp
drwxrwsr-x 2 bubulle bikinibottom 6 2007-02-28 21:59 public


No more "bar" directory..:-)

--
Comment 1 Jeremy Allison 2007-04-24 04:33:15 UTC
Actually, it's behaving to spec.
See the man page in smb.conf :

       delete veto files (S)
              This option is used when Samba is attempting to delete a directory that  con‐
              tains  one  or  more  vetoed directories (see the veto files option). If this
              option is set to no (the default) then if a  vetoed  directory  contains  any
              non-vetoed  files or directories then the directory delete will fail. This is
              usually what you want.

              If this option is set to yes, then Samba will attempt to  recursively  delete
              any files and directories within the vetoed directory. This can be useful for
              integration  with  file  serving  systems  such  as  NetAtalk  which   create
              meta-files  within directories you might normally veto DOS/Windows users from
              seeing (e.g. .AppleDouble)

              Setting delete veto files = yes allows these directories to be  transparently
              deleted when the parent directory is deleted (so long as the user has permis‐
              sions to do so).

This option only has meaning if the veto'd object is a *directory*, not a file.

So if you do the following :

mkdir bar
mkdir bar/notseen.tmp
echo foo >bar/notseen.tmp/foo.tmp

Then bar will not be deleted.