Re: I'm stubborn or stupid (and that's not xor) (Was: CVS Import Permissions)

2006-01-31 Thread Giorgos Keramidas
On 2006-01-31 00:44, Duane [EMAIL PROTECTED] wrote:
 Hi everyone,

 On the CVS server machine should our CVS repository directory belong to
 the cvs group, i.e. user==root, group==cvs?

It's usually a good idea.

 And as for the umask, as it appears to be 027, if we give the
 cvs group write permission on /usr/local/cvsrep then when we
 import our projects they will be writeable by members of group
 cvs and the owner of the project, in this case jim.

No.  This is not how `umask' works.  Whatever value `umask'
currently has is logically-AND-ed with 0666.  This means that by
using 027, the result is:

$ python
 print %04o % (066  027)
0026

These are the bits that will be turned *off* for new files (see
the umask(2) manpage for details), so to find out which
permission bits are allowed, you have to use the reverse mask:

 print %04o % (0777  ~(066  027))
0751

The 0751 allowed-bits mask is equivalent to:

rwxr-x--x

This means that with a umask of 027, you are effectivelly
allowing only the bits in ``rwxr-x--x'' to be turned on by
default for new files, and this doesn't include write permission
for the group.

I know that the whole `umask' concept is a bit tricky to grasp,
since it depends on knowledge of numbering with an octal-base
*AND* it works in the reverse order of that people usually think
it does, but hopefully, with the help of our excellent manpages
and a bit of experimentation, it will become more obvious :)

 I apologize if I am being all the things suggested in my
 subject heading.

Nah!  Never apologize for a question.  There is no such thing as
a stupid question for this list (well, unless the question refers
to Windows, of course :P).

- Giorgos

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: I'm stubborn or stupid (and that's not xor) (Was: CVS Import Permissions)

2006-01-31 Thread Duane Whitty

Giorgos Keramidas wrote:

On 2006-01-31 00:44, Duane [EMAIL PROTECTED] wrote:


Hi everyone,

On the CVS server machine should our CVS repository directory belong to
the cvs group, i.e. user==root, group==cvs?



It's usually a good idea.



And as for the umask, as it appears to be 027, if we give the
cvs group write permission on /usr/local/cvsrep then when we
import our projects they will be writeable by members of group
cvs and the owner of the project, in this case jim.



No.  This is not how `umask' works.  Whatever value `umask'
currently has is logically-AND-ed with 0666.  This means that by
using 027, the result is:

$ python
 print %04o % (066  027)
0026

These are the bits that will be turned *off* for new files (see
the umask(2) manpage for details), so to find out which
permission bits are allowed, you have to use the reverse mask:

 print %04o % (0777  ~(066  027))
0751

The 0751 allowed-bits mask is equivalent to:

rwxr-x--x

This means that with a umask of 027, you are effectivelly
allowing only the bits in ``rwxr-x--x'' to be turned on by
default for new files, and this doesn't include write permission
for the group.

I know that the whole `umask' concept is a bit tricky to grasp,
since it depends on knowledge of numbering with an octal-base
*AND* it works in the reverse order of that people usually think
it does, but hopefully, with the help of our excellent manpages
and a bit of experimentation, it will become more obvious :)



I apologize if I am being all the things suggested in my
subject heading.



Nah!  Never apologize for a question.  There is no such thing as
a stupid question for this list (well, unless the question refers
to Windows, of course :P).

- Giorgos

__


Thanks Giorgos.

That's an excellent explanation on 
computing the allowed bits.  One of my 
mistakes was logically-AND-ing with 0777.


Sincerely

--Duane
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


I'm stubborn or stupid (and that's not xor) (Was: CVS Import Permissions)

2006-01-30 Thread Duane

david bryce wrote:


n 2006-01-30 15:52, david bryce davidbryce at fastmail.fm wrote:
   


Hi All,

I am having some confusion regarding the way CVS works with permissions
under unix when importing a new project. Currently, when I import a
project, I get this sort of permissions on the project directory:

drwxr-x---  2 jim   cvs   512 Jan 27 12:31 test_proj

Notice that the group (cvs) is not granted write access. Is this the
way it's supposed to work?
 


That depends on what your `umask' currently is.

   


Do I have to use chmod to grant write access to the group every time I
do an import?
 


No.  The correct way to fix this is to set CVSUMASK in your shell
environment, and then import the files :)
   

  
Giorgos,
  
Thanks very much for replying! I wasn't aware of this 
environment variable (even though I spent quite a while on
this problem). Using CVSUMASK certainly works when working 
on the server machine!


However, I'm not sure what to do in client/server 
situations. The CVS manual states:


Note that using the client/server CVS (see section Remote 
repositories), there is no good way to set CVSUMASK; the 
setting on the client machine has no effect.


We are currently using a pserver installation, with 
developers using windows machines. We need a way to achieve

the same effect with a user on a windows machine doing an
import. Do you have any idea how this can be done? Thank 
you!


Regards,

DB
 


Hi everyone,

On the CVS server machine should our CVS repository directory belong to 
the cvs group, i.e. user==root, group==cvs?


And as for the umask, as it appears to be 027, if we give the cvs group 
write permission on /usr/local/cvsrep
then when we import our projects they will be writeable by members of 
group cvs and the owner of the project, in this case jim.  CVS gives all 
the source files under test_proj permissions -r--r--r-- regardless of 
the umask.


So since this is an existing repository maybe there is extra work.  What 
is the biggest factor, the number of distinct projects in the 
repository?  But as a start why not do a chgrp cvs cvsrep; chmod g+w 
cvsrep.  In a new repository this would make sure all permissions 
started off correctly.  Unfortunately real life is never that simple.  
Is this not how CVS would like it?


I apologize if I am being all the things suggested in my subject 
heading.  I've posted these opinions a couple of times without 
response.  Perhaps they are inappropriate to the list or irrelevant to 
David's situation, or maybe just wrong?  I'll let it drop after this.  I 
certainly don't mean to muddy the waters but to me this is what this 
list is all about and I believe this issue goes to the heart of UN*X 
administration.


Sincerely,

--Duane Whitty
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]