Bugfix: api: Show config page as readonly if admin password isn't set

This commit is contained in:
Luke Dashjr 2025-03-11 20:18:36 +00:00
parent 999d7670c2
commit 4f0ff9380f
No known key found for this signature in database
GPG Key ID: A291A2C45D0C504A

View File

@ -939,7 +939,7 @@ size_t datum_api_fill_config_var(const char *var_start, const size_t var_name_le
const char * const underscore_pos = memchr(var_start_2, '_', var_name_len_2); const char * const underscore_pos = memchr(var_start_2, '_', var_name_len_2);
int val; int val;
if (var_name_len_2 == 3 && 0 == strncmp(var_start_2, "*ro", 3)) { if (var_name_len_2 == 3 && 0 == strncmp(var_start_2, "*ro", 3)) {
val = !datum_config.api_modify_conf; val = !(datum_config.api_modify_conf && datum_config.api_admin_password_len);
if (!colon_pos) { if (!colon_pos) {
var_start = "readonly:"; var_start = "readonly:";
colon_pos = &var_start[8]; colon_pos = &var_start[8];