FW: arla finder problem

Love lha at stacken.kth.se
Sat May 25 15:45:05 CEST 2002


Thomas Jordan <jordant at fnal.gov> writes:

> My OSX finder is confused about some permissions in AFS space. The OSX
> terminal application gets it right each time. In other pictures:
> 
>     [owen-meany:quarknet/html/team] jordant% pwd
>     /afs/fnal.gov/files/expwww/quarknet/html/team
>     [owen-meany:quarknet/html/team] jordant% cp index.shtml index.html
>     [owen-meany:quarknet/html/team] jordant% ls
>     index.html   index.shtml
>     [owen-meany:quarknet/html/team] jordant%
> 
> I cannot do this in the finder moments later. I can't even remove the file
> that I was just able to create using the OSX terminal.
> 
> I say above that the finder is confused about  _some_ permissions. Voila'
>     [owen-meany:room3/jordant/private] jordant% cp MyCV MyCV\ copy
> Works in the finder _and_ the terminal.

The reson you have problem is that finder looks that the uid, gid and modes
on the file and guesses what rights you have.

Magnus did a patch for this in xfs. I think its wrong, but less so after
getting a mac on my desk. I think it would solve your problem, you have to
patch and build arla yourself to try it (donno what version is applies to).

I think that this should be done i arlad instead (and some changes to xfs
to make it work). The problem is with this solution is with linux that have
a shared 'struct stat' between all uses.

The other solution as Harald metioned is to have "right" modbits on the
file (chmod -R go=rwx <dir>), remember those rights are not used in afs.

Love

PS, Magnus have written a ACL acl contextual menu thingy for Mac OS X, a
alpha version can be found at /afs/stacken.kth.se/home/map/Public/arlacmm,
no more fs la, fs sa to teach mac users. It is included in later versions
of arla (0.36 and later).



Index: xfs_vnodeops-common.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs_vnodeops-common.c,v
retrieving revision 1.81
diff -u -r1.81 xfs_vnodeops-common.c
--- xfs_vnodeops-common.c	2001/10/29 13:49:15	1.81
+++ xfs_vnodeops-common.c	2001/11/27 20:47:36
@@ -433,6 +433,39 @@
     return error;
 }
 
+static int
+xfs_rewrite_attr(struct vnode *vp, struct vattr *vap,
+		 struct ucred *cred, d_thread_t *p)
+{
+    int r_ok;
+    int w_ok;
+    int x_ok;
+    u_short mode;
+
+    r_ok = xfs_access_common(vp, VREAD, cred, p);
+    if (r_ok && r_ok != EACCES)
+	return r_ok;
+    w_ok = xfs_access_common(vp, VWRITE, cred, p);
+    if (w_ok && w_ok != EACCES)
+	return w_ok;
+    x_ok = xfs_access_common(vp, VEXEC, cred, p);
+    if (x_ok && x_ok != EACCES)
+ 	return x_ok;
+
+    mode = vap->va_mode & ~0777;
+
+    if (r_ok == 0)
+	mode |= 0444;
+    if (w_ok == 0)
+	mode |= 0222;
+    if (x_ok == 0)
+	mode |= 0111;
+
+    vap->va_mode = mode;
+
+    return 0;
+}
+
 int
 xfs_getattr_common(struct vnode *vp, struct vattr *vap,
 		   struct ucred *cred, d_thread_t *p)
@@ -444,8 +477,10 @@
     XFSDEB(XDEBVNOPS, ("xfs_getattr\n"));
 
     error = xfs_attr_valid(vp, cred, p, XFS_ATTR_R);
-    if (error == 0)
+    if (error == 0) {
 	*vap = xn->attr;
+	error = xfs_rewrite_attr(vp, vap, cred, p);
+    }
     return error;
 }
 





More information about the Arla-drinkers mailing list