I've got a windows system running centos inside a virtual box vm.
I have a directory I've shared in windows, and mounted from centos, in fstab, like so:
//<ip address>/head_build /mnt/company-build cifs user,uid=0,gid=0,rw,auto,exec,suid,username=uname,password=pword,iocharset=utf8 0 0
In a subfolder, I have a script. If I try to run it, I get the error 'bad interpreter', which I believe is fixable with dos2unix.
However, I can't seem to do anything to this script. dos2unix says Failed to open output temp file: Permission denied.
chmod and chown also say permission denied. lsattr says 'Inappropriate ioctl for device while reading flags'.
Edit: I am logged in as root in the centos machine. The shared folder in windows has granted access to everyone to do everything (the user from the mount also has permissions on the folder in windows).
Edit 2: I've tried adding file_mode=777, dir_mode=777 (as suggested in comments), as well as umask=777 and noperm (thought that one would do it), but no luck.
Edit 3: After chatting with S19N, I'm in agreement the problem seems to be on the server side of the mount, ie, windows. But the shared folder has every permission I can think of. Is there some secret sauce for getting execute permissions from a cifs mount into windows?
Edit 4:
Here is the output from calcs for the directory I have shared on windows:
c:\company\builds\head>cacls build
c:\company\builds\head\build computer-name\uname:(OI)(CI)F
BUILTIN\Administrators:F
BUILTIN\Administrators:(OI)(CI)(IO)F
NT AUTHORITY\SYSTEM:F
NT AUTHORITY\SYSTEM:(OI)(CI)(IO)F
Everyone:(OI)(CI)F
This would seem to show that this folder, when mounted, would allow all permissions.
Edit 5:
Based on Jim's comment, I checked net session, on the windows box, to see what I was connected as from the mount. When I tried to run the net session command with my uname account (the one I am using to mount), I got access-denied.
When I used run as administrator, I could see that I was accessing the mount with the uname account. I disabled UAC on the uname account (UAC being the system in windows 7 that asks you if you want to allow certain actions to proceed). This actually allowed the uname account to run net session without error.
However, the uname account is still unable to do anything from the mount: touch: cannot touch 'test': Permission denied
Edit 6: I just activated the true administrator account on the windows box (as described here), and used that as the user for the mount. Thought that would do it. Still get permission denied from inside the mount.
On a whim, I also tried running the virtualbox machine from the administrator account. Same issue.
Thanks!
no_root_squashis for NFS, not CIFS. – Ignacio Vazquez-Abrams Jan 6 at 23:41/mnt/company-build? – Zoredache Jan 6 at 23:42/mnt/company-build/. Thanks. – mtyson Jan 6 at 23:52net session, I get access denied, however, if Irun as administratorthe commandline window, I can see the mount session:\\192.168.1.142 UNAME Linux version .... Not sure what to make of that - uname is an administrator accont. Thanks for the idea. – mtyson Jan 7 at 17:20