From: Todd C. Miller Date: Wed, 24 Oct 2012 20:32:43 +0000 (-0400) Subject: Make user_cwd const since it is either a string literal or passed X-Git-Tag: SUDO_1_8_7~1^2~367 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=319fe95d084e75dd7209624caa5e74e047a58c58;p=sudo Make user_cwd const since it is either a string literal or passed in from the front-end. --- diff --git a/plugins/sudoers/iolog_path.c b/plugins/sudoers/iolog_path.c index fec178142..c0947f10b 100644 --- a/plugins/sudoers/iolog_path.c +++ b/plugins/sudoers/iolog_path.c @@ -158,7 +158,7 @@ static struct path_escape io_path_escapes[] = { */ char * expand_iolog_path(const char *prefix, const char *dir, const char *file, - char **slashp) + char const **slashp) { size_t len, prelen = 0; char *dst, *dst0, *path, *pathend, tmpbuf[PATH_MAX]; diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c index 11166101f..4b1522d42 100644 --- a/plugins/sudoers/logging.c +++ b/plugins/sudoers/logging.c @@ -742,7 +742,8 @@ new_logline(const char *message, int serrno) size_t len = 0; char *errstr = NULL; char *evstr = NULL; - char *line, sessid[7], *tsid = NULL; + char *line, sessid[7]; + const char *tsid = NULL; debug_decl(new_logline, SUDO_DEBUG_LOGGING) /* A TSID may be a sudoers-style session ID or a free-form string. */ diff --git a/plugins/sudoers/sudoers.h b/plugins/sudoers/sudoers.h index d066c03ad..9e731a547 100644 --- a/plugins/sudoers/sudoers.h +++ b/plugins/sudoers/sudoers.h @@ -85,8 +85,8 @@ struct sudo_user { char *privs; char *limitprivs; #endif - char *cwd; - char *iolog_file; + const char *cwd; + const char *iolog_file; GETGROUPS_T *gids; int ngids; int closefrom; @@ -323,7 +323,7 @@ void io_nextid(char *iolog_dir, char *iolog_dir_fallback, char sessid[7]); /* iolog_path.c */ char *expand_iolog_path(const char *prefix, const char *dir, const char *file, - char **slashp); + char const **slashp); /* env.c */ char **env_get(void);