Skip to content

Commit

Permalink
Move LOGIN_NAME_MAX compat define to login_max.c
Browse files Browse the repository at this point in the history
  • Loading branch information
millert committed Jan 15, 2025
1 parent e375330 commit a3cd820
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
8 changes: 8 additions & 0 deletions lib/util/login_max.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
#include <sudo_compat.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
sudo_login_name_max_v1(void)
{
Expand Down
8 changes: 0 additions & 8 deletions plugins/sudoers/cvtsudoers_pwutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@
#include <cvtsudoers.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) \
do { \
if ((src)->name) { \
Expand Down
8 changes: 0 additions & 8 deletions plugins/sudoers/pwutil_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@
#include <sudoers.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
* function prefix and using custom getpwnam/getpwuid/getgrnam/getgrgid.
Expand Down

0 comments on commit a3cd820

Please sign in to comment.