From 8f1d9035248ff1007d8472ddec98631f4a4b7627 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 28 Nov 2024 15:48:45 +0100 Subject: [PATCH] vfs: Simplify connect_acl_tdb() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't need talloc for printing a mask with %o Signed-off-by: Volker Lendecke Reviewed-by: Pavel Filipenský --- source3/modules/vfs_acl_tdb.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c index 5ecba7ba757..f2d2692159f 100644 --- a/source3/modules/vfs_acl_tdb.c +++ b/source3/modules/vfs_acl_tdb.c @@ -274,23 +274,20 @@ static int connect_acl_tdb(struct vfs_handle_struct *handle, if (config->ignore_system_acls) { mode_t create_mask = lp_create_mask(SNUM(handle->conn)); - char *create_mask_str = NULL; if ((create_mask & 0666) != 0666) { + char create_mask_str[16]; + create_mask |= 0666; - create_mask_str = talloc_asprintf(handle, "0%o", - create_mask); - if (create_mask_str == NULL) { - DBG_ERR("talloc_asprintf failed\n"); - return -1; - } + snprintf(create_mask_str, + sizeof(create_mask_str), + "0%o", + create_mask); DBG_NOTICE("setting 'create mask = %s'\n", create_mask_str); lp_do_parameter (SNUM(handle->conn), "create mask", create_mask_str); - - TALLOC_FREE(create_mask_str); } DBG_NOTICE("setting 'directory mask = 0777', "