From 27db96411c77b2824450f98908a7359ac59e279a Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Mon, 18 May 2026 17:43:33 +0200 Subject: [PATCH] Pinned source ownership in copy_from acceptance tests After plucked.sub.cf was regenerated from masterfiles, system_owned picks a group by platform class -- on Solaris that is "sys" (gid 3). The destination is created with the agent's effective gid (0), so copy_from with preserve => "true" propagated the source group to the destination and emitted an unexpected "Group of ... was 0, set to 3" log line on Solaris. Define a local agent_owned perms body that sets owner and group from sys.user_data, matching the agent's effective uid/gid. The destination is then created with the same uid/gid as the source, so preserve has no ownership diff to apply and no spurious log lines appear. This mirrors the pre-regeneration behavior of system_owned, which used $(sys.user_data[gid]) for the group. Ticket: ENT-14090 Signed-off-by: Lars Erik Wik --- .../acceptance/28_inform_testing/01_files/copy_from01.cf | 9 ++++++++- .../acceptance/28_inform_testing/01_files/copy_from03.cf | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/28_inform_testing/01_files/copy_from01.cf b/tests/acceptance/28_inform_testing/01_files/copy_from01.cf index 32ee890b36..3b979d7c23 100644 --- a/tests/acceptance/28_inform_testing/01_files/copy_from01.cf +++ b/tests/acceptance/28_inform_testing/01_files/copy_from01.cf @@ -17,11 +17,18 @@ bundle agent setup files: "$(G.testroot)/TEST.source" depth_search => recurse("inf"), - perms => system_owned("0644"), + perms => agent_owned("0644"), copy_from => example("$(this.promise_dirname)/test_files"); } +body perms agent_owned(mode) +{ + mode => "$(mode)"; + owners => { "$(sys.user_data[username])" }; + groups => { "$(sys.user_data[gid])" }; +} + bundle agent main { files: diff --git a/tests/acceptance/28_inform_testing/01_files/copy_from03.cf b/tests/acceptance/28_inform_testing/01_files/copy_from03.cf index 7e7f43035c..e03d8c3479 100644 --- a/tests/acceptance/28_inform_testing/01_files/copy_from03.cf +++ b/tests/acceptance/28_inform_testing/01_files/copy_from03.cf @@ -17,11 +17,18 @@ bundle agent setup files: "$(G.testroot)/TEST.source" depth_search => recurse("inf"), - perms => system_owned("0644"), + perms => agent_owned("0644"), copy_from => example("$(this.promise_dirname)/test_files"); } +body perms agent_owned(mode) +{ + mode => "$(mode)"; + owners => { "$(sys.user_data[username])" }; + groups => { "$(sys.user_data[gid])" }; +} + bundle agent main { files: