From abcd60fc8e5704a8d818f56b2d4371a1bf5c6266 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Tue, 13 Feb 2024 17:49:34 +0100 Subject: [PATCH] Ignore %config flag where not supported %config is only allowed for regular files and links. While rpmbuild won't produce package with other files with %config other tools might. Handle these cases gracefully by ignoring the %config flag. Resolves: #2890 --- lib/rpmfi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 011d6787ef..f4fa04922b 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -1170,11 +1170,10 @@ int rpmfilesConfigConflict(rpmfiles fi, int ix) if (!(flags & RPMFILE_CONFIG)) return 0; - /* Only links and regular files can be %config, this is kinda moot */ - /* XXX: Why are we returning 1 here? */ + /* Only links and regular files can be %config */ newWhat = rpmfiWhatis(rpmfilesFMode(fi, ix)); if (newWhat != LINK && newWhat != REG) - return 1; + return 0; /* If it's not on disk, there's nothing to be saved */ fn = rpmfilesFN(fi, ix);