mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-01-31 03:03:09 +01:00
Ticket refs #4077: Device.Users.User.{i}.Username can be set to Empty value
This commit is contained in:
parent
e87fa6b703
commit
87abe6584e
1 changed files with 5 additions and 0 deletions
|
|
@ -193,11 +193,16 @@ static int set_user_username(char *refparam, struct dmctx *ctx, void *data, char
|
|||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
|
||||
return FAULT_9007;
|
||||
|
||||
// Check if the value is empty
|
||||
if (*value == '\0')
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
// Update dmmap_users file
|
||||
get_dmmap_section_of_config_section("dmmap_users", "user", section_name((struct uci_section *)data), &dmmap_section);
|
||||
dmuci_set_value_by_section(dmmap_section, "section_name", value);
|
||||
|
||||
// Update users config
|
||||
dmuci_rename_section_by_section((struct uci_section *)data, value);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue