Skip to content

Commit a3cd820

Browse files
committed
Move LOGIN_NAME_MAX compat define to login_max.c
1 parent e375330 commit a3cd820

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

lib/util/login_max.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
#include <sudo_compat.h>
3131
#include <sudo_util.h>
3232

33+
#ifndef LOGIN_NAME_MAX
34+
# ifdef _POSIX_LOGIN_NAME_MAX
35+
# define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
36+
# else
37+
# define LOGIN_NAME_MAX 9
38+
# endif
39+
#endif /* LOGIN_NAME_MAX */
40+
3341
size_t
3442
sudo_login_name_max_v1(void)
3543
{

plugins/sudoers/cvtsudoers_pwutil.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@
4545
#include <cvtsudoers.h>
4646
#include <pwutil.h>
4747

48-
#ifndef LOGIN_NAME_MAX
49-
# ifdef _POSIX_LOGIN_NAME_MAX
50-
# define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
51-
# else
52-
# define LOGIN_NAME_MAX 9
53-
# endif
54-
#endif /* LOGIN_NAME_MAX */
55-
5648
#define FIELD_SIZE(src, name, size) \
5749
do { \
5850
if ((src)->name) { \

plugins/sudoers/pwutil_impl.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,6 @@
4141
#include <sudoers.h>
4242
#include <pwutil.h>
4343

44-
#ifndef LOGIN_NAME_MAX
45-
# ifdef _POSIX_LOGIN_NAME_MAX
46-
# define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
47-
# else
48-
# define LOGIN_NAME_MAX 9
49-
# endif
50-
#endif /* LOGIN_NAME_MAX */
51-
5244
/*
5345
* For testsudoers and cvtsudoers need to support building with a different
5446
* function prefix and using custom getpwnam/getpwuid/getgrnam/getgrgid.

0 commit comments

Comments
 (0)