]> andersk Git - moira.git/blobdiff - incremental/afs.c
Imakefile: use the same debug flag as everyone else
[moira.git] / incremental / afs.c
index 69539a348384c9fab429e50e3b121f44360dab8a..1dee3b86179852c5e500509d37f7d1b72503b02e 100644 (file)
@@ -53,6 +53,7 @@ extern long pr_ChangeEntry();
 extern long pr_SetFieldsEntry();
 extern long pr_AddToGroup();
 extern long pr_RemoveUserFromGroup();
+extern long pr_SIdToName();
 
 static char tbl_buf[1024];
 static struct member {
@@ -180,6 +181,16 @@ int afterc;
               after[U_NAME], auid);
        
        code = pr_try(pr_CreateUser, after[U_NAME], &auid);
+       /* if we get PRIDEXIST, it's only an error if the username
+          doesn't match (otherwise it just means the user was deleted
+          from Moira but not AFS */
+       if (code == PRIDEXIST) {
+           char ename[255];
+           
+           if (pr_try(pr_SIdToName, auid, ename) == 0 &&
+               !strcmp(after[U_NAME], ename))
+               return;
+       }
        if (code) {
            critical_alert("incremental",
                           "Couldn't create user %s (id %d): %s",
@@ -289,6 +300,12 @@ int afterc;
        com_err(whoami, 0, "Creating %s group %s (gid %d)",
               (ahide ? "hidden" : "visible"), after[L_NAME], agid);
        code = pr_try(pr_CreateGroup, g1, g2, &id);
+       if (code == PRIDEXIST) {
+           char ename[255];
+           
+           if (pr_try(pr_SIdToName, -agid, ename) == 0 && !strcmp(g1, ename))
+               return;
+       }
        if (code) {
            critical_alert("incremental",
                           "Couldn't create group %s (id %d): %s",
This page took 0.15391 seconds and 4 git commands to generate.