New upstream version 4.17.2
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
#include "config.h"
|
||||
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#if (__GNUC__ >= 10)
|
||||
# define MAYBE_UNUSED [[gnu::unused]]
|
||||
# define NORETURN [[gnu::__noreturn__]]
|
||||
# define format_attr(type, fmt, va) [[gnu::format(type, fmt, va)]]
|
||||
|
||||
+8
-6
@@ -2,7 +2,7 @@
|
||||
// SPDX-FileCopyrightText: 1996-2000, Marek Michałkiewicz
|
||||
// SPDX-FileCopyrightText: 2001-2005, Tomasz Kłoczko
|
||||
// SPDX-FileCopyrightText: 2005-2008, Nicolas François
|
||||
// SPDX-FileCopyrightText: 2023-2024, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-FileCopyrightText: 2023-2025, Alejandro Colomar <alx@kernel.org>
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/param.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "defines.h"
|
||||
@@ -36,6 +34,11 @@
|
||||
#include "string/strcmp/streq.h"
|
||||
|
||||
|
||||
#ifndef LOGIN_NAME_MAX
|
||||
# define LOGIN_NAME_MAX 256
|
||||
#endif
|
||||
|
||||
|
||||
int allow_bad_names = false;
|
||||
|
||||
|
||||
@@ -44,12 +47,11 @@ login_name_max_size(void)
|
||||
{
|
||||
long conf;
|
||||
|
||||
errno = 0;
|
||||
conf = sysconf(_SC_LOGIN_NAME_MAX);
|
||||
if (conf == -1 && errno != 0)
|
||||
if (conf == -1)
|
||||
return LOGIN_NAME_MAX;
|
||||
|
||||
return MIN(conf, PTRDIFF_MAX);
|
||||
return conf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ void setsgent (void)
|
||||
if (NULL != shadow) {
|
||||
rewind (shadow);
|
||||
} else {
|
||||
shadow = fopen (SGROUP_FILE, "r");
|
||||
shadow = fopen (SGROUP_FILE, "re");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ static int run_part(char *script_path, const char *name, const char *action)
|
||||
setenv("SUBJECT",name,1);
|
||||
execv(script_path,args);
|
||||
fprintf(shadow_logfd, "execv: %s\n", strerror(errno));
|
||||
exit(1);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
pid_status = wait(&wait_status);
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ void setspent (void)
|
||||
if (NULL != shadow) {
|
||||
rewind (shadow);
|
||||
}else {
|
||||
shadow = fopen (SHADOW_FILE, "r");
|
||||
shadow = fopen (SHADOW_FILE, "re");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -35,11 +35,11 @@ run_command(const char *cmd, const char *argv[],
|
||||
(void) execve (cmd, (char * const *) argv,
|
||||
(char * const *) envp);
|
||||
if (ENOENT == errno) {
|
||||
exit (E_CMD_NOTFOUND);
|
||||
_exit (E_CMD_NOTFOUND);
|
||||
}
|
||||
fprintf (shadow_logfd, "%s: cannot execute %s: %s\n",
|
||||
shadow_progname, cmd, strerror (errno));
|
||||
exit (E_CMD_NOEXEC);
|
||||
_exit (E_CMD_NOEXEC);
|
||||
} else if ((pid_t)-1 == pid) {
|
||||
fprintf (shadow_logfd, "%s: cannot execute %s: %s\n",
|
||||
shadow_progname, cmd, strerror (errno));
|
||||
|
||||
Reference in New Issue
Block a user