From: tedu Date: Thu, 6 Apr 2017 21:14:12 +0000 (+0000) Subject: a little const here and there to prevent rules from changing X-Git-Tag: v6.6~63 X-Git-Url: https://git.armaanb.net/?p=opendoas.git;a=commitdiff_plain;h=f0fa08cd6ba71c84495fa93fede52a7536f047c8 a little const here and there to prevent rules from changing --- diff --git a/doas.c b/doas.c index d30f73d..b6a7bc1 100644 --- a/doas.c +++ b/doas.c @@ -140,7 +140,7 @@ match(uid_t uid, gid_t *groups, int ngroups, uid_t target, const char *cmd, } static int -permit(uid_t uid, gid_t *groups, int ngroups, struct rule **lastr, +permit(uid_t uid, gid_t *groups, int ngroups, const struct rule **lastr, uid_t target, const char *cmd, const char **cmdargs) { int i; @@ -187,7 +187,7 @@ static void __dead checkconfig(const char *confpath, int argc, char **argv, uid_t uid, gid_t *groups, int ngroups, uid_t target) { - struct rule *rule; + const struct rule *rule; if (setresuid(uid, uid, uid) != 0) err(1, "setresuid"); @@ -311,7 +311,7 @@ main(int argc, char **argv) char cmdline[LINE_MAX]; char myname[_PW_NAME_LEN + 1]; struct passwd *pw; - struct rule *rule; + const struct rule *rule; uid_t uid; uid_t target = 0; gid_t groups[NGROUPS_MAX + 1];