2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-01 14:55:12 +00:00

Move LOGIN_NAME_MAX compat define to login_max.c

This commit is contained in:
Todd C. Miller
2025-01-15 08:57:05 -07:00
parent e3753309fe
commit a3cd820d21
3 changed files with 8 additions and 16 deletions

View File

@@ -30,6 +30,14 @@
#include <sudo_compat.h> #include <sudo_compat.h>
#include <sudo_util.h> #include <sudo_util.h>
#ifndef LOGIN_NAME_MAX
# ifdef _POSIX_LOGIN_NAME_MAX
# define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
# else
# define LOGIN_NAME_MAX 9
# endif
#endif /* LOGIN_NAME_MAX */
size_t size_t
sudo_login_name_max_v1(void) sudo_login_name_max_v1(void)
{ {

View File

@@ -45,14 +45,6 @@
#include <cvtsudoers.h> #include <cvtsudoers.h>
#include <pwutil.h> #include <pwutil.h>
#ifndef LOGIN_NAME_MAX
# ifdef _POSIX_LOGIN_NAME_MAX
# define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
# else
# define LOGIN_NAME_MAX 9
# endif
#endif /* LOGIN_NAME_MAX */
#define FIELD_SIZE(src, name, size) \ #define FIELD_SIZE(src, name, size) \
do { \ do { \
if ((src)->name) { \ if ((src)->name) { \

View File

@@ -41,14 +41,6 @@
#include <sudoers.h> #include <sudoers.h>
#include <pwutil.h> #include <pwutil.h>
#ifndef LOGIN_NAME_MAX
# ifdef _POSIX_LOGIN_NAME_MAX
# define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
# else
# define LOGIN_NAME_MAX 9
# endif
#endif /* LOGIN_NAME_MAX */
/* /*
* For testsudoers and cvtsudoers need to support building with a different * For testsudoers and cvtsudoers need to support building with a different
* function prefix and using custom getpwnam/getpwuid/getgrnam/getgrgid. * function prefix and using custom getpwnam/getpwuid/getgrnam/getgrgid.