permission issues between Linux (RH 5.5) and WIndows (Server 2K8)

3 views (last 30 days)
I have an interesting issues with Matlab 2008.
When a user (UserA) creates a new .m file in matlab and saves it in their home directory (/home/usera), the user is able to continue modifying the file with no issues.
When the same user tries to save the same file on a windows share that is mounted via CIFS:
//x.x.x.x/share /mnt/share cifs _netdev,user=shareuser,domain=somedomain.com,nosuid,credentials=some_file_in_some_directory
The user is able to save the file but the file immediately becomes Read-Only and the user that just saved the file is no longer able to to modify the file.
Has anyone encountered an error like this before? Thank you in advance for your support, it is greatly appreciated.

Answers (2)

Walter Roberson
Walter Roberson on 7 Nov 2011
Look carefully at the file ownership on the Linux system after the file has been created, and look carefully at the directory permissions and any ACLs of the directory being written in to.
If the directory being written in to is suid or sguid, then the owner or group of the file written would be changed automatically to match the user or group of the directory (respectively). That can leave the file unmodifiable by the original user.
Or the cifs daemon might be writing the files as owned by the cifs daemon instead of the user.
If the user does not have an account on the linux system then the credentials accessed with would be the anonymous user, which would normally fall in to the "other" category. The directory might have "wx" or "rwx" permissions sufficient for the anonymous user to deposit the file, but especially with the before-mentioned suid / sguid possibilities, the anonymous user is not certain to have write access to the resulting file.
If the CIFS daemon is not running suid root, then it might write the files under its own uid, but then be unable to chown() the file to the account of the user, leaving the file unmodifiable by the user.
... and there are other possibilities. Most network file systems are security hacks, trying to balance between competing requirements. You need strong trust mechanisms to do network file systems properly.

Daniel Shub
Daniel Shub on 8 Nov 2011
It looks like you are trying to get the mount to work from fstab. I would suggest trying to get it to work first from your user account, then from root and finally from fstab.
My guess is, as Walter mentioned, you need to specify the uid and gid options.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!