# 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
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;
}
/*
+ * 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
}
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] =='%') {
/*
- * 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
# endif
#endif
-#include "sudo.h"
+#include "missing.h"
#ifndef HAVE_FCNTL_CLOSEM
# ifndef HAVE_DIRFD
#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");
log_error(USE_ERRNO|MSG_ONLY, "can't get group vector");
}
# ifdef HAVE_SETAUTHDB
- aix_restoreauthdb();
+ aix_restoreauthdb();
# endif
}
#endif /* HAVE_INITGROUPS && HAVE_GETGROUPS */
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++;
}