]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbstatus: avoid a crash with --json output if the access_mask has SEC_STD_WRITE_OWNER
authorRalph Boehme <slow@samba.org>
Wed, 16 Jul 2025 14:50:25 +0000 (16:50 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 10 Oct 2025 15:59:35 +0000 (15:59 +0000)
This was missing in access_mask[] triggering an assert when printing the access
mask string:

 ...
 #4  0x00007ffff79553cc in smb_panic (why=0x207b5c "assert failed: tomap == 0") at ../../lib/util/fault.c:209
 #5  0x000000000021ea2c in map_mask_to_json (root_json=0x7fffffffcd60, tomap=524288, table=0x223440 <access_mask>) at ../../source3/utils/status_json.c:142
 ...

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/utils/status_json.c

index ad25ed5d91b1e193ddff50c07687a86ceb80eb11..fba0f40508f7c0331c9bf7590a4c0586c8cfdffd 100644 (file)
@@ -157,6 +157,7 @@ static const struct mask2txt access_mask[] = {
        {SEC_STD_DELETE, "DELETE"},
        {SEC_STD_READ_CONTROL, "READ_CONTROL"},
        {SEC_STD_WRITE_DAC, "WRITE_DAC"},
+       {SEC_STD_WRITE_OWNER, "WRITE_OWNER"},
        {SEC_STD_SYNCHRONIZE, "SYNCHRONIZE"},
        {SEC_FLAG_SYSTEM_SECURITY, "ACCESS_SYSTEM_SECURITY"},
        {0, NULL}