diff -ur pvfs-1.6.3-pre1/mgr/meta/metaio.h pvfs-1.6.3-pre1-fx/mgr/meta/metaio.h --- pvfs-1.6.3-pre1/mgr/meta/metaio.h Thu Oct 24 10:09:33 2002 +++ pvfs-1.6.3-pre1-fx/mgr/meta/metaio.h Mon Jun 14 14:43:17 2004 @@ -14,6 +14,7 @@ int meta_access(int fd, char *pathname, uid_t uid, gid_t gid, int mode); int meta_check_ownership(int fd, char *pathname, uid_t uid, gid_t gid); int get_parent(char *pathname); /* this should go somewhere else */ +int in_group(uid_t uid, gid_t gid); int md_mkdir(char *dirpath, dmeta_p dir); int get_dmeta(char * fname, dmeta_p dir); diff -ur pvfs-1.6.3-pre1/mgr/mgr.c pvfs-1.6.3-pre1-fx/mgr/mgr.c --- pvfs-1.6.3-pre1/mgr/mgr.c Tue Jun 8 13:07:44 2004 +++ pvfs-1.6.3-pre1-fx/mgr/mgr.c Mon Jun 14 14:41:41 2004 @@ -522,6 +522,8 @@ } ack_p->ack.access.meta.u_stat.st_size = -1; /* not valid anyway */ + + ack_p->eno = EACCES; ack_p->status = -1; if (req_p->req.access.mode & R_OK) @@ -530,11 +532,13 @@ mode_bits |= 002; if (req_p->req.access.mode & X_OK) mode_bits |= 001; - /* check o, g, and u in that order */ - if (((ack_p->ack.access.meta.u_stat.st_mode & 007) & + /* check root, o, g, and u in that order */ + if (req_p->uid == 0) /*give root access no matter what */ + ack_p->status = 0; + else if (((ack_p->ack.access.meta.u_stat.st_mode & 007) & mode_bits) == mode_bits) ack_p->status = 0; - else if (ack_p->ack.access.meta.u_stat.st_gid == req_p->gid && + else if (1 == in_group(req_p->uid, ack_p->ack.access.meta.u_stat.st_gid) && (((ack_p->ack.access.meta.u_stat.st_mode >> 3) & 007) & mode_bits) == mode_bits) ack_p->status = 0;