Skip to content

Commit

Permalink
compose: Fix lookup of previous /etc/passwd
Browse files Browse the repository at this point in the history
I swear I tested this, but anyways
coreos#79
wasn't quite right.  We need to look at /usr/etc/{passwd,group}
for previous data.

We happily noticed there was no /etc/passwd in the tree, then
proceeded to do the merge and split again, with the result
of an empty /usr/etc/passwd in the new tree.

That in turn resulted in an empty /etc/passwd in an installed system,
i.e. with no "root" user, with obvious bad consequences, namely in my
case crashing Anaconda.

(Yes, I will write a testsuite for this)
  • Loading branch information
cgwalters committed Jan 7, 2015
1 parent 8e7c759 commit 5345c85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rpmostree-passwd-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,11 @@ concat_passwd_file (GFile *yumroot,
{
gboolean ret = FALSE;
gs_free char *etc_subpath = g_strconcat ("etc/", filename, NULL);
gs_free char *usretc_subpath = g_strconcat ("usr/etc/", filename, NULL);
gs_free char *usrlib_subpath = g_strconcat ("usr/lib/", filename, NULL);
gs_unref_object GFile *yumroot_etc = g_file_resolve_relative_path (yumroot, "etc");
gs_unref_object GFile *yumroot_dest = g_file_resolve_relative_path (yumroot, etc_subpath);
gs_unref_object GFile *orig_etc_content = g_file_resolve_relative_path (previous_commit, etc_subpath);
gs_unref_object GFile *orig_etc_content = g_file_resolve_relative_path (previous_commit, usretc_subpath);
gs_unref_object GFile *orig_usrlib_content = g_file_resolve_relative_path (previous_commit, usrlib_subpath);
gs_unref_object GFileOutputStream *out = NULL;
gboolean have_etc, have_usr;
Expand Down

0 comments on commit 5345c85

Please sign in to comment.