mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
In sudo_ttyname_scan() if dir is the empty string, set errno to
ENOENT before returning.
This commit is contained in:
@@ -180,7 +180,11 @@ sudo_ttyname_scan(const char *dir, dev_t rdev, bool builtin, char *name, size_t
|
|||||||
DIR *d = NULL;
|
DIR *d = NULL;
|
||||||
debug_decl(sudo_ttyname_scan, SUDO_DEBUG_UTIL)
|
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;
|
goto done;
|
||||||
|
|
||||||
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
|
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
|
||||||
|
Reference in New Issue
Block a user