Menu

#1 chmod on AFS

open
nobody
None
5
2000-12-02
2000-12-02
Anonymous
No

Private communication:

i'm using prcs. there's some interface stuff i don't like. for
instance, if i have a file in my working dir that is NOT in the
repository, i'd like to be informed. (i consider it quite dangerous
to NOT be informed, since someone else could have removed the file
from the project and i'll keep making changes to it, not knowing that
my checkins aren't saving versions of the file.)

this, and a bunch of other "status" things i could get with a perl
wrapper, although inefficiently. i won't give you a big brain dump of
things i'd like to see because i want to get more experience with the
PRCS way of doing things, and because i know things are changing for
prcs 2.0. but if, down the line, there are features that i'd want and
you think fit into the prcs philosophy, i wouldn't mind writing the
code.
also, like i said in my last message, PRCS makes lots of noise on AFS
when it shouldn't. the fix here, imo, is to not complain if you're on
AFS and leave the ACLs up to the repository maintainer. it's too
complicated to do in PRCS. and i'd probably remove the permissions
stuff for non-AFS just for consistency.

> How can I tell if AFS is in use?

this is a lot harder than i thought. first, i thought to just do a
statfs and look at the f_type. but, at least on a linux AFS setup, the
f_type is 0x0. on bsd, it seems like it would return 13 for this
value.

also, statfs on BSD helpfully has a char * field where "AFS" would go,
but linux doesn't have this.

so, attempt #2: i looked at the source to `df' on linux. it's
gnarly. it scans /etc/mtab to get a list of file system types. then
it figures out which mount point a given directory is in so that it
can list the file system information for it. in other words, if you
do "df ~", then df will backtrace from ~ all the way back to a mount
point listed in /etc/mtab, and then print out the info from that line
in /etc/mtab. if that line has "AFS", you know you're on AFS.

so i have several recommendations:

1) check to see if the dir begins with "/afs". 99% of all AFS
installations are like this.

2) try your chmod the way you have it. if it fails, try without the
set-gid (and other high level bits?) set. (btw, the set-gid is
totally meaningless in afs.) ...on the theory that if the setgid
bit was all that prevented it from working, then the OS doesn't
want you messing with it anyway.

3) get rid of all the permissions stuff entirely from PRCS. your
documentation should say "you need to protect your repository. on
UFS, you'd do chmod, blah blah blah. on AFS, you'd do "fs sa blah
blah blah". it's easier to let the user do this so you don't have
to figure out how your protections semantics map onto every kind of
file system.

Discussion


Log in to post a comment.