|
|
7a7bf9 |
diff -Naur old/authinfo.py new/authinfo.py
|
|
|
7a7bf9 |
--- old/authinfo.py 2017-04-28 12:04:32.204470232 +0200
|
|
|
7a7bf9 |
+++ new/authinfo.py 2017-04-28 12:10:10.534170041 +0200
|
|
|
7a7bf9 |
@@ -1432,6 +1432,7 @@
|
|
|
7a7bf9 |
self.sssdConfig = None
|
|
|
7a7bf9 |
self.sssdDomain = None
|
|
|
7a7bf9 |
self.forceSSSDUpdate = None
|
|
|
7a7bf9 |
+ self.sssdConfigPresent = False
|
|
|
7a7bf9 |
if SSSDConfig:
|
|
|
7a7bf9 |
try:
|
|
|
7a7bf9 |
self.sssdConfig = SSSDConfig.SSSDConfig()
|
|
|
7a7bf9 |
@@ -1915,6 +1916,7 @@
|
|
|
7a7bf9 |
self.sssdConfig = SSSDConfig.SSSDConfig()
|
|
|
7a7bf9 |
try:
|
|
|
7a7bf9 |
self.sssdConfig.import_config(all_configs[CFG_SSSD].origPath)
|
|
|
7a7bf9 |
+ self.sssdConfigPresent = True
|
|
|
7a7bf9 |
except (IOError, SSSDConfig.ParsingError):
|
|
|
7a7bf9 |
self.sssdConfig = SSSDConfig.SSSDConfig()
|
|
|
7a7bf9 |
self.sssdConfig.new_config()
|
|
|
7a7bf9 |
@@ -3321,9 +3323,14 @@
|
|
|
7a7bf9 |
domain.remove_provider(subtype)
|
|
|
7a7bf9 |
domain.add_provider(newprovider, subtype)
|
|
|
7a7bf9 |
|
|
|
7a7bf9 |
- def writeSSSDPAM(self):
|
|
|
7a7bf9 |
+ def writeSSSDPAM(self, write_config):
|
|
|
7a7bf9 |
if not self.sssdConfig:
|
|
|
7a7bf9 |
return True
|
|
|
7a7bf9 |
+
|
|
|
7a7bf9 |
+ if not self.sssdConfigPresent and not self.implicitSSSD:
|
|
|
7a7bf9 |
+ # do not write to sssd.conf since the file does not exist yet and
|
|
|
7a7bf9 |
+ # we are not creating the domain ourselves
|
|
|
7a7bf9 |
+ return True
|
|
|
7a7bf9 |
|
|
|
7a7bf9 |
try:
|
|
|
7a7bf9 |
pam = self.sssdConfig.get_service('pam')
|
|
|
7a7bf9 |
@@ -3339,10 +3346,11 @@
|
|
|
7a7bf9 |
pass
|
|
|
7a7bf9 |
|
|
|
7a7bf9 |
self.sssdConfig.save_service(pam)
|
|
|
7a7bf9 |
- try:
|
|
|
7a7bf9 |
- self.sssdConfig.write(all_configs[CFG_SSSD].origPath)
|
|
|
7a7bf9 |
- except IOError:
|
|
|
7a7bf9 |
- pass
|
|
|
7a7bf9 |
+ if write_config:
|
|
|
7a7bf9 |
+ try:
|
|
|
7a7bf9 |
+ self.sssdConfig.write(all_configs[CFG_SSSD].origPath)
|
|
|
7a7bf9 |
+ except IOError:
|
|
|
7a7bf9 |
+ pass
|
|
|
7a7bf9 |
|
|
|
7a7bf9 |
return True
|
|
|
7a7bf9 |
|
|
|
7a7bf9 |
@@ -3352,7 +3360,8 @@
|
|
|
7a7bf9 |
|
|
|
7a7bf9 |
all_configs[CFG_SSSD].backup(self.backupDir)
|
|
|
7a7bf9 |
|
|
|
7a7bf9 |
- self.writeSSSDPAM()
|
|
|
7a7bf9 |
+ # do not write to the file yet since we will write all changes at ones
|
|
|
7a7bf9 |
+ self.writeSSSDPAM(False)
|
|
|
7a7bf9 |
|
|
|
7a7bf9 |
if self.enableIPAv2:
|
|
|
7a7bf9 |
# just save the backup
|
|
|
7a7bf9 |
@@ -4172,7 +4181,7 @@
|
|
|
7a7bf9 |
if self.implicitSSSD or self.implicitSSSDAuth:
|
|
|
7a7bf9 |
ret = ret and self.writeSSSD()
|
|
|
7a7bf9 |
elif self.enableSSSDAuth:
|
|
|
7a7bf9 |
- ret = ret and self.writeSSSDPAM()
|
|
|
7a7bf9 |
+ ret = ret and self.writeSSSDPAM(True)
|
|
|
7a7bf9 |
ret = ret and self.writeNSS()
|
|
|
7a7bf9 |
ret = ret and self.writePAM()
|
|
|
7a7bf9 |
ret = ret and self.writeSysconfig()
|