commit - d6013008902a0a4ffedcd76ecac89d3613041cf3
commit + f20a053a0039f502076e560981f330b1ad494585
blob - 9270b99463cb1ad4a9e4150d2f673a0608250db5
blob + 67d439800ada0fbc2df3a934e0f22f6935f1f7af
--- ctl.c
+++ ctl.c
/* subroutines */
int fill_tmpfile(char **, char *, char **);
int edit_file(char *, mode_t, char *, char **);
-int rule_writeline(char *, mode_t, char *);
+int rule_writeline(char *, mode_t, char *, int);
int acq_lock(char *);
void rls_lock(int);
goto done;
}
/* write indented line to tmp config file */
- rule_writeline(tmpfile, daemons->mode, saveline);
+ rule_writeline(tmpfile, daemons->mode, saveline,
+ cli_rtable);
goto done;
}
}
}
int
-rule_writeline(char *fname, mode_t mode, char *writeline)
+rule_writeline(char *fname, mode_t mode, char *writeline, int rdomain)
{
FILE *rulefile;
printf("%% Rule write failed: %s\n", strerror(errno));
return(1);
}
- if (writeline[0] == ' ')
+ if (writeline[0] == ' ') {
writeline++;
+ /* Lines for rdomain-specific daemons are indented twice. */
+ if (rdomain > 0 && writeline[0] == ' ')
+ writeline++;
+ }
fprintf(rulefile, "%s", writeline);
fclose(rulefile);
chmod(fname, mode);