char **after;
int afterc;
{
- int agid, bgid;
+ register int agid, bgid;
+ int ahide, bhide;
long code, id;
char hostname[64];
char g1[PR_MAXNAMELEN], g2[PR_MAXNAMELEN];
char *av[2];
agid = bgid = 0;
- if (beforec > L_GID && atoi(before[L_ACTIVE]) && atoi(before[L_GROUP]))
+ if (beforec > L_GID && atoi(before[L_ACTIVE]) && atoi(before[L_GROUP])) {
bgid = atoi(before[L_GID]);
- if (afterc > L_GID && atoi(after[L_ACTIVE]) && atoi(after[L_GROUP]))
+ bhide = atoi(before[L_HIDDEN]);
+ }
+ if (afterc > L_GID && atoi(after[L_ACTIVE]) && atoi(after[L_GROUP])) {
agid = atoi(after[L_GID]);
+ ahide = atoi(after[L_HIDDEN]);
+ }
if (agid == 0 && bgid == 0) /* Not active groups */
return;
- if (agid == bgid && !strcmp(after[L_NAME], before[L_NAME]))
- return; /* No change */
code=pr_Initialize(1, AFSCONF_CLIENTNAME, 0);
if (code) {
}
if (agid && bgid) {
- /* Only a modify is required */
- strcpy(g1, "system:");
- strcpy(g2, "system:");
- strcat(g1, before[L_NAME]);
- strcat(g2, after[L_NAME]);
- code = pr_ChangeEntry(g1, g2, (agid==bgid) ? 0 : -agid, "");
- if (code) {
- critical_alert("incremental",
- "Couldn't change group %s (id %d) to %s (id %d): %s",
- before[L_NAME], -bgid, after[L_NAME], -agid,
- error_message(code));
+ if (strcmp(after[L_NAME], before[L_NAME])) {
+ /* Only a modify is required */
+ strcpy(g1, "system:");
+ strcpy(g2, "system:");
+ strcat(g1, before[L_NAME]);
+ strcat(g2, after[L_NAME]);
+ code = pr_ChangeEntry(g1, g2, (agid==bgid) ? 0 : -agid, "");
+ if (code) {
+ critical_alert("incremental",
+ "Couldn't change group %s (id %d) to %s (id %d): %s",
+ before[L_NAME], -bgid, after[L_NAME], -agid,
+ error_message(code));
+ }
+ }
+ if (ahide != bhide) {
+ code = pr_SetFieldsEntry
+ (-agid, PR_SF_ALLBITS,
+ (ahide ? PRP_STATUS_ANY : PRP_GROUP_DEFAULT) >> PRIVATE_SHIFT,
+ 0 /*ngroups*/, 0 /*nusers*/);
+ if (code) {
+ critical_alert("incremental",
+ "Couldn't set flags of group %s: %s",
+ after[L_NAME], error_message(code));
+ }
}
return;
}
after[L_NAME], id, error_message(code));
return;
}
+ if (ahide) {
+ code = pr_SetFieldsEntry
+ (-agid, PR_SF_ALLBITS,
+ (ahide ? PRP_STATUS_ANY : PRP_GROUP_DEFAULT) >> PRIVATE_SHIFT,
+ 0 /*ngroups*/, 0 /*nusers*/);
+ if (code) {
+ critical_alert("incremental",
+ "Couldn't set flags of group %s: %s",
+ after[L_NAME], error_message(code));
+ }
+ }
/* We need to make sure the group is properly populated */
if (beforec < L_ACTIVE || atoi(before[L_ACTIVE]) == 0) return;
if (afterc)
edit_group(1, after[LM_LIST], after[LM_TYPE], after[LM_MEMBER]);
if (beforec)
- edit_group(0, after[LM_LIST], after[LM_TYPE], after[LM_MEMBER]);
+ edit_group(0, before[LM_LIST], before[LM_TYPE], before[LM_MEMBER]);
}
sleep(1); /* give the ptserver room */
edit_group(1, group, av[0], av[1]);
} else {
- code = mr_query("get_members_of_list", 1, &av[1], get_members, group);
+ code = mr_query("get_end_members_of_list", 1, &av[1],
+ get_members, group);
if (code)
critical_alert("incremental",
"Couldn't retrieve full membership of %s: %s",
* LABEL change: rename/remount
* Deletion: rename/unmount
*/
+ if (afterc < FS_CREATE) {
+ if (!strcmp(before[FS_TYPE], "AFS"))
+ critical_alert("incremental",
+ "Could not delete AFS filesystem %s: Operation not supported\n",
+ before[FS_NAME]);
+ return;
+ }
+
+ if (!strcmp(after[FS_TYPE], "AFS")) {
+ if (strcmp(before[FS_TYPE], "AFS")) {
+ critical_alert("incremental",
+ "Cannot convert %s to an AFS filesystem: Operation not supported\n",
+ after[FS_NAME]);
+ } else {
+ critical_alert("incremental",
+ "Cannot change attributes of AFS filesystem %s: Operation not supported\n",
+ after[FS_NAME]);
+ }
+ return;
+ }
}