File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -191,11 +191,11 @@ struct sudo_defs_types sudo_defs_table[] = {
191191 NULL ,
192192 }, {
193193 "timestamp_timeout" , T_TIMESPEC |T_BOOL ,
194- N_ ("Authentication timestamp timeout: %.1f minutes" ),
194+ N_ ("Authentication timestamp timeout: %d.%d minutes" ),
195195 NULL ,
196196 }, {
197197 "passwd_timeout" , T_TIMESPEC |T_BOOL ,
198- N_ ("Password prompt timeout: %.1f minutes" ),
198+ N_ ("Password prompt timeout: %d.%d minutes" ),
199199 NULL ,
200200 }, {
201201 "passwd_tries" , T_UINT ,
Original file line number Diff line number Diff line change @@ -115,10 +115,10 @@ loglinelen
115115 "Length at which to wrap log file lines (0 for no wrap): %u"
116116timestamp_timeout
117117 T_TIMESPEC|T_BOOL
118- "Authentication timestamp timeout: %.1f minutes"
118+ "Authentication timestamp timeout: %d.%d minutes"
119119passwd_timeout
120120 T_TIMESPEC|T_BOOL
121- "Password prompt timeout: %.1f minutes"
121+ "Password prompt timeout: %d.%d minutes"
122122passwd_tries
123123 T_UINT
124124 "Number of tries to enter a password: %u"
Original file line number Diff line number Diff line change @@ -130,10 +130,12 @@ dump_defaults(void)
130130 sudo_printf (SUDO_CONV_INFO_MSG , "\n" );
131131 break ;
132132 case T_TIMESPEC : {
133- /* display timespec in minutes as a double */
134- double d = (double )cur -> sd_un .tspec .tv_sec +
135- ((double )cur -> sd_un .tspec .tv_nsec / 1000000000.0 );
136- sudo_printf (SUDO_CONV_INFO_MSG , desc , d / 60.0 );
133+ /* display timespec in minutes and 10ths of a minute */
134+ const int min = cur -> sd_un .tspec .tv_sec / 60 ;
135+ int decimin =
136+ (((cur -> sd_un .tspec .tv_sec % 60 ) * 10 ) + 30 ) / 60 ;
137+ decimin += cur -> sd_un .tspec .tv_nsec / 100000000 ;
138+ sudo_printf (SUDO_CONV_INFO_MSG , desc , min , decimin );
137139 sudo_printf (SUDO_CONV_INFO_MSG , "\n" );
138140 break ;
139141 }
You can’t perform that action at this time.
0 commit comments