- /* 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_MEM : 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));
+ }