Bug 4325 - Cannot cancel read-only permissions on file from Windows side
Summary: Cannot cancel read-only permissions on file from Windows side
Status: RESOLVED DUPLICATE of bug 6186
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: kernel fs (show other bugs)
Version: 2.6
Hardware: x86 Windows XP
: P3 major
Target Milestone: ---
Assignee: Steve French
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-07 20:31 UTC by wangfeng
Modified: 2009-05-21 11:55 UTC (History)
4 users (show)

See Also:


Attachments
The read only attribute cannot be undone. (15.45 KB, image/gif)
2009-02-26 17:38 UTC, Jaroslav Fojtik
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description wangfeng 2007-01-07 20:31:02 UTC
Machine: suse9es-32bit(named smbgiant) 
samba:3.0.23b
client:winxp

Steps to replicate from Windows client (logged in as AD user part of
Centrify.com's Development Zone):

1. Start, Run, \\smbgiant
2. Open your home directory
3. In \\smbgiant\<AD_username>, right-click in empty area, New, select MS Word
Document. Name it permissions.doc
4. Right click on permissions.doc, Properties, Security tab.
5. Select <AD_username>, uncheck all permissions. Click OK.
6. Reopening reveals that Read is automatically/incorrectly checked.

This is NOT a problem with group nor Everyone (World).

However, changing permissions on the Unix side: chmod 242 permissions.doc
correctly changes permissions and can be verfied by ll in Unix and
permissions.doc Properties in Windows.


I saw the samba source code.The read-only permission of the file owner was forced adding.I don't know why it is.

some code:

in posix_acls.c file.

	*posix_perms |= MAP_PERM(other_ace->perms, S_IRUSR, S_IROTH);
	*posix_perms |= MAP_PERM(other_ace->perms, S_IWUSR, S_IWOTH);
	*posix_perms |= MAP_PERM(other_ace->perms, S_IXUSR, S_IXOTH);

	/* The owner must have at least read access. */

(=>in here) *posix_perms |= S_IRUSR;
	if (fsp->is_directory)
		*posix_perms |= (S_IWUSR|S_IXUSR);
--------------------------------------------------------------------------
/* Now bounce them into the S_USR space. */	
	switch(type) {
	case S_IRUSR:
		/* Ensure owner has read access. */
		pace->perms |= S_IRUSR;
		if (fsp->is_directory)                     (<===here)
			pace->perms |= (S_IWUSR|S_IXUSR);
		and_bits = unix_perms_to_acl_perms(and_bits, S_IRUSR, S_IWUSR, S_IXUSR);
		or_bits = unix_perms_to_acl_perms(or_bits, S_IRUSR, S_IWUSR, S_IXUSR);
		break;
	case S_IRGRP:
		and_bits = unix_perms_to_acl_perms(and_bits, S_IRGRP, S_IWGRP, S_IXGRP);
		or_bits = unix_perms_to_acl_perms(or_bits, S_IRGRP, S_IWGRP, S_IXGRP);
Comment 1 mchugh19@yahoo.com 2008-02-14 17:28:38 UTC
I'm not sure if this is the same problem, but I'm seeing a problem with samba 3.0.28 where the everyone group has read permission and I am unable to remove it. If I uncheck it and hit apply, it just comes back. If I hit deny read to everyone, then read is unchecked for every single acl, which is not the desired result. This really makes samba rather unusable. 
Comment 2 Jaroslav Fojtik 2009-02-26 17:27:20 UTC
I see a same problem and I confirm it. 

A read only attribute could be set, but it cannot be undone from windows.

It has nothing to do with security settings of drive.

This bug is very unpleasant, because it causes SVN and CVS failure on samba drive. They set .svn/entries (similar does CVS) to read only and they cannot allow to write into this file.
Comment 3 Jaroslav Fojtik 2009-02-26 17:38:06 UTC
Created attachment 3960 [details]
The read only attribute cannot be undone.
Comment 4 tom m 2009-03-09 23:26:47 UTC
(In reply to comment #2)

I see the same thing.  Once a file is set read-only, Windows can not clear it, nor can it change Hidden/System/Archive (if map hidden/system/archive = yes).  Tried both explorer and dos attrib command - same result.  Interestingly, the file can be renamed.

Very annoying.


> I see a same problem and I confirm it. 
> 
> A read only attribute could be set, but it cannot be undone from windows.
> 
> It has nothing to do with security settings of drive.
> 
> This bug is very unpleasant, because it causes SVN and CVS failure on samba
> drive. They set .svn/entries (similar does CVS) to read only and they cannot
> allow to write into this file.
> 

Comment 5 Jeremy Allison 2009-03-18 18:31:53 UTC

*** This bug has been marked as a duplicate of 6186 ***