From b283c8084c553685a9cdb6efc381304cd6037d83 Mon Sep 17 00:00:00 2001 From: TapTap Date: Tue, 8 Sep 2026 18:37:07 +0200 Subject: [PATCH] identity: keep --numeric-ids in the activate set (-M --numeric-ids) identity_active_enabled() only gates identity_apply_ownership, which runs only when metadata is present, so --numeric-ids must stay in the set: combined with -M it activates raw-id application, while a standalone --numeric-ids (no ownership-affecting flag) carries no metadata and correctly stays inert. My earlier review fix removed it and broke 'owner not applied' for -M --numeric-ids (uid 0 instead of the source ids). Revert that removal. --- src/shared/identity.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/shared/identity.c b/src/shared/identity.c index db412a4..c0237d5 100644 --- a/src/shared/identity.c +++ b/src/shared/identity.c @@ -88,12 +88,13 @@ void identity_set_active(const Config* config) { } bool identity_active_enabled(void) { - /* --numeric-ids alone is a policy modifier (how ids are resolved WHERE - ownership is otherwise preserved), not itself an ownership-application - trigger, so it is deliberately excluded from this set: standalone it stays - inert, matching its siblings only when combined with -M/--preserve. */ + /* numeric_ids is included: this set only gates identity_apply_ownership, + which runs only when metadata is present (a -M/--preserve transfer). A + standalone --numeric-ids (no ownership-affecting flag) carries no + metadata, never reaches identity_apply_ownership, and therefore correctly + stays inert; combined with -M it activates raw-id application. */ return g_identity.set && - (g_identity.chown_uid_set || g_identity.chown_gid_set || + (g_identity.numeric_ids || g_identity.chown_uid_set || g_identity.chown_gid_set || g_identity.usermap_count > 0 || g_identity.groupmap_count > 0); }