fix compiler warnings on Solaris 11

This commit is contained in:
Todd C. Miller
2018-08-22 10:40:11 -06:00
parent ad104a3e47
commit dcf168e702
2 changed files with 7 additions and 6 deletions

View File

@@ -55,9 +55,6 @@ static int
audit_sudo_selected(int sorf) audit_sudo_selected(int sorf)
{ {
auditinfo_addr_t ainfo_addr; auditinfo_addr_t ainfo_addr;
#ifdef BSM_AUDIT_COMPAT
auditinfo_t ainfo;
#endif
struct au_mask *mask; struct au_mask *mask;
int rc; int rc;
debug_decl(audit_sudo_selected, SUDOERS_DEBUG_AUDIT) debug_decl(audit_sudo_selected, SUDOERS_DEBUG_AUDIT)
@@ -65,6 +62,8 @@ audit_sudo_selected(int sorf)
if (getaudit_addr(&ainfo_addr, sizeof(ainfo_addr)) < 0) { if (getaudit_addr(&ainfo_addr, sizeof(ainfo_addr)) < 0) {
#ifdef BSM_AUDIT_COMPAT #ifdef BSM_AUDIT_COMPAT
if (errno == ENOSYS) { if (errno == ENOSYS) {
auditinfo_t ainfo;
/* Fall back to older BSM API. */ /* Fall back to older BSM API. */
if (getaudit(&ainfo) < 0) { if (getaudit(&ainfo) < 0) {
sudo_warn("getaudit"); sudo_warn("getaudit");
@@ -103,7 +102,6 @@ int
bsm_audit_success(char *exec_args[]) bsm_audit_success(char *exec_args[])
{ {
auditinfo_addr_t ainfo_addr; auditinfo_addr_t ainfo_addr;
auditinfo_t ainfo;
token_t *tok; token_t *tok;
au_id_t auid; au_id_t auid;
long au_cond; long au_cond;
@@ -143,6 +141,8 @@ bsm_audit_success(char *exec_args[])
getuid(), pid, pid, &ainfo_addr.ai_termid); getuid(), pid, pid, &ainfo_addr.ai_termid);
#ifdef BSM_AUDIT_COMPAT #ifdef BSM_AUDIT_COMPAT
} else if (errno == ENOSYS) { } else if (errno == ENOSYS) {
auditinfo_t ainfo;
/* /*
* NB: We should probably watch out for ERANGE here. * NB: We should probably watch out for ERANGE here.
*/ */
@@ -193,7 +193,6 @@ int
bsm_audit_failure(char *exec_args[], char const *const fmt, va_list ap) bsm_audit_failure(char *exec_args[], char const *const fmt, va_list ap)
{ {
auditinfo_addr_t ainfo_addr; auditinfo_addr_t ainfo_addr;
auditinfo_t ainfo;
char text[256]; char text[256];
token_t *tok; token_t *tok;
long au_cond; long au_cond;
@@ -229,6 +228,8 @@ bsm_audit_failure(char *exec_args[], char const *const fmt, va_list ap)
getuid(), pid, pid, &ainfo_addr.ai_termid); getuid(), pid, pid, &ainfo_addr.ai_termid);
#ifdef BSM_AUDIT_COMPAT #ifdef BSM_AUDIT_COMPAT
} else if (errno == ENOSYS) { } else if (errno == ENOSYS) {
auditinfo_t ainfo;
if (getaudit(&ainfo) < 0) { if (getaudit(&ainfo) < 0) {
sudo_warn("getaudit"); sudo_warn("getaudit");
debug_return_int(-1); debug_return_int(-1);

View File

@@ -102,7 +102,7 @@ ts_match_record(struct timestamp_entry *key, struct timestamp_entry *entry,
if (entry->u.ppid != key->u.ppid) { if (entry->u.ppid != key->u.ppid) {
sudo_debug_printf(SUDO_DEBUG_DEBUG, sudo_debug_printf(SUDO_DEBUG_DEBUG,
"%s:%u record ppid mismatch (want %d, got %d)", __func__, recno, "%s:%u record ppid mismatch (want %d, got %d)", __func__, recno,
key->u.ppid, entry->u.ppid); (int)key->u.ppid, (int)entry->u.ppid);
debug_return_bool(false); debug_return_bool(false);
} }
if (sudo_timespeccmp(&entry->start_time, &key->start_time, !=)) { if (sudo_timespeccmp(&entry->start_time, &key->start_time, !=)) {