2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 13:58:05 +00:00

In sudo_ttyname_scan() if dir is the empty string, set errno to

ENOENT before returning.
This commit is contained in:
Todd C. Miller
2017-04-12 17:06:48 -06:00
parent 0b81e0b195
commit d989f8af30

View File

@@ -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,