Blame SOURCES/0904-rhel9-remove-nis-support.patch

eed6a9
From fde1c60f1e87383596ee7060f4d748675b2efae9 Mon Sep 17 00:00:00 2001
eed6a9
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
eed6a9
Date: Wed, 9 Jun 2021 13:59:01 +0200
eed6a9
Subject: [PATCH 4/4] rhel9: remove nis support
eed6a9
eed6a9
NIS is no longer supported in RHEL9.
eed6a9
---
eed6a9
 profiles/Makefile.am                | 14 -----
eed6a9
 profiles/nis/dconf-db               |  3 -
eed6a9
 profiles/nis/dconf-locks            |  2 -
eed6a9
 profiles/nis/nsswitch.conf          | 14 -----
eed6a9
 profiles/nis/postlogin              |  4 --
eed6a9
 rpm/authselect.spec.in              | 11 ----
eed6a9
 src/compat/authcompat.py.in.in      | 95 -----------------------------
eed6a9
 src/compat/authcompat_Options.py    |  8 ++-
eed6a9
 src/man/authselect-migration.7.adoc |  2 +-
eed6a9
 9 files changed, 6 insertions(+), 147 deletions(-)
eed6a9
 delete mode 100644 profiles/nis/dconf-db
eed6a9
 delete mode 100644 profiles/nis/dconf-locks
eed6a9
 delete mode 100644 profiles/nis/nsswitch.conf
eed6a9
 delete mode 100644 profiles/nis/postlogin
eed6a9
eed6a9
diff --git a/profiles/Makefile.am b/profiles/Makefile.am
eed6a9
index 7191b2604ca2c9ebaba3a4f1beb950e7d0e03970..4ab613f42a581df02c427636a0070092b58ec418 100644
eed6a9
--- a/profiles/Makefile.am
eed6a9
+++ b/profiles/Makefile.am
eed6a9
@@ -15,20 +15,6 @@ dist_profile_minimal_DATA = \
eed6a9
     $(top_srcdir)/profiles/minimal/dconf-locks \
eed6a9
     $(NULL)
eed6a9
 
eed6a9
-profile_nisdir = $(authselect_profile_dir)/nis
eed6a9
-dist_profile_nis_DATA = \
eed6a9
-    $(top_srcdir)/profiles/nis/nsswitch.conf \
eed6a9
-    $(top_srcdir)/profiles/nis/password-auth \
eed6a9
-    $(top_srcdir)/profiles/nis/postlogin \
eed6a9
-    $(top_srcdir)/profiles/nis/README \
eed6a9
-    $(top_srcdir)/profiles/nis/REQUIREMENTS \
eed6a9
-    $(top_srcdir)/profiles/nis/smartcard-auth \
eed6a9
-    $(top_srcdir)/profiles/nis/system-auth \
eed6a9
-    $(top_srcdir)/profiles/nis/fingerprint-auth \
eed6a9
-    $(top_srcdir)/profiles/nis/dconf-db \
eed6a9
-    $(top_srcdir)/profiles/nis/dconf-locks \
eed6a9
-    $(NULL)
eed6a9
-
eed6a9
 profile_sssddir = $(authselect_profile_dir)/sssd
eed6a9
 dist_profile_sssd_DATA = \
eed6a9
     $(top_srcdir)/profiles/sssd/nsswitch.conf \
eed6a9
diff --git a/profiles/nis/dconf-db b/profiles/nis/dconf-db
eed6a9
deleted file mode 100644
eed6a9
index bd32b2819f66acdc75ab0fc522ec85673d10ed72..0000000000000000000000000000000000000000
eed6a9
--- a/profiles/nis/dconf-db
eed6a9
+++ /dev/null
eed6a9
@@ -1,3 +0,0 @@
eed6a9
-[org/gnome/login-screen]
eed6a9
-enable-smartcard-authentication=false
eed6a9
-enable-fingerprint-authentication={if "with-fingerprint":true|false}
eed6a9
diff --git a/profiles/nis/dconf-locks b/profiles/nis/dconf-locks
eed6a9
deleted file mode 100644
eed6a9
index 8a36fa9568344338272786394aece872185d0ab3..0000000000000000000000000000000000000000
eed6a9
--- a/profiles/nis/dconf-locks
eed6a9
+++ /dev/null
eed6a9
@@ -1,2 +0,0 @@
eed6a9
-/org/gnome/login-screen/enable-smartcard-authentication
eed6a9
-/org/gnome/login-screen/enable-fingerprint-authentication
eed6a9
diff --git a/profiles/nis/nsswitch.conf b/profiles/nis/nsswitch.conf
eed6a9
deleted file mode 100644
eed6a9
index 9bee7d839f84ff39d54cb6ead9dea38e51736b4d..0000000000000000000000000000000000000000
eed6a9
--- a/profiles/nis/nsswitch.conf
eed6a9
+++ /dev/null
eed6a9
@@ -1,14 +0,0 @@
eed6a9
-aliases:    files nis                   {exclude if "with-custom-aliases"}
eed6a9
-automount:  files nis                   {exclude if "with-custom-automount"}
eed6a9
-ethers:     files nis                   {exclude if "with-custom-ethers"}
eed6a9
-group:      files nis systemd           {exclude if "with-custom-group"}
eed6a9
-hosts:      files nis dns myhostname    {exclude if "with-custom-hosts"}
eed6a9
-initgroups: files nis                   {exclude if "with-custom-initgroups"}
eed6a9
-netgroup:   files nis                   {exclude if "with-custom-netgroup"}
eed6a9
-networks:   files nis                   {exclude if "with-custom-networks"}
eed6a9
-passwd:     files nis systemd           {exclude if "with-custom-passwd"}
eed6a9
-protocols:  files nis                   {exclude if "with-custom-protocols"}
eed6a9
-publickey:  files nis                   {exclude if "with-custom-publickey"}
eed6a9
-rpc:        files nis                   {exclude if "with-custom-rpc"}
eed6a9
-services:   files nis                   {exclude if "with-custom-services"}
eed6a9
-shadow:     files nis                   {exclude if "with-custom-shadow"}
eed6a9
diff --git a/profiles/nis/postlogin b/profiles/nis/postlogin
eed6a9
deleted file mode 100644
eed6a9
index 04a11f049bc1e220c9064fba7b46eb243ddd4996..0000000000000000000000000000000000000000
eed6a9
--- a/profiles/nis/postlogin
eed6a9
+++ /dev/null
eed6a9
@@ -1,4 +0,0 @@
eed6a9
-session     optional                   pam_umask.so silent
eed6a9
-session     [success=1 default=ignore] pam_succeed_if.so service !~ gdm* service !~ su* quiet
eed6a9
-session     [default=1]                pam_lastlog.so nowtmp {if "with-silent-lastlog":silent|showfailed}
eed6a9
-session     optional                   pam_lastlog.so silent noupdate showfailed
eed6a9
diff --git a/rpm/authselect.spec.in b/rpm/authselect.spec.in
eed6a9
index f8539d5a028da1a7184b47609a8efdb5ce0be14e..95da183a41a29f7913a0a255a94070908ed9a66c 100644
eed6a9
--- a/rpm/authselect.spec.in
eed6a9
+++ b/rpm/authselect.spec.in
eed6a9
@@ -165,7 +165,6 @@ find $RPM_BUILD_ROOT -name "*.a" -exec %__rm -f {} \;
eed6a9
 %dir %{_datadir}/authselect/vendor
eed6a9
 %dir %{_datadir}/authselect/default
eed6a9
 %dir %{_datadir}/authselect/default/minimal/
eed6a9
-%dir %{_datadir}/authselect/default/nis/
eed6a9
 %dir %{_datadir}/authselect/default/sssd/
eed6a9
 %dir %{_datadir}/authselect/default/winbind/
eed6a9
 %{_datadir}/authselect/default/minimal/dconf-db
eed6a9
@@ -178,16 +177,6 @@ find $RPM_BUILD_ROOT -name "*.a" -exec %__rm -f {} \;
eed6a9
 %{_datadir}/authselect/default/minimal/REQUIREMENTS
eed6a9
 %{_datadir}/authselect/default/minimal/smartcard-auth
eed6a9
 %{_datadir}/authselect/default/minimal/system-auth
eed6a9
-%{_datadir}/authselect/default/nis/dconf-db
eed6a9
-%{_datadir}/authselect/default/nis/dconf-locks
eed6a9
-%{_datadir}/authselect/default/nis/fingerprint-auth
eed6a9
-%{_datadir}/authselect/default/nis/nsswitch.conf
eed6a9
-%{_datadir}/authselect/default/nis/password-auth
eed6a9
-%{_datadir}/authselect/default/nis/postlogin
eed6a9
-%{_datadir}/authselect/default/nis/README
eed6a9
-%{_datadir}/authselect/default/nis/REQUIREMENTS
eed6a9
-%{_datadir}/authselect/default/nis/smartcard-auth
eed6a9
-%{_datadir}/authselect/default/nis/system-auth
eed6a9
 %{_datadir}/authselect/default/sssd/dconf-db
eed6a9
 %{_datadir}/authselect/default/sssd/dconf-locks
eed6a9
 %{_datadir}/authselect/default/sssd/fingerprint-auth
eed6a9
diff --git a/src/compat/authcompat.py.in.in b/src/compat/authcompat.py.in.in
eed6a9
index 55e205bae2c0b1f7892f8b286c288dfeaa26a60d..c6d1f2786c233f7ebdbfe5f2503aa0016012aee0 100755
eed6a9
--- a/src/compat/authcompat.py.in.in
eed6a9
+++ b/src/compat/authcompat.py.in.in
eed6a9
@@ -243,20 +243,6 @@ class Configuration:
eed6a9
 
eed6a9
             config.write(keys)
eed6a9
 
eed6a9
-    class Network(Base):
eed6a9
-        def __init__(self, options):
eed6a9
-            super(Configuration.Network, self).__init__(options)
eed6a9
-
eed6a9
-        def write(self):
eed6a9
-            nisdomain = self.get("nisdomain")
eed6a9
-            config = EnvironmentFile(Path.System('network'))
eed6a9
-
eed6a9
-            if nisdomain is None:
eed6a9
-                return
eed6a9
-
eed6a9
-            config.set("NISDOMAIN", nisdomain)
eed6a9
-            config.write()
eed6a9
-
eed6a9
     class SSSD(Base):
eed6a9
         def __init__(self, options):
eed6a9
             super(Configuration.SSSD, self).__init__(options, ServiceName="sssd")
eed6a9
@@ -378,83 +364,6 @@ class Configuration:
eed6a9
             # other applications may depend on it.
eed6a9
             return
eed6a9
 
eed6a9
-    class NIS(Base):
eed6a9
-        def __init__(self, options):
eed6a9
-            super(Configuration.NIS, self).__init__(options)
eed6a9
-            self.rpcbind = Service("rpcbind")
eed6a9
-            self.ypbind = Service("ypbind")
eed6a9
-
eed6a9
-        def isEnabled(self):
eed6a9
-            if not self.isset("nis"):
eed6a9
-                return None
eed6a9
-
eed6a9
-            return self.getBool("nis")
eed6a9
-
eed6a9
-        def enableService(self, nostart):
eed6a9
-            if not self.isset("nisdomain"):
eed6a9
-                return
eed6a9
-
eed6a9
-            nisdom = self.get("nisdomain")
eed6a9
-
eed6a9
-            if not nostart:
eed6a9
-                cmd = Command(Path.System('cmd-domainname'), [nisdom])
eed6a9
-                cmd.run()
eed6a9
-
eed6a9
-            cmd = Command(Path.System('cmd-setsebool'),
eed6a9
-                          ['-P', 'allow_ypbind', '1'])
eed6a9
-            cmd.run()
eed6a9
-
eed6a9
-            self.rpcbind.enable()
eed6a9
-            self.ypbind.enable()
eed6a9
-
eed6a9
-            if not nostart:
eed6a9
-                self.rpcbind.start(Restart=False)
eed6a9
-                self.ypbind.start()
eed6a9
-
eed6a9
-        def disableService(self, nostop):
eed6a9
-            if not nostop:
eed6a9
-                cmd = Command(Path.System('cmd-domainname'), ["(none)"])
eed6a9
-                cmd.run()
eed6a9
-
eed6a9
-            cmd = Command(Path.System('cmd-setsebool'),
eed6a9
-                          ['-P', 'allow_ypbind', '0'])
eed6a9
-            cmd.run()
eed6a9
-
eed6a9
-            self.rpcbind.disable()
eed6a9
-            self.ypbind.disable()
eed6a9
-
eed6a9
-            if not nostop:
eed6a9
-                self.rpcbind.stop()
eed6a9
-                self.ypbind.stop()
eed6a9
-
eed6a9
-        def write(self):
eed6a9
-            if not self.isset("nisdomain"):
eed6a9
-                return
eed6a9
-
eed6a9
-            output = "domain " + self.get("nisdomain")
eed6a9
-
eed6a9
-            additional_servers = []
eed6a9
-            if self.isset("nisserver"):
eed6a9
-                servers = self.get("nisserver").split(",")
eed6a9
-                additional_servers = servers[1:]
eed6a9
-                output += " server " + servers[0] + "\n"
eed6a9
-            else:
eed6a9
-                output += " broadcast\n"
eed6a9
-
eed6a9
-            for server in additional_servers:
eed6a9
-                output += "ypserver " + server + "\n"
eed6a9
-
eed6a9
-            filename = Path.System('yp.conf')
eed6a9
-            if self.getBool("test-call"):
eed6a9
-                print("========== BEGIN Content of [%s] ==========" % filename)
eed6a9
-                print(output)
eed6a9
-                print("========== END   Content of [%s] ==========\n" % filename)
eed6a9
-                return
eed6a9
-
eed6a9
-            with open(filename, "w") as f:
eed6a9
-                f.write(output)
eed6a9
-
eed6a9
-
eed6a9
 class AuthCompat:
eed6a9
     def __init__(self):
eed6a9
         self.sysconfig = EnvironmentFile(Path.System('authconfig'))
eed6a9
@@ -538,8 +447,6 @@ class AuthCompat:
eed6a9
                 or self.options.getBool("sssd")
eed6a9
                 or self.options.getBool("sssdauth")):
eed6a9
             profile = "sssd"
eed6a9
-        elif self.options.getBool("nis"):
eed6a9
-            profile = "nis"
eed6a9
         elif self.options.getBool("winbind"):
eed6a9
             profile = "winbind"
eed6a9
 
eed6a9
@@ -596,13 +503,11 @@ class AuthCompat:
eed6a9
     def writeConfiguration(self):
eed6a9
         configs = [
eed6a9
             Configuration.LDAP(self.options),
eed6a9
-            Configuration.Network(self.options),
eed6a9
             Configuration.Kerberos(self.options),
eed6a9
             Configuration.SSSD(self.options),
eed6a9
             Configuration.Winbind(self.options),
eed6a9
             Configuration.PWQuality(self.options),
eed6a9
             Configuration.MakeHomedir(self.options),
eed6a9
-            Configuration.NIS(self.options)
eed6a9
         ]
eed6a9
 
eed6a9
         for config in configs:
eed6a9
diff --git a/src/compat/authcompat_Options.py b/src/compat/authcompat_Options.py
eed6a9
index 5c8b21b55014198d6d9dfc98bd807c3c922b06f4..79ead60fa9edc1244227e3b69df025471b7c7991 100644
eed6a9
--- a/src/compat/authcompat_Options.py
eed6a9
+++ b/src/compat/authcompat_Options.py
eed6a9
@@ -79,9 +79,6 @@ class Options:
eed6a9
         # However, they will just make sure that an authentication against
eed6a9
         # expected service is working. They may not result in the exact same
eed6a9
         # configuration as authconfig would generate.
eed6a9
-        Option.Feature("nis", _("NIS for user information by default")),
eed6a9
-        Option.Valued("nisdomain", _("<domain>"), _("default NIS domain")),
eed6a9
-        Option.Valued("nisserver", _("<server>"), _("default NIS server")),
eed6a9
         Option.Feature("ldap", _("LDAP for user information by default")),
eed6a9
         Option.Feature("ldapauth", _("LDAP for authentication by default")),
eed6a9
         Option.Valued("ldapserver", _("<server>"), _("default LDAP server hostname or URI")),
eed6a9
@@ -164,6 +161,11 @@ class Options:
eed6a9
         Option.UnsupportedFeature("locauthorize"),
eed6a9
         Option.UnsupportedFeature("sysnetauth"),
eed6a9
         Option.UnsupportedValued("faillockargs", _("<options>")),
eed6a9
+
eed6a9
+        # NIS is no longer supported
eed6a9
+        Option.UnsupportedFeature("nis"),
eed6a9
+        Option.UnsupportedValued("nisdomain", _("<domain>")),
eed6a9
+        Option.UnsupportedValued("nisserver", _("<server>")),
eed6a9
     ]
eed6a9
 
eed6a9
     Map = {
eed6a9
diff --git a/src/man/authselect-migration.7.adoc b/src/man/authselect-migration.7.adoc
eed6a9
index 888cd4e5a0750d4e1aa5898887f5f7fd42472741..d9777b9b473859d7ec532f39f7e14bd81c4f1b90 100644
eed6a9
--- a/src/man/authselect-migration.7.adoc
eed6a9
+++ b/src/man/authselect-migration.7.adoc
eed6a9
@@ -72,7 +72,7 @@ configuration file for required services.
eed6a9
 |--enablesssd --enablesssdauth       |sssd
eed6a9
 |--enablekrb5                        |sssd
eed6a9
 |--enablewinbind --enablewinbindauth |winbind
eed6a9
-|--enablenis                         |nis
eed6a9
+|--enablenis                         |none
eed6a9
 |=========================================================
eed6a9
 
eed6a9
 .Relation of authconfig options to authselect profile features
eed6a9
-- 
eed6a9
2.34.1
eed6a9