problems with arla

Assar Westerlund assar at stacken.kth.se
Tue May 9 02:06:00 CEST 2000


Dr A V Le Blanc <LeBlanc at mcc.ac.uk> writes:
> Thanks for the patch, which allows `fs listcells' to produce
> useful information.  Unfortunately, at least on my arla-0.32 system,
> it also has a problem:
> 
>      fs : Invalid argument; it is possible that [unknown path] is not in AFS.
> 
> This is the end of every `fs listcells' request.  I also notice that
> if I specify 'suid-cell', `fs listcells' lists every cell as suid
> _except_ the one which is suid, which is not listed as suid.

Thanks for this report.  listcells does indeed have some problems.  I
think that the appended patch takes care of all the problems that you
have experienced.

/assar



Index: xfs/linux/xfs_syscalls.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/linux/xfs_syscalls.c,v
retrieving revision 1.60
diff -u -w -u -w -r1.60 xfs_syscalls.c
--- xfs/linux/xfs_syscalls.c	2000/04/27 23:57:09	1.60
+++ xfs/linux/xfs_syscalls.c	2000/05/08 23:51:53
@@ -640,8 +640,6 @@
 	msg2 = (struct xfs_message_wakeup_data *) &msg;
 	if (error == 0)
 	    error = msg2->error;
-	else
-	    error = -EINVAL;
 
 	if (error == 0 && msg2->header.opcode == XFS_MSG_WAKEUP_DATA) {
 	    if(copy_to_user(vice_ioctl.out, msg2->msg,
Index: appl/fs/fs.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/appl/fs/fs.c,v
retrieving revision 1.79
diff -u -w -r1.79 fs.c
--- appl/fs/fs.c	2000/05/06 13:44:36	1.79
+++ appl/fs/fs.c	2000/05/09 00:02:08
@@ -2070,20 +2070,16 @@
 void
 afs_getcellstatus (char *cell)
 {
-    struct ViceIoctl   a_params;
-    int32_t            flags;
-
-    a_params.in_size = strlen (cell) + 1;
-    a_params.out_size = sizeof (int32_t);
-    a_params.in = cell;
-    a_params.out = (char *) &flags;
+    u_int32_t flags;
+    int ret;
 
-    if (k_pioctl (NULL, VIOC_GETCELLSTATUS, &a_params, 0) == -1) {
-	fserr(PROGNAME, errno, cell);
+    ret = fs_getcellstatus (cell, &flags);
+    if (ret) {
+	fserr(PROGNAME, ret, cell);
 	return;
     }
-
-    printf ("Cell %s status: %ssetuid allowed\n", cell, NO_SETUID_HONORED(flags) ? "no " : "");
+    printf ("Cell %s status: %ssetuid allowed\n", cell,
+	    !SETUID_HONORED(flags) ? "no " : "");
 }
 
 /* 
@@ -2127,11 +2123,13 @@
 	    }
 	}
 	if (suid) {
-	    ret = fs_getcellstatus (cellname, &j);
+	    u_int32_t status;
+
+	    ret = fs_getcellstatus (cellname, &status);
 	    if (ret)
 		fserr (PROGNAME, ret, NULL);
 	    else {
-		if (!(j & CELLSTATUS_SETUID))
+		if (status & CELLSTATUS_SETUID)
 		    printf (", suid cell");
 	    }
 	}
Index: appl/fs/fs_local.h
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/appl/fs/fs_local.h,v
retrieving revision 1.29
diff -u -w -r1.29 fs_local.h
--- appl/fs/fs_local.h	2000/03/03 08:50:12	1.29
+++ appl/fs/fs_local.h	2000/05/09 00:03:25
@@ -72,9 +72,9 @@
 };
 
 /* Flags for cell status */
-#define PRIMARY_CELL(flags)      ((flags) & 0x1)
-#define NO_SETUID_HONORED(flags) ((flags) & 0x2)
-#define OBSOLETE_VERSION(flags)  ((flags) & 0x4)
+#define PRIMARY_CELL(flags)      ((flags) & CELLSTATUS_PRIMARY)
+#define SETUID_HONORED(flags)	 ((flags) & CELLSTATUS_SETUID)
+#define OBSOLETE_VERSION(flags)  ((flags) & CELLSTATUS_OBSOLETE_VL)
 
 void afs_copyacl(char *fromdir, char *todir);
 void afs_listacl(char *path);





More information about the Arla-drinkers mailing list