]> granicus.if.org Git - sudo/commitdiff
Cosmetic changes to make diffing against trunk easier.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 7 Feb 2011 14:45:25 +0000 (09:45 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 7 Feb 2011 14:45:25 +0000 (09:45 -0500)
--HG--
branch : 1.7

alloc.c
bsm_audit.c
check.c
closefrom.c
sudo_nss.c
visudo.c

diff --git a/alloc.c b/alloc.c
index 8d403751aadca0fa359e50a4cff2f001c7bec793..535465c4aeb86a7295e858cd186ec89caafa934f 100644 (file)
--- a/alloc.c
+++ b/alloc.c
@@ -48,7 +48,9 @@
 # include <inttypes.h>
 #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;
 }
index 24dece07fe7f3109735125199774095b653e934d..94ed4a8bf5152434c5cd50ae018e21f54125d0c5 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2009-2010 Todd C. Miller <Todd.Miller@courtesan.com>
  * 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 be7d44ecb3d27a22ead6cea8e9e9aaa2ee18d457..df44bfca73934706d724cdc61a8b94d8e3f44280 100644 (file)
--- 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] =='%') {
index fb9958ebc2f3e559e5160dc2beaa5f58fe2ff37c..68da392d746f30b97ab2da4dea4a2764f9e3333e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004-2005, 2007
+ * Copyright (c) 2004-2005, 2007, 2010
  *     Todd C. Miller <Todd.Miller@courtesan.com>
  *
  * 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
index 5b895eabea257bf5bfc3eb43d33e64adaacc888c..6bda69abb01e1c280540fa9094693dae04da82bf 100644 (file)
@@ -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 */
index f0324b3316740069f4ee8fba05e51c001eb3c376..6b152729e9717815fd2c0cb65a74018736adc356 100644 (file)
--- 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++;
            }