I have an odd problem that involves clients deleting files they should not be able to delete, and claiming success, but then the files "come back" again. Here's the setup: I have a filesystem that contains a file "foobar.txt" owned by user "test", group "test". Permissions on this file are 644, permissions on the enclosing directory are 777. I share this filesystem via samba (version 3.0.20), using this config: [test] path=/mnt/test writable = yes browsable = yes hide dot files = yes wide links = no delete readonly = yes guest ok = yes guest only = yes force create mode = 400 force directory mode = 700 force user = test force group = test I mount this share on an XP box. I delete foobar.txt. It works and all is well. Then I do the same exact test except mount /mnt/test readonly. Now, when I delete foobar.txt, it seems to work, but refreshing the XP window or doing "dir" again shows the file wan't actually deleted. Obviously you can't delete a file off of a readonly filesystem, but (and here's the problem) shouldn't there have been an error message given? The delete failed, but the user wasn't informed. David
Gerald (Jerry) Carter
2006-Feb-24 17:34 UTC
[Samba] Deleting undeletable files gives no error
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Shaw wrote:> Then I do the same exact test except mount /mnt/test readonly. Now, > when I delete foobar.txt, it seems to work, but refreshing the XP > window or doing "dir" again shows the file wan't actually deleted. > Obviously you can't delete a file off of a readonly filesystem, but > (and here's the problem) shouldn't there have been an error message > given? The delete failed, but the user wasn't informed.This is by design. The internal checks for deleting a file (needed for delete-on-close semantics) only look at the file system permissions. Maybe Jeremy has an idea but if you mount a filesystem ro, I would say just mark the share with (read only = yes). I don't see a need to add any other changes. cheers, jerry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFD/0N4IR7qMdg1EfYRAolHAKCWRakKiLvpuCZZIcSpoHP9v+MEMACg8CYG BF6Qjsn0Oy2fo4cyCqOzFhk=RT9x -----END PGP SIGNATURE-----