Skip to content

Commit

Permalink
Read local users before writing them during autoinstallation
Browse files Browse the repository at this point in the history
* Some package could add a new user during autoinstallation and
  we need to make sure that we don't clobber them.
* As Users module does not have a functionality to 'sync' data,
  we export, read and re-import data.
  • Loading branch information
imobachgs committed Sep 3, 2015
1 parent 6f720d5 commit 849172a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions Rakefile
Expand Up @@ -3,4 +3,5 @@ require "yast/rake"
Yast::Tasks.configuration do |conf|
#lets ignore license check for now
conf.skip_license_check << /.*/
conf.obs_target = "SLE_12"
end
9 changes: 9 additions & 0 deletions src/clients/users_finish.rb
Expand Up @@ -68,6 +68,15 @@ def main

if Mode.autoinst
# Write imported users (during autoupgrade no changes are done)

# During installation, some package could add a new user, so we
# need to read them again before writing.
Users.SetExportAll(true)
saved = Users.Export
Users.ReadLocal
Users.Import(saved)

# Write users
Users.SetWriteOnly(true)
@progress_orig = Progress.set(false)
@ret = Users.Write == ""
Expand Down

0 comments on commit 849172a

Please sign in to comment.