]> andersk Git - moira.git/blobdiff - incremental/afs.c
Suppress warning about ownership changes - administrators have been warned.
[moira.git] / incremental / afs.c
index 28dffee30ae009b5b1eb2abe0e09bddc60d4bc1d..4171c2a76c5cac4c1a0e7c9004fecdb9b48857b6 100644 (file)
@@ -170,7 +170,7 @@ int afterc;
            return;
        }
 
-       if (beforec) {
+       if (bstate != 0) {
            /* Reactivating a user; get his group list */
            gethostname(hostname, sizeof(hostname));
            code = mr_connect(hostname);
@@ -351,37 +351,47 @@ int afterc;
        return;
     }
     
-    /* What do we do?  When do we use FS_CREATE?
-     *
-     * Currently, we use FS_CREATE to indicate that Moira should attempt
-     * to update the file servers (rename, creation, ownership change).
-     * 
-     * Howerver, at this time, we there is no back-end support to handle:
-     *   TYPE change       (eg. AFS -> ERR)
-     *   LOCKERTYPE change (eg. PROJECT -> COURSE)
-     *   PACK change       (eg. /afs/athena/foo -> /afs/athena/bar)
-     *   LABEL change      (eg. "foo" -> "bar")
-     *   Locker Deletion
-     */
-
     btype = !strcmp(before[FS_TYPE], "AFS");
     if (afterc < FS_CREATE) {
        if (btype)
            critical_alert("incremental",
-                          "Could not delete AFS filesystem %s: Operation not supported",
+                          "Cannot delete AFS filesystem %s: Operation not supported",
                           before[FS_NAME]);
        return;
-    } if (acreate && atype) {
-       if (btype) {
-           critical_alert("incremental",
-                          "Cannot change attributes of AFS filesystem %s: Operation not supported",
-                          after[FS_NAME]);
-       } else {
-           critical_alert("incremental",
-                          "Cannot convert %s to an AFS filesystem: Operation not supported",
-                          after[FS_NAME]);
-       }
     }
+
+    if (!acreate)
+       return;
+
+    /* Are we dealing with AFS lockers (could be type ERR lockers) */
+    if (!atype && !btype)
+       if (strcmp(before[FS_TYPE], "ERR") || strcmp(after[FS_TYPE], "ERR"))
+           return;
+                                                   
+    /* By now, we know we are simply changing AFS filesystem attributes.
+     * Operations supported:
+     *    Name change:  rename/remount
+     *    Path change:  remount
+     *    Type change:  ERR<-->AFS
+     */
+
+#if 0
+    if (strcmp(before[FS_OWNER], after[FS_OWNER]) ||
+       strcmp(before[FS_OWNERS], after[FS_OWNERS]))
+    {
+       critical_alert("incremental",
+                      "Cannot change ownership of filesystem %s: Operation not yet supported",
+                      after[FS_NAME]);
+    }
+#endif
+
+    sprintf(cmd, "%s/perl -I%s %s/afs_rename.pl %s %s %s %s %s %s %s %s %s %s",
+           BIN_DIR, BIN_DIR, BIN_DIR,
+           before[FS_NAME], before[FS_MACHINE], before[FS_TYPE],
+           before[FS_L_TYPE], before[FS_PACK],
+           after[FS_NAME], after[FS_MACHINE], after[FS_TYPE],
+           after[FS_L_TYPE], after[FS_PACK]);
+    run_cmd(cmd);
 }
 
 
This page took 0.10476 seconds and 4 git commands to generate.