From: Todd C. Miller Date: Mon, 7 Feb 2011 14:45:25 +0000 (-0500) Subject: Cosmetic changes to make diffing against trunk easier. X-Git-Tag: SUDO_1_7_5~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38abc0f12a995a9c6814a1032154818c5324b1ce;p=sudo Cosmetic changes to make diffing against trunk easier. --HG-- branch : 1.7 --- diff --git a/alloc.c b/alloc.c index 8d403751a..535465c4a 100644 --- a/alloc.c +++ b/alloc.c @@ -48,7 +48,9 @@ # include #endif -#include "sudo.h" +#include "missing.h" +#include "alloc.h" +#include "error.h" /* * If there is no SIZE_MAX or SIZE_T_MAX we have to assume that size_t @@ -158,12 +160,13 @@ estrdup(src) const char *src; { char *dst = NULL; - size_t size; + size_t len; if (src != NULL) { - size = strlen(src) + 1; - dst = (char *) emalloc(size); - (void) memcpy(dst, src, size); + len = strlen(src); + dst = (char *) emalloc(len + 1); + (void) memcpy(dst, src, len); + dst[len] = '\0'; } return dst; } diff --git a/bsm_audit.c b/bsm_audit.c index 24dece07f..94ed4a8bf 100644 --- a/bsm_audit.c +++ b/bsm_audit.c @@ -1,4 +1,5 @@ /* + * Copyright (c) 2009-2010 Todd C. Miller * Copyright (c) 2009 Christian S.J. Peron * * Permission to use, copy, modify, and distribute this software for any diff --git a/check.c b/check.c index be7d44ecb..df44bfca7 100644 --- a/check.c +++ b/check.c @@ -305,7 +305,7 @@ expand_prompt(old_prompt, user, host) } if (subst) { - new_prompt = (char *) emalloc(++len); + new_prompt = emalloc(++len); endp = new_prompt + len; for (p = old_prompt, np = new_prompt; *p; p++) { if (p[0] =='%') { diff --git a/closefrom.c b/closefrom.c index fb9958ebc..68da392d7 100644 --- a/closefrom.c +++ b/closefrom.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005, 2007 + * Copyright (c) 2004-2005, 2007, 2010 * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any @@ -47,7 +47,7 @@ # endif #endif -#include "sudo.h" +#include "missing.h" #ifndef HAVE_FCNTL_CLOSEM # ifndef HAVE_DIRFD diff --git a/sudo_nss.c b/sudo_nss.c index 5b895eabe..6bda69abb 100644 --- a/sudo_nss.c +++ b/sudo_nss.c @@ -212,7 +212,7 @@ reset_groups(pw) #if defined(HAVE_INITGROUPS) && defined(HAVE_GETGROUPS) if (pw != sudo_user.pw) { # ifdef HAVE_SETAUTHDB - aix_setauthdb(pw->pw_name); + aix_setauthdb(pw->pw_name); # endif if (initgroups(pw->pw_name, pw->pw_gid) == -1) log_error(USE_ERRNO|MSG_ONLY, "can't reset group vector"); @@ -224,7 +224,7 @@ reset_groups(pw) log_error(USE_ERRNO|MSG_ONLY, "can't get group vector"); } # ifdef HAVE_SETAUTHDB - aix_restoreauthdb(); + aix_restoreauthdb(); # endif } #endif /* HAVE_INITGROUPS && HAVE_GETGROUPS */ diff --git a/visudo.c b/visudo.c index f0324b331..6b152729e 100644 --- a/visudo.c +++ b/visudo.c @@ -1051,7 +1051,7 @@ check_aliases(strict, quiet) tq_foreach_fwd(&us->privileges, priv) { tq_foreach_fwd(&priv->hostlist, m) { if (m->type == ALIAS) - if (!alias_remove_recursive(m->name, HOSTALIAS, strict, + if (!alias_remove_recursive(m->name, HOSTALIAS, strict, quiet)) error++; }