After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 734293 - automatically pick up parent directories for modified config files when new tree drops them
automatically pick up parent directories for modified config files when new t...
Status: RESOLVED FIXED
Product: ostree
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: OSTree maintainer(s)
OSTree maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-08-05 14:28 UTC by Colin Walters
Modified: 2014-09-16 16:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
deploy: Copy parent directories for modified config files (13.87 KB, patch)
2014-09-16 13:07 UTC, Colin Walters
committed Details | Review

Description Colin Walters 2014-08-05 14:28:37 UTC
The current /etc merge logic carries modified files, but we error out if the new tree drops a directory that was there.

For example, dropping firewalld out of the Fedora Atomic, it creates a file /etc/firewalld/public.xml automatically, and we refuse to upgrade.

I can't think of a harm from just picking up the parent directories automatically.

The only downside is this will carry cruft forwards, but at least with ostree you can always "config-diff" and discover what's cruft.
Comment 1 Colin Walters 2014-09-16 13:07:56 UTC
Created attachment 286293 [details] [review]
deploy: Copy parent directories for modified config files

Previously, in the case where a parent directory of a modified config
file was removed, we would throw an exception.  While it's nice to
have this notice that your config file probably no longer applies,
there's no need to make it so...fatal.

We can just take ownership of the parent directories too.

Admins can clean up these files afterwards at any time.
Comment 2 James Antill 2014-09-16 15:13:39 UTC
 Has test cases, so I assume it fixes the problem. ACK :)

 Personally I would have tried to do the xopendirat()/etc changes as a separate simple cleanup patch, as it's really confusing what code is moving here, is being deleted and what is new.

 From what I can tell the main part is that ensure_directory_from_template does a g_mkdir_with_parents type operation for the directory that is being removed? And then the file with all the attributes is copied in?
Comment 3 Colin Walters 2014-09-16 15:40:30 UTC
Split up a helper for the first.  For the second question - it's like g_mkdir_with_parents(), except we want to copy over the attributes of the source.

We have two directory chains:

/etc/foo/bar/baz/blah
/etc/foo

And we're walking up from baz to bar to foo, finding it exists, and the copying the directory hierarchy.  (e.g. if bar is mode 0755 and baz is 0700, or owned by non-root uids, we reproduce that)
Comment 4 Colin Walters 2014-09-16 16:08:39 UTC
Attachment 286293 [details] pushed as 8f4ffa6 - deploy: Copy parent directories for modified config files