mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 05:48:18 +00:00
In sudo_ttyname_scan() if dir is the empty string, set errno to
ENOENT before returning.
This commit is contained in:
parent
0b81e0b195
commit
d989f8af30
@ -180,7 +180,11 @@ sudo_ttyname_scan(const char *dir, dev_t rdev, bool builtin, char *name, size_t
|
||||
DIR *d = NULL;
|
||||
debug_decl(sudo_ttyname_scan, SUDO_DEBUG_UTIL)
|
||||
|
||||
if (dir[0] == '\0' || (d = opendir(dir)) == NULL)
|
||||
if (dir[0] == '\0') {
|
||||
errno = ENOENT;
|
||||
goto done;
|
||||
}
|
||||
if ((d = opendir(dir)) == NULL)
|
||||
goto done;
|
||||
|
||||
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
|
||||
|
Loading…
x
Reference in New Issue
Block a user