Blame SOURCES/authconfig-6.2.8-services.patch

ee2f06
diff -up authconfig-6.2.8/authconfig-gtk.py.services authconfig-6.2.8/authconfig-gtk.py
ee2f06
--- authconfig-6.2.8/authconfig-gtk.py.services	2014-09-29 15:37:19.000000000 +0200
ee2f06
+++ authconfig-6.2.8/authconfig-gtk.py	2014-09-29 15:41:20.478788789 +0200
ee2f06
@@ -257,7 +257,7 @@ class Authconfig:
ee2f06
 				self.info = backup
ee2f06
 			# Save.
ee2f06
 			if (response == 1):
ee2f06
-				self.apply()
ee2f06
+				self.apply(nostart=True)
ee2f06
 				backup = self.info
ee2f06
 		return backup
ee2f06
 
ee2f06
@@ -266,7 +266,10 @@ class Authconfig:
ee2f06
 		if not backup:
ee2f06
 			return
ee2f06
 		self.winbindjoin_launch(button, map, xml, parent)
ee2f06
-		self.info = backup
ee2f06
+		if self.info != backup:
ee2f06
+			self.info = backup
ee2f06
+		else:
ee2f06
+			self.apply()
ee2f06
 
ee2f06
 	def winbindjoin_launch(self, button, map, xml, parent):
ee2f06
 		if not self.info.joinUser:
ee2f06
@@ -285,7 +288,10 @@ class Authconfig:
ee2f06
 		if not backup:
ee2f06
 			return
ee2f06
 		self.ipav2join_launch(button, map, xml, parent)
ee2f06
-		self.info = backup
ee2f06
+		if self.info != backup:
ee2f06
+			self.info = backup
ee2f06
+		else:
ee2f06
+			self.apply()
ee2f06
 
ee2f06
 	def ipav2join_launch(self, button, map, xml, parent):
ee2f06
 		response = self.run_on_button(None, "joinipadomain",
ee2f06
@@ -772,7 +778,7 @@ class Authconfig:
ee2f06
 		return dialog
ee2f06
 
ee2f06
 	# Save changes.
ee2f06
-	def apply(self):
ee2f06
+	def apply(self, nostart = False):
ee2f06
 		self.update_type(self.id_map, self.currid)
ee2f06
 		self.update_type(self.auth_map, self.currauth)
ee2f06
 		self.apply_idsettings()
ee2f06
@@ -788,7 +794,7 @@ class Authconfig:
ee2f06
 		else:
ee2f06
 			self.info.writeChanged(self.pristineinfo)
ee2f06
 
ee2f06
-		self.info.post(False)
ee2f06
+		self.info.post(nostart)
ee2f06
 		if "--firstboot" in sys.argv:
ee2f06
 			for service in firstbootservices:
ee2f06
 				if authinfo.Service.isEnabled(service):
ee2f06
diff -up authconfig-6.2.8/authinfo.py.services authconfig-6.2.8/authinfo.py
ee2f06
--- authconfig-6.2.8/authinfo.py.services	2014-09-29 15:43:38.000000000 +0200
ee2f06
+++ authconfig-6.2.8/authinfo.py	2014-09-29 15:44:28.629036362 +0200
ee2f06
@@ -4395,15 +4395,15 @@ class AuthInfo:
ee2f06
 			"winbind", nostart)
ee2f06
 
ee2f06
 	def toggleSSSDService(self, nostart):
ee2f06
-		
ee2f06
 		explicitenable = ((self.enableSSSD and self.enableSSSDAuth) or
ee2f06
 			(self.enableSSSD and os.path.exists(PATH_SSSD_CONFIG)) or
ee2f06
 			(self.enableSSSDAuth and os.path.exists(PATH_SSSD_CONFIG)))
ee2f06
-		toggleSplatbindService(self.implicitSSSD or self.implicitSSSDAuth or
ee2f06
-			self.enableIPAv2 or explicitenable,
ee2f06
+		enable = (self.implicitSSSD or self.implicitSSSDAuth or
ee2f06
+			self.enableIPAv2 or explicitenable)
ee2f06
+		toggleSplatbindService(enable,
ee2f06
 			PATH_SSSD,
ee2f06
-			"sssd", nostart or not (self.implicitSSSD or self.implicitSSSDAuth
ee2f06
-			or self.enableIPAv2))
ee2f06
+			"sssd", nostart or (enable and not (self.implicitSSSD or
ee2f06
+			self.implicitSSSDAuth or self.enableIPAv2)))
ee2f06
 
ee2f06
 	def toggleOddjobService(self, nostart):
ee2f06
 		if self.enableMkHomeDir and os.access("%s/pam_%s.so"
ee2f06
diff -up authconfig-6.2.8/man/en/authconfig.8.services authconfig-6.2.8/man/en/authconfig.8
ee2f06
--- authconfig-6.2.8/man/en/authconfig.8.services	2013-11-01 16:08:01.000000000 +0100
ee2f06
+++ authconfig-6.2.8/man/en/authconfig.8	2014-09-29 15:40:31.872691485 +0200
ee2f06
@@ -35,7 +35,7 @@ be restored by the \fB--restorelastbacku
ee2f06
 
ee2f06
 If \fB--nostart\fR is specified (which is what the install program does),
ee2f06
 ypbind or other daemons will not be started or stopped immediately following
ee2f06
-program execution, but only enabled to start or stop at boot time. 
ee2f06
+program execution, but only enabled to start or stop at boot time.
ee2f06
 
ee2f06
 The \fB--enablenis\fP, \fB--enableldap\fP, \fB--enablewinbind\fP,
ee2f06
 and \fB--enablehesiod\fP options
ee2f06
@@ -94,6 +94,22 @@ The \fB/usr/bin/authconfig\fR uses the \
ee2f06
 system user before it starts up. If you want to run it directly without the 
ee2f06
 authentication as the system user, run the \fB/usr/sbin/authconfig\fR command.
ee2f06
 
ee2f06
+The SSSD service is enabled and possibly started by authconfig when at least two of
ee2f06
+the following three conditions are met:
ee2f06
+.br
ee2f06
+1) /etc/sssd/sssd.conf file exists (or is configured via the implicit SSSD support)
ee2f06
+.br
ee2f06
+2) SSSD authentication is enabled (pam_sss.so is used in PAM configuration)
ee2f06
+.br
ee2f06
+3) SSSD is enabled for user identity (nsswitch.conf contains sss)
ee2f06
+
ee2f06
+When \fB--update\fR action is used the enablement or disablement and possible restart
ee2f06
+of services happens only in case the changed configuration options affect the
ee2f06
+service to be restarted. This means that if for example the ypbind service is
ee2f06
+enabled with \fBauthconfig --update --nostart --enablenis\fR but not started
ee2f06
+and you run the same command without the \fB--nostart\fR later the ypbind
ee2f06
+service will not be started because no configuration change affecting ypbind
ee2f06
+happened.
ee2f06
 .PD
ee2f06
 .SH "RETURN CODES"
ee2f06
 \fBauthconfig\fR returns 0 on success, 1 on backup operation errors,