xbps icon indicating copy to clipboard operation
xbps copied to clipboard

Updating a package with a newly added conf_files should not overwrite the exisiting not yet tracked file.

Open Johnnynator opened this issue 5 years ago • 4 comments

Right now xbps will overwrite any file that isn't yet tracked by a(the?) package, if already existing untracked conf files exists, they shouldn't be overwritten, but just written to a .new-version like it is the case for tracked conf_files.

E.g. https://github.com/void-linux/void-packages/pull/25923 could have been solved without patching, but by just adding a default config.

Johnnynator avatar Nov 01 '20 21:11 Johnnynator

Is this reproducible? There is a test mandating that conf_files don't overwrite existing file since 2014.

https://github.com/void-linux/xbps/blob/4a5eb8dc87cf08ad919ec6602ef5a70e8514710c/tests/xbps/libxbps/shell/conf_files_test.sh#L133-L134

Chocimier avatar Sep 01 '21 16:09 Chocimier

I imagine the reproduction is of a conf_file for a package not currently installed...

Vaelatern avatar Sep 01 '21 22:09 Vaelatern

Ok found it, it is about update from version where file wasn't conf (or not in package) to version where it is conf, and file exist on disk for any reason.

Chocimier avatar Sep 02 '21 20:09 Chocimier

I think it would make sense to avoid adding new conf_files entries to packages until this is resolved, to not break anything for the users?

The breakage might also go undetected, and even be a security problem, if something like the sshd config or firewall config would be replaced with a default config (unlikely but possible right now).

camoz avatar Dec 26 '21 00:12 camoz