Use POSIX NAME_MAX, not the obsolete MAXNAMLEN define.

Fixes compilation with musl libc.
This commit is contained in:
Todd C. Miller
2022-01-12 10:25:44 -07:00
parent 757c3a1d37
commit 1f098a2029
2 changed files with 3 additions and 2 deletions

View File

@@ -36,6 +36,7 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include "sudo_compat.h"
#include "sudo_fatal.h"
@@ -106,7 +107,7 @@ sudo_mkdir_parents_v1(const char *path, uid_t uid, gid_t gid, mode_t mode, bool
for (cp = sudo_strsplit(cp, pathend, "/", &ep); cp != NULL && ep != NULL;
cp = sudo_strsplit(NULL, pathend, "/", &ep)) {
char name[MAXNAMLEN + 1];
char name[NAME_MAX + 1];
int dfd, len;
sudo_debug_printf(SUDO_DEBUG_DEBUG|SUDO_DEBUG_LINENO,