diff options
Diffstat (limited to 'security/sudo/patches/patch-ad')
-rw-r--r-- | security/sudo/patches/patch-ad | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/security/sudo/patches/patch-ad b/security/sudo/patches/patch-ad new file mode 100644 index 00000000000..30e3d2c3026 --- /dev/null +++ b/security/sudo/patches/patch-ad @@ -0,0 +1,35 @@ +*** tgetpass.c.dist Wed Feb 19 00:09:13 1997 +--- tgetpass.c Wed Feb 19 00:09:21 1997 +*************** +*** 206,223 **** + tv.tv_sec = timeout; + tv.tv_usec = 0; + +- /* how many file descriptors may we have? */ +- #ifdef HAVE_SYSCONF +- n = sysconf(_SC_OPEN_MAX); +- #else +- n = getdtablesize(); +- #endif /* HAVE_SYSCONF */ +- + /* + * get password or return empty string if nothing to read by timeout + */ + buf[0] = '\0'; +! if (select(n, &readfds, 0, 0, &tv) > 0 && fgets(buf, sizeof(buf), input)) { + n = strlen(buf); + if (buf[n - 1] == '\n') + buf[n - 1] = '\0'; +--- 206,216 ---- + tv.tv_sec = timeout; + tv.tv_usec = 0; + + /* + * get password or return empty string if nothing to read by timeout + */ + buf[0] = '\0'; +! if (select(fileno(input)+1, &readfds, 0, 0, &tv) > 0 && fgets(buf, sizeof(buf), input)) { + n = strlen(buf); + if (buf[n - 1] == '\n') + buf[n - 1] = '\0'; + |