Link to home
Create AccountLog in
Avatar of DanRaposo
DanRaposoFlag for United States of America

asked on

Problem using CVS on LINUX CIFS mounted file system. CVS can't chmod files

On our Redhat 6 system we have mounted a CIFS share.  We use CVS to access repositoies on that share.  CVS wants to do a change mod, but the way the directory is mounted will not allow this.   How can I mount the file system so that CVS can chmod the repositories?

This is how the share is mapped

//FS1/users   /fs1       cifs    credentials=/etc/.cifscredentials,iocharset=utf8,file_mode=0777,dir_mode=0777,uid=root,gid=users 0 0

if I login as myself and create a file

touch file

if I try to chmod 444 file

I get operation not permitted.
Avatar of Chris B
Chris B
Flag of Australia image

Try copying the file first then work on the copy. Should be OK then.

Chris B
Avatar of DanRaposo


Hi Chris,

Unfortunately this does not work.  Even if I create a new file as user a and then try a chmod it will not allow me to do that without first su - or sudo

the CIFS file system is mounted with root:/users as uid/gid combo ... is there anyway to not force it to be mounted with all files owned by root (or any specific user) ?    I would think if the actual owner of the file was displayed then the chmod might work.

Anyone have any suggestions on how to better incorporate windows shares in a linux/windows hybrid environment?  The problem itself is not actually CVS, but the ability to do a chmod on files.    

If I mount the file system as myself I can do the chmod .. but that' s not very practical ... there are many users that need to do the chmod.
Avatar of Duncan Roe
We got around this problem at work by using CVS pserver. In other words, ignore the fact that the partition is mounted when it comes to using CVS: The Windows behavior is so different from what the Linux utility expects that it's never going to cope.

[My previous solution (which I didn't like to post when I first saw your Q) was to modify the HGFS disk driver to make all chmod calls result in 777 permission (this was from Vmware). Horrrible eh?]
We are using a pserver but it has the same issue during commit.   Check out and update is fine.  Commit barfs attempting to chmod.
You have to have the pserver on the Windows system, using WinCVS. WinCVS knows how to deal with Windows file system behavior.
We are using winCVS as a client but not a windows based Pserver.   Is there on eyou recommend?   Th eonly one I have heard of is CVS NT.
I did ask our Windows admin guy how he did it but he has forgotten and the server crashed so now he can't look. :(So much for RAID)
As far as I know, we ran WinCVS as a server. It needs to be resuscitated, so I will make more enquiries.
Hi again Dan - turns out we did use CVS NT. It was free in 2004 when we got it - I see you now have to pay something. It certainly does the trick - I found the old cvsnt_setup.exe and our sys admin has tried it.
We got cvsnt with wincvs - it just came. Didn't you get it?
I don't know.  I am not a developer.  I can look, however, it seems that CIFS is also creating a problem with SVN (symbolic links)  so it turns out that CVSNT won't do the trick to help the SVN problem.  I am considering just wiping it out and going with an NFS mounted file system.   Not sure if I should risk NFS on windows or just go back to the reliable NFS on linux mount.     The only issue with that is a fractured file server where I will be forced to use and backup different servers and protocols for related data.
Avatar of Duncan Roe
Duncan Roe
Flag of Australia image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thank you for all your help.  I think the best solution is for me to remap as an NFS file system, but I will use linux as the host.   I have learned a lot abut the limitations of CIFs, windows and symbolic links.   I appreciate all the advice.   I will accept NFS as the solution as that seems to be the best fit to my particular needs.