diff options
author | Todd C. Miller <Todd.Miller@sudo.ws> | 2020-08-12 13:45:09 -0600 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@sudo.ws> | 2020-08-12 13:45:09 -0600 |
commit | cb0993bce1aa8d7ffe7364e8d9b48197b65a096c (patch) | |
tree | 2dad33395b127ef8be3dcceea45fab082e69dfbf /src/selinux.c | |
parent | d8e699b32eff12a994dc2416ea6d6f6fcb274402 (diff) | |
download | sudo-cb0993bce1aa8d7ffe7364e8d9b48197b65a096c.tar.gz |
Fix some warnings from pvs-studio
Diffstat (limited to 'src/selinux.c')
-rw-r--r-- | src/selinux.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/selinux.c b/src/selinux.c index 5f74c81cc..69d2db606 100644 --- a/src/selinux.c +++ b/src/selinux.c @@ -81,7 +81,7 @@ audit_role_change(const security_context_t old_context, /* Kernel may not have audit support. */ if (errno != EINVAL && errno != EPROTONOSUPPORT && errno != EAFNOSUPPORT ) - sudo_fatal(U_("unable to open audit system")); + sudo_fatal("%s", U_("unable to open audit system")); } else { /* audit role change using the same format as newrole(1) */ rc = asprintf(&message, "newrole: old-context=%s new-context=%s", @@ -91,7 +91,7 @@ audit_role_change(const security_context_t old_context, rc = audit_log_user_message(au_fd, AUDIT_USER_ROLE_CHANGE, message, NULL, NULL, ttyn, result); if (rc <= 0) - sudo_warn(U_("unable to send audit message")); + sudo_warn("%s", U_("unable to send audit message")); free(message); close(au_fd); } @@ -199,7 +199,7 @@ relabel_tty(const char *ttyn, int ptyfd) } if (fgetfilecon(se_state.ttyfd, &tty_con) == -1) { - sudo_warn(U_("unable to get current tty context, not relabeling tty")); + sudo_warn("%s", U_("unable to get current tty context, not relabeling tty")); goto bad; } @@ -211,7 +211,7 @@ relabel_tty(const char *ttyn, int ptyfd) } if (security_compute_relabel(se_state.new_context, tty_con, tclass, &new_tty_con) == -1) { - sudo_warn(U_("unable to get new tty context, not relabeling tty")); + sudo_warn("%s", U_("unable to get new tty context, not relabeling tty")); goto bad; } } @@ -220,7 +220,7 @@ relabel_tty(const char *ttyn, int ptyfd) sudo_debug_printf(SUDO_DEBUG_INFO, "%s: tty context %s -> %s", __func__, tty_con, new_tty_con); if (fsetfilecon(se_state.ttyfd, new_tty_con) == -1) { - sudo_warn(U_("unable to set new tty context")); + sudo_warn("%s", U_("unable to set new tty context")); goto bad; } } @@ -336,7 +336,7 @@ get_exec_context(security_context_t old_context, const char *role, const char *t * its components easily. */ if ((context = context_new(old_context)) == NULL) { - sudo_warn(U_("failed to get new context")); + sudo_warn("%s", U_("failed to get new context")); goto bad; } @@ -393,13 +393,13 @@ selinux_setup(const char *role, const char *type, const char *ttyn, /* Store the caller's SID in old_context. */ if (getprevcon(&se_state.old_context)) { - sudo_warn(U_("failed to get old context")); + sudo_warn("%s", U_("failed to get old context")); goto done; } se_state.enforcing = security_getenforce(); if (se_state.enforcing == -1) { - sudo_warn(U_("unable to determine enforcing mode.")); + sudo_warn("%s", U_("unable to determine enforcing mode.")); goto done; } |