1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

vfs: Simplify connect_acl_tdb()

We don't need talloc for printing a mask with %o

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
This commit is contained in:
Volker Lendecke 2024-11-28 15:48:45 +01:00
parent d088738342
commit 8f1d903524

View File

@ -274,23 +274,20 @@ static int connect_acl_tdb(struct vfs_handle_struct *handle,
if (config->ignore_system_acls) { if (config->ignore_system_acls) {
mode_t create_mask = lp_create_mask(SNUM(handle->conn)); mode_t create_mask = lp_create_mask(SNUM(handle->conn));
char *create_mask_str = NULL;
if ((create_mask & 0666) != 0666) { if ((create_mask & 0666) != 0666) {
char create_mask_str[16];
create_mask |= 0666; create_mask |= 0666;
create_mask_str = talloc_asprintf(handle, "0%o", snprintf(create_mask_str,
create_mask); sizeof(create_mask_str),
if (create_mask_str == NULL) { "0%o",
DBG_ERR("talloc_asprintf failed\n"); create_mask);
return -1;
}
DBG_NOTICE("setting 'create mask = %s'\n", create_mask_str); DBG_NOTICE("setting 'create mask = %s'\n", create_mask_str);
lp_do_parameter (SNUM(handle->conn), lp_do_parameter (SNUM(handle->conn),
"create mask", create_mask_str); "create mask", create_mask_str);
TALLOC_FREE(create_mask_str);
} }
DBG_NOTICE("setting 'directory mask = 0777', " DBG_NOTICE("setting 'directory mask = 0777', "