def_timestamp_timeout is a double so compare against 0.0 not 0 to

avoid making it appear to be an integer type.
This commit is contained in:
Todd C. Miller
2016-10-26 10:56:32 -06:00
parent e3825cbedd
commit cf5a12c09a

View File

@@ -388,7 +388,7 @@ timestamp_open(const char *user, pid_t sid)
debug_decl(timestamp_open, SUDOERS_DEBUG_AUTH) debug_decl(timestamp_open, SUDOERS_DEBUG_AUTH)
/* Zero timeout means don't use the time stamp file. */ /* Zero timeout means don't use the time stamp file. */
if (def_timestamp_timeout == 0) { if (def_timestamp_timeout == 0.0) {
errno = ENOENT; errno = ENOENT;
goto bad; goto bad;
} }
@@ -705,7 +705,7 @@ timestamp_status(void *vcookie, struct passwd *pw)
debug_decl(timestamp_status, SUDOERS_DEBUG_AUTH) debug_decl(timestamp_status, SUDOERS_DEBUG_AUTH)
/* Zero timeout means don't use time stamp files. */ /* Zero timeout means don't use time stamp files. */
if (def_timestamp_timeout == 0) { if (def_timestamp_timeout == 0.0) {
sudo_debug_printf(SUDO_DEBUG_DEBUG|SUDO_DEBUG_LINENO, sudo_debug_printf(SUDO_DEBUG_DEBUG|SUDO_DEBUG_LINENO,
"timestamps disabled"); "timestamps disabled");
status = TS_OLD; status = TS_OLD;
@@ -808,7 +808,7 @@ timestamp_update(void *vcookie, struct passwd *pw)
debug_decl(timestamp_update, SUDOERS_DEBUG_AUTH) debug_decl(timestamp_update, SUDOERS_DEBUG_AUTH)
/* Zero timeout means don't use time stamp files. */ /* Zero timeout means don't use time stamp files. */
if (def_timestamp_timeout == 0) { if (def_timestamp_timeout == 0.0) {
sudo_debug_printf(SUDO_DEBUG_DEBUG|SUDO_DEBUG_LINENO, sudo_debug_printf(SUDO_DEBUG_DEBUG|SUDO_DEBUG_LINENO,
"timestamps disabled"); "timestamps disabled");
goto done; goto done;