From 45962d416f41fd88a2e35be7d3225dc0a3b298a9 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Fri, 19 Jan 2024 16:20:36 +0530 Subject: [PATCH] source3/lib: Properly log the change in capability We used to log the following message for both adding and dropping capability: DBG_INFO("added capability %d\n", capability); For better clarity indicate the change as "added" or "dropped" based on available functional arguments. Signed-off-by: Anoop C S Reviewed-by: Christof Schmitt Autobuild-User(master): Anoop C S Autobuild-Date(master): Sat Jan 20 18:43:10 UTC 2024 on atb-devel-224 --- source3/lib/system.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source3/lib/system.c b/source3/lib/system.c index 18dc6989372..1ec0ae9b1d5 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -628,12 +628,14 @@ static bool set_process_capability(enum smbd_capability capability, cap_set_flag(cap, CAP_INHERITABLE, num_cap_vals, cap_vals, CAP_CLEAR); if (cap_set_proc(cap) == -1) { - DBG_ERR("adding capability %d: cap_set_proc failed: %s\n", + DBG_ERR("%s capability %d: cap_set_proc failed: %s\n", + enable ? "adding" : "dropping", capability, strerror(errno)); cap_free(cap); return False; } - DBG_INFO("added capability %d\n", capability); + DBG_INFO("%s capability %d\n", + enable ? "added" : "dropped", capability); cap_free(cap); return True; -- 2.11.4.GIT