2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Now that we have proper number parsing functions we should store

T_UINT defaults values as unsigned int, not int.
This commit is contained in:
Todd C. Miller
2013-12-11 14:43:04 -07:00
parent 3e4f5c5848
commit ef2cff1d33
9 changed files with 27 additions and 23 deletions

View File

@@ -148,11 +148,14 @@ dump_defaults(void)
sudo_printf(SUDO_CONV_INFO_MSG, "\n");
}
break;
case T_UINT:
case T_INT:
sudo_printf(SUDO_CONV_INFO_MSG, desc, cur->sd_un.ival);
sudo_printf(SUDO_CONV_INFO_MSG, "\n");
break;
case T_UINT:
sudo_printf(SUDO_CONV_INFO_MSG, desc, cur->sd_un.uival);
sudo_printf(SUDO_CONV_INFO_MSG, "\n");
break;
case T_FLOAT:
sudo_printf(SUDO_CONV_INFO_MSG, desc, cur->sd_un.fval);
sudo_printf(SUDO_CONV_INFO_MSG, "\n");
@@ -628,7 +631,7 @@ store_uint(char *val, struct sudo_defs_types *def, int op)
debug_decl(store_uint, SUDO_DEBUG_DEFAULTS)
if (op == false) {
def->sd_un.ival = 0;
def->sd_un.uival = 0;
} else {
u = strtonum(val, 0, UINT_MAX, &errstr);
if (errstr != NULL) {
@@ -636,8 +639,7 @@ store_uint(char *val, struct sudo_defs_types *def, int op)
"%s: %s", val, errstr);
debug_return_bool(false);
}
/* XXX - should have uival */
def->sd_un.ival = u;
def->sd_un.uival = u;
}
if (def->callback)
debug_return_bool(def->callback(val));