Created attachment 7131 [details] source3/modules/vfs_open_shared.c Problem: User1: opens file X with Adobe Acrobar Reader (random read only application) User2: tries delete file X and gets error. Expected behavior: User2: successful deletes file X; Background: There are a lot of situation where non tech people expects UNIX FS behaviors from windows shares (delete files/folders opened by others). Read only user can call NTCreateFile function with flags FILE_SHARE_DELETE and FILE_SHARE_WRITE... But there is to many broken/unconfigurable programs that uses default parameters and don't set these flags. Rationale: There is a risk to lose data by ignoring program request, but: 1. There was this risk always 2. You must known what You are doing 3. There are situation where no risk will be increased. Need: Google show these stats: 304 results for query: samba "file is open in another program" 14900 results for query: samba "The process cannot access the file because it is being used by another process." http://serverfault.com/questions/118385/how-exactly-do-i-find-the-a-specific-samba-users-process-id-so-that-i-can-kill and others... Proposed vfs module: source3/modules/vfs_open_shared.c Usage: Add this parameter to Your share/shares definition vfs objects = open_shared Request: Please comment this module, improve. You can place it into tree, to help users. Or just leave it here, maybe some more advanced users will find here and build by self.
Sorry, even as a module this is too dangerous. You should be able to achieve the same with "share modes = no", which itself is a very dangerous and deprecated option. With best regards, Volker Lendecke
Created attachment 7160 [details] fixed file upload problem. This updated file fixes file upload problem using file explorer. By default explorer opens file with O_APPEND, reserver file with ftruncate(fd, size), and later does pwrite(fd, buf, size, offset=0), but pwrite ignores offset argument if file is opened with O_APPEND, so resulting file will be twice larger than normal, fill part of files filed with zeros.
(In reply to comment #1) > Sorry, even as a module this is too dangerous. You should be able to achieve > the same with "share modes = no", which itself is a very dangerous and > deprecated option. How it's dangerous? Ok it's will be no recommended to run two oracle instances on same share, but otherwise for lite setups it will be nice solution. Probability to go wrong will be bigger by hard disk or PSU failure. Event this code is compatible with samba license: --------- .... THERE IS NO WARRANTY FOR THE PROGRAM, .... ---------
(In reply to comment #3) > (In reply to comment #1) > > Sorry, even as a module this is too dangerous. You should be able to achieve > > the same with "share modes = no", which itself is a very dangerous and > > deprecated option. > > How it's dangerous? Ok it's will be no recommended to run two oracle instances > on same share, but otherwise for lite setups it will be nice solution. > > Probability to go wrong will be bigger by hard disk or PSU failure. > > Event this code is compatible with samba license: > > --------- > .... > THERE IS NO WARRANTY FOR THE PROGRAM, .... > --------- Sure, no warranties in the legal sense. But we do try our best to adhere to Windows semantics and implement them correctly. Deliberately breaking client applications and creating a big risk of data loss is not an option for us.