From 57117e48aea21d70eb2fb4103a606c2b28593831 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 27 Mar 2026 15:34:13 +1100 Subject: conf: runas can be const Both the runas variable in conf() and the parameter to conf_ugid() can be a const pointer. For some reason cppcheck doesn't catch this now, but does after some upcoming rearrangements for sharing code with the dynamic update tool. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.c b/conf.c index 940fb9e..b1ebb4a 100644 --- a/conf.c +++ b/conf.c @@ -1320,7 +1320,7 @@ static int conf_runas(const char *opt, unsigned int *uid, unsigned int *gid) * @uid: User ID, set on success * @gid: Group ID, set on success */ -static void conf_ugid(char *runas, uid_t *uid, gid_t *gid) +static void conf_ugid(const char *runas, uid_t *uid, gid_t *gid) { /* If user has specified --runas, that takes precedence... */ if (runas) { @@ -1561,8 +1561,8 @@ void conf(struct ctx *c, int argc, char **argv) uint8_t prefix_len_from_opt = 0; unsigned int ifi4 = 0, ifi6 = 0; const char *logfile = NULL; + const char *runas = NULL; size_t logsize = 0; - char *runas = NULL; long fd_tap_opt; int name, ret; uid_t uid; -- cgit v1.2.3