audit: remove static local realms
[openafs.git] / src / bozo / bosserver.c
index 169685b..4bc6d40 100644 (file)
@@ -99,6 +99,24 @@ bozo_rxstat_userok(struct rx_call *call)
     return afsconf_SuperUser(bozo_confdir, call, NULL);
 }
 
+/**
+ * Return true if this name is a member of the local realm.
+ */
+int
+bozo_IsLocalRealmMatch(void *rock, char *name, char *inst, char *cell)
+{
+    struct afsconf_dir *dir = (struct afsconf_dir *)rock;
+    afs_int32 islocal = 0;     /* default to no */
+    int code;
+
+    code = afsconf_IsLocalRealmMatch(dir, &islocal, name, inst, cell);
+    if (code) {
+       bozo_Log("Failed local realm check; code=%d, name=%s, inst=%s, cell=%s\n",
+                code, name, inst, cell);
+    }
+    return islocal;
+}
+
 /* restart bozo process */
 int
 bozo_ReBozo(void)
@@ -1121,6 +1139,9 @@ main(int argc, char **argv, char **envp)
        }
     }
 
+    /* initialize audit user check */
+    osi_audit_set_user_check(tdir, bozo_IsLocalRealmMatch);
+
     /* read init file, starting up programs */
     if ((code = ReadBozoFile(0))) {
        bozo_Log