mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 22:05:46 +00:00
When exporting sudoers in JSON format, use the same type of Options
object for both Defaults and Cmnd_Specs.
This commit is contained in:
3
NEWS
3
NEWS
@@ -43,6 +43,9 @@ What's new in Sudo 1.8.10?
|
|||||||
directory at boot time on AIX and HP-UX systems. These systems
|
directory at boot time on AIX and HP-UX systems. These systems
|
||||||
either lack /var/run or do not clear it on boot.
|
either lack /var/run or do not clear it on boot.
|
||||||
|
|
||||||
|
* The JSON format used by "visudo -x" now uses the same type of
|
||||||
|
Options object for both Defaults and Cmnd_Specs.
|
||||||
|
|
||||||
What's new in Sudo 1.8.9p5?
|
What's new in Sudo 1.8.9p5?
|
||||||
|
|
||||||
* Fixed a compilation error on AIX when LDAP support is enabled.
|
* Fixed a compilation error on AIX when LDAP support is enabled.
|
||||||
|
@@ -779,7 +779,7 @@ print_cmndspec_json(FILE *fp, struct cmndspec *cs, struct cmndspec **nextp,
|
|||||||
if (cs->tags.nopasswd != UNSPEC || cs->tags.noexec != UNSPEC ||
|
if (cs->tags.nopasswd != UNSPEC || cs->tags.noexec != UNSPEC ||
|
||||||
cs->tags.setenv != UNSPEC || cs->tags.log_input != UNSPEC ||
|
cs->tags.setenv != UNSPEC || cs->tags.log_input != UNSPEC ||
|
||||||
cs->tags.log_output != UNSPEC) {
|
cs->tags.log_output != UNSPEC) {
|
||||||
fprintf(fp, "%*s\"Options\": {\n", indent, "");
|
fprintf(fp, "%*s\"Options\": [\n", indent, "");
|
||||||
indent += 4;
|
indent += 4;
|
||||||
if (cs->tags.nopasswd != UNSPEC) {
|
if (cs->tags.nopasswd != UNSPEC) {
|
||||||
value.type = JSON_BOOL;
|
value.type = JSON_BOOL;
|
||||||
@@ -787,39 +787,39 @@ print_cmndspec_json(FILE *fp, struct cmndspec *cs, struct cmndspec **nextp,
|
|||||||
last_one = cs->tags.noexec == UNSPEC &&
|
last_one = cs->tags.noexec == UNSPEC &&
|
||||||
cs->tags.setenv == UNSPEC && cs->tags.log_input == UNSPEC &&
|
cs->tags.setenv == UNSPEC && cs->tags.log_input == UNSPEC &&
|
||||||
cs->tags.log_output == UNSPEC;
|
cs->tags.log_output == UNSPEC;
|
||||||
print_pair_json(fp, NULL, "authenticate", &value,
|
print_pair_json(fp, "{ ", "authenticate", &value,
|
||||||
last_one ? "\n" : ",\n", indent);
|
last_one ? " }\n" : " },\n", indent);
|
||||||
}
|
}
|
||||||
if (cs->tags.noexec != UNSPEC) {
|
if (cs->tags.noexec != UNSPEC) {
|
||||||
value.type = JSON_BOOL;
|
value.type = JSON_BOOL;
|
||||||
value.u.boolean = cs->tags.noexec;
|
value.u.boolean = cs->tags.noexec;
|
||||||
last_one = cs->tags.setenv == UNSPEC &&
|
last_one = cs->tags.setenv == UNSPEC &&
|
||||||
cs->tags.log_input == UNSPEC && cs->tags.log_output == UNSPEC;
|
cs->tags.log_input == UNSPEC && cs->tags.log_output == UNSPEC;
|
||||||
print_pair_json(fp, NULL, "noexec", &value,
|
print_pair_json(fp, "{ ", "noexec", &value,
|
||||||
last_one ? "\n" : ",\n", indent);
|
last_one ? " }\n" : " },\n", indent);
|
||||||
}
|
}
|
||||||
if (cs->tags.setenv != UNSPEC) {
|
if (cs->tags.setenv != UNSPEC) {
|
||||||
value.type = JSON_BOOL;
|
value.type = JSON_BOOL;
|
||||||
value.u.boolean = cs->tags.setenv;
|
value.u.boolean = cs->tags.setenv;
|
||||||
last_one = cs->tags.log_input == UNSPEC &&
|
last_one = cs->tags.log_input == UNSPEC &&
|
||||||
cs->tags.log_output == UNSPEC;
|
cs->tags.log_output == UNSPEC;
|
||||||
print_pair_json(fp, NULL, "setenv", &value,
|
print_pair_json(fp, "{ ", "setenv", &value,
|
||||||
last_one ? "\n" : ",\n", indent);
|
last_one ? " }\n" : " },\n", indent);
|
||||||
}
|
}
|
||||||
if (cs->tags.log_input != UNSPEC) {
|
if (cs->tags.log_input != UNSPEC) {
|
||||||
value.type = JSON_BOOL;
|
value.type = JSON_BOOL;
|
||||||
value.u.boolean = cs->tags.log_input;
|
value.u.boolean = cs->tags.log_input;
|
||||||
last_one = cs->tags.log_output == UNSPEC;
|
last_one = cs->tags.log_output == UNSPEC;
|
||||||
print_pair_json(fp, NULL, "log_input", &value,
|
print_pair_json(fp, "{ ", "log_input", &value,
|
||||||
last_one ? "\n" : ",\n", indent);
|
last_one ? " }\n" : " },\n", indent);
|
||||||
}
|
}
|
||||||
if (cs->tags.log_output != UNSPEC) {
|
if (cs->tags.log_output != UNSPEC) {
|
||||||
value.type = JSON_BOOL;
|
value.type = JSON_BOOL;
|
||||||
value.u.boolean = cs->tags.log_output;
|
value.u.boolean = cs->tags.log_output;
|
||||||
print_pair_json(fp, NULL, "log_output", &value, "\n", indent);
|
print_pair_json(fp, "{ ", "log_output", &value, " }\n", indent);
|
||||||
}
|
}
|
||||||
indent -= 4;
|
indent -= 4;
|
||||||
fprintf(fp, "%*s},\n", indent, "");
|
fprintf(fp, "%*s],\n", indent, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SELINUX
|
#ifdef HAVE_SELINUX
|
||||||
|
Reference in New Issue
Block a user