[Pvfs2-cvs] commit by sampson in
pvfs2/src/client/windows/client-service: dokan-interface.c
CVS commit program
cvs at parl.clemson.edu
Thu Apr 14 18:02:20 EDT 2011
Update of /projects/cvsroot/pvfs2/src/client/windows/client-service
In directory parlweb1:/tmp/cvs-serv24023/src/client/windows/client-service
Modified Files:
Tag: windows-client
dokan-interface.c
Log Message:
Coding Windows permissions
Index: dokan-interface.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/windows/client-service/Attic/dokan-interface.c,v
diff -p -u -r1.1.2.30 -r1.1.2.31
--- dokan-interface.c 13 Apr 2011 22:01:30 -0000 1.1.2.30
+++ dokan-interface.c 14 Apr 2011 22:02:20 -0000 1.1.2.31
@@ -1246,12 +1246,20 @@ PVFS_Dokan_set_file_attributes(
if (ret == 0)
{
- if (FileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- attr.objtype = PVFS_TYPE_DIRECTORY;
- else if (FileAttributes & FILE_ATTRIBUTE_NORMAL)
- attr.objtype = PVFS_TYPE_DATAFILE;
- if (FileAttributes & FILE_ATTRIBUTE_READONLY)
- /* TODO: permissions */ ;
+ /* owner write permission is on and request to make
+ file readonly */
+ if ((attr.perms & 0200) &&
+ (FileAttributes & FILE_ATTRIBUTE_READONLY))
+ {
+ attr.perms |= ~0200;
+ }
+ else if (!(attr.perms & 0200) &&
+ !(FileAttributes & FILE_ATTRIBUTE_READONLY))
+ {
+ /* owner write permission is off and request to make
+ file writable */
+ attr.perms |= 0200;
+ }
ret = fs_setattr(fs_path, &attr, &credentials);
}
More information about the Pvfs2-cvs
mailing list