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

93643d
From 7236f7a303215805de7195a8fdef7567543e8b0b Mon Sep 17 00:00:00 2001
93643d
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
93643d
Date: Wed, 9 Jun 2021 13:59:01 +0200
93643d
Subject: [PATCH] rhel9: remove nis support
93643d
93643d
NIS is no longer supported in RHEL9.
93643d
---
93643d
 profiles/Makefile.am                |  13 ----
93643d
 profiles/nis/README                 | 111 ----------------------------
93643d
 profiles/nis/REQUIREMENTS           |  13 ----
93643d
 profiles/nis/dconf-db               |   3 -
93643d
 profiles/nis/dconf-locks            |   2 -
93643d
 profiles/nis/nsswitch.conf          |  14 ----
93643d
 profiles/nis/postlogin              |   4 -
93643d
 rpm/authselect.spec.in              |  10 ---
93643d
 src/compat/authcompat.py.in.in      |  95 ------------------------
93643d
 src/compat/authcompat_Options.py    |   8 +-
93643d
 src/man/authselect-migration.7.adoc |   2 +-
93643d
 11 files changed, 6 insertions(+), 269 deletions(-)
93643d
 delete mode 100644 profiles/nis/README
93643d
 delete mode 100644 profiles/nis/REQUIREMENTS
93643d
 delete mode 100644 profiles/nis/dconf-db
93643d
 delete mode 100644 profiles/nis/dconf-locks
93643d
 delete mode 100644 profiles/nis/nsswitch.conf
93643d
 delete mode 100644 profiles/nis/postlogin
93643d
93643d
diff --git a/profiles/Makefile.am b/profiles/Makefile.am
93643d
index 95e27147b2b0a229a76a293884d605484d3fa841..c658521de01130f19f669fe0a6cb86c11043a406 100644
93643d
--- a/profiles/Makefile.am
93643d
+++ b/profiles/Makefile.am
93643d
@@ -13,19 +13,6 @@ dist_profile_minimal_DATA = \
93643d
     $(top_srcdir)/profiles/minimal/dconf-locks \
93643d
     $(NULL)
93643d
 
93643d
-profile_nisdir = $(authselect_profile_dir)/nis
93643d
-dist_profile_nis_DATA = \
93643d
-    $(top_srcdir)/profiles/nis/nsswitch.conf \
93643d
-    $(top_srcdir)/profiles/nis/password-auth \
93643d
-    $(top_srcdir)/profiles/nis/postlogin \
93643d
-    $(top_srcdir)/profiles/nis/README \
93643d
-    $(top_srcdir)/profiles/nis/REQUIREMENTS \
93643d
-    $(top_srcdir)/profiles/nis/system-auth \
93643d
-    $(top_srcdir)/profiles/nis/fingerprint-auth \
93643d
-    $(top_srcdir)/profiles/nis/dconf-db \
93643d
-    $(top_srcdir)/profiles/nis/dconf-locks \
93643d
-    $(NULL)
93643d
-
93643d
 profile_sssddir = $(authselect_profile_dir)/sssd
93643d
 dist_profile_sssd_DATA = \
93643d
     $(top_srcdir)/profiles/sssd/nsswitch.conf \
93643d
diff --git a/profiles/nis/README b/profiles/nis/README
93643d
deleted file mode 100644
93643d
index cac3428bf844b0a9d251015988583f4c1b15c3c9..0000000000000000000000000000000000000000
93643d
--- a/profiles/nis/README
93643d
+++ /dev/null
93643d
@@ -1,111 +0,0 @@
93643d
-Enable NIS for system authentication
93643d
-====================================
93643d
-
93643d
-Selecting this profile will enable Network Information Services as the source
93643d
-of identity and authentication providers.
93643d
-
93643d
-NIS CONFIGURATION
93643d
------------------
93643d
-
93643d
-Authselect does not touch NIS configuration. Please, read NIS' documentation
93643d
-to see how to configure it manually.
93643d
-
93643d
-AVAILABLE OPTIONAL FEATURES
93643d
----------------------------
93643d
-
93643d
-with-faillock::
93643d
-    Enable account locking in case of too many consecutive
93643d
-    authentication failures.
93643d
-
93643d
-with-mkhomedir::
93643d
-    Enable automatic creation of home directories for users on their
93643d
-    first login.
93643d
-
93643d
-with-fingerprint::
93643d
-    Enable authentication with fingerprint reader through *pam_fprintd*.
93643d
-
93643d
-with-pam-u2f::
93643d
-    Enable authentication via u2f dongle through *pam_u2f*.
93643d
-
93643d
-with-pam-u2f-2fa::
93643d
-    Enable 2nd factor authentication via u2f dongle through *pam_u2f*.
93643d
-
93643d
-without-pam-u2f-nouserok::
93643d
-    Module argument nouserok is omitted if also with-pam-u2f-2fa is used.
93643d
-    *WARNING*: Omitting nouserok argument means that users without pam-u2f
93643d
-    authentication configured will not be able to log in *INCLUDING* root.
93643d
-    Make sure you are able to log in before losing root privileges.
93643d
-
93643d
-with-silent-lastlog::
93643d
-    Do not produce pam_lastlog message during login.
93643d
-
93643d
-with-pamaccess::
93643d
-    Check access.conf during account authorization.
93643d
-
93643d
-with-nispwquality::
93643d
-    If this option is set pam_pwquality module will check password quality
93643d
-    for NIS users as well as local users during password change. Without this
93643d
-    option only local users passwords are checked.
93643d
-
93643d
-without-nullok::
93643d
-    Do not add nullok parameter to pam_unix.
93643d
-
93643d
-DISABLE SPECIFIC NSSWITCH DATABASES
93643d
------------------------------------
93643d
-
93643d
-Normally, nsswitch databases set by the profile overwrites values set in
93643d
-user-nsswitch.conf. The following options can force authselect to
93643d
-ignore value set by the profile and use the one set in user-nsswitch.conf
93643d
-instead.
93643d
-
93643d
-with-custom-aliases::
93643d
-Ignore "aliases" map set by the profile.
93643d
-
93643d
-with-custom-automount::
93643d
-Ignore "automount" map set by the profile.
93643d
-
93643d
-with-custom-ethers::
93643d
-Ignore "ethers" map set by the profile.
93643d
-
93643d
-with-custom-group::
93643d
-Ignore "group" map set by the profile.
93643d
-
93643d
-with-custom-hosts::
93643d
-Ignore "hosts" map set by the profile.
93643d
-
93643d
-with-custom-initgroups::
93643d
-Ignore "initgroups" map set by the profile.
93643d
-
93643d
-with-custom-netgroup::
93643d
-Ignore "netgroup" map set by the profile.
93643d
-
93643d
-with-custom-networks::
93643d
-Ignore "networks" map set by the profile.
93643d
-
93643d
-with-custom-passwd::
93643d
-Ignore "passwd" map set by the profile.
93643d
-
93643d
-with-custom-protocols::
93643d
-Ignore "protocols" map set by the profile.
93643d
-
93643d
-with-custom-publickey::
93643d
-Ignore "publickey" map set by the profile.
93643d
-
93643d
-with-custom-rpc::
93643d
-Ignore "rpc" map set by the profile.
93643d
-
93643d
-with-custom-services::
93643d
-Ignore "services" map set by the profile.
93643d
-
93643d
-with-custom-shadow::
93643d
-Ignore "shadow" map set by the profile.
93643d
-
93643d
-EXAMPLES
93643d
---------
93643d
-* Enable NIS with no additional modules
93643d
-
93643d
-  authselect select nis
93643d
-
93643d
-* Enable NIS and create home directories for users on their first login
93643d
-
93643d
-  authselect select nis with-mkhomedir
93643d
diff --git a/profiles/nis/REQUIREMENTS b/profiles/nis/REQUIREMENTS
93643d
deleted file mode 100644
93643d
index c58aa2789f4ef064b7904cacf4fc3158dce7ad41..0000000000000000000000000000000000000000
93643d
--- a/profiles/nis/REQUIREMENTS
93643d
+++ /dev/null
93643d
@@ -1,13 +0,0 @@
93643d
-Make sure that NIS service is configured and enabled. See NIS documentation for more information.
93643d
-                                                                                          {include if "with-fingerprint"}
93643d
-- with-fingerprint is selected, make sure fprintd service is configured and enabled       {include if "with-fingerprint"}
93643d
-                                                                                          {include if "with-pam-u2f"}
93643d
-- with-pam-u2f is selected, make sure that the pam u2f module is installed                {include if "with-pam-u2f"}
93643d
-  - users can then configure keys using the pamu2fcfg tool                                {include if "with-pam-u2f"}
93643d
-                                                                                          {include if "with-pam-u2f-2fa"}
93643d
-- with-pam-u2f-2fa is selected, make sure that the pam u2f module is installed            {include if "with-pam-u2f-2fa"}
93643d
-  - users can then configure keys using the pamu2fcfg tool                                {include if "with-pam-u2f-2fa"}
93643d
-                                                                                          {include if "with-mkhomedir"}
93643d
-- with-mkhomedir is selected, make sure pam_oddjob_mkhomedir module                       {include if "with-mkhomedir"}
93643d
-  is present and oddjobd service is enabled and active                                    {include if "with-mkhomedir"}
93643d
-  - systemctl enable --now oddjobd.service                                                {include if "with-mkhomedir"}
93643d
diff --git a/profiles/nis/dconf-db b/profiles/nis/dconf-db
93643d
deleted file mode 100644
93643d
index bd32b2819f66acdc75ab0fc522ec85673d10ed72..0000000000000000000000000000000000000000
93643d
--- a/profiles/nis/dconf-db
93643d
+++ /dev/null
93643d
@@ -1,3 +0,0 @@
93643d
-[org/gnome/login-screen]
93643d
-enable-smartcard-authentication=false
93643d
-enable-fingerprint-authentication={if "with-fingerprint":true|false}
93643d
diff --git a/profiles/nis/dconf-locks b/profiles/nis/dconf-locks
93643d
deleted file mode 100644
93643d
index 8a36fa9568344338272786394aece872185d0ab3..0000000000000000000000000000000000000000
93643d
--- a/profiles/nis/dconf-locks
93643d
+++ /dev/null
93643d
@@ -1,2 +0,0 @@
93643d
-/org/gnome/login-screen/enable-smartcard-authentication
93643d
-/org/gnome/login-screen/enable-fingerprint-authentication
93643d
diff --git a/profiles/nis/nsswitch.conf b/profiles/nis/nsswitch.conf
93643d
deleted file mode 100644
93643d
index 9bee7d839f84ff39d54cb6ead9dea38e51736b4d..0000000000000000000000000000000000000000
93643d
--- a/profiles/nis/nsswitch.conf
93643d
+++ /dev/null
93643d
@@ -1,14 +0,0 @@
93643d
-aliases:    files nis                   {exclude if "with-custom-aliases"}
93643d
-automount:  files nis                   {exclude if "with-custom-automount"}
93643d
-ethers:     files nis                   {exclude if "with-custom-ethers"}
93643d
-group:      files nis systemd           {exclude if "with-custom-group"}
93643d
-hosts:      files nis dns myhostname    {exclude if "with-custom-hosts"}
93643d
-initgroups: files nis                   {exclude if "with-custom-initgroups"}
93643d
-netgroup:   files nis                   {exclude if "with-custom-netgroup"}
93643d
-networks:   files nis                   {exclude if "with-custom-networks"}
93643d
-passwd:     files nis systemd           {exclude if "with-custom-passwd"}
93643d
-protocols:  files nis                   {exclude if "with-custom-protocols"}
93643d
-publickey:  files nis                   {exclude if "with-custom-publickey"}
93643d
-rpc:        files nis                   {exclude if "with-custom-rpc"}
93643d
-services:   files nis                   {exclude if "with-custom-services"}
93643d
-shadow:     files nis                   {exclude if "with-custom-shadow"}
93643d
diff --git a/profiles/nis/postlogin b/profiles/nis/postlogin
93643d
deleted file mode 100644
93643d
index 04a11f049bc1e220c9064fba7b46eb243ddd4996..0000000000000000000000000000000000000000
93643d
--- a/profiles/nis/postlogin
93643d
+++ /dev/null
93643d
@@ -1,4 +0,0 @@
93643d
-session     optional                   pam_umask.so silent
93643d
-session     [success=1 default=ignore] pam_succeed_if.so service !~ gdm* service !~ su* quiet
93643d
-session     [default=1]                pam_lastlog.so nowtmp {if "with-silent-lastlog":silent|showfailed}
93643d
-session     optional                   pam_lastlog.so silent noupdate showfailed
93643d
diff --git a/rpm/authselect.spec.in b/rpm/authselect.spec.in
93643d
index 628d6c91e9b3b4448787915fc1f9ac42f445bfc6..a0d508a716603771878781a62168fe0a71207f66 100644
93643d
--- a/rpm/authselect.spec.in
93643d
+++ b/rpm/authselect.spec.in
93643d
@@ -155,7 +155,6 @@ find $RPM_BUILD_ROOT -name "*.a" -exec %__rm -f {} \;
93643d
 %dir %{_datadir}/authselect/vendor
93643d
 %dir %{_datadir}/authselect/default
93643d
 %dir %{_datadir}/authselect/default/minimal/
93643d
-%dir %{_datadir}/authselect/default/nis/
93643d
 %dir %{_datadir}/authselect/default/sssd/
93643d
 %dir %{_datadir}/authselect/default/winbind/
93643d
 %{_datadir}/authselect/default/minimal/nsswitch.conf
93643d
@@ -164,15 +163,6 @@ find $RPM_BUILD_ROOT -name "*.a" -exec %__rm -f {} \;
93643d
 %{_datadir}/authselect/default/minimal/README
93643d
 %{_datadir}/authselect/default/minimal/REQUIREMENTS
93643d
 %{_datadir}/authselect/default/minimal/system-auth
93643d
-%{_datadir}/authselect/default/nis/dconf-db
93643d
-%{_datadir}/authselect/default/nis/dconf-locks
93643d
-%{_datadir}/authselect/default/nis/fingerprint-auth
93643d
-%{_datadir}/authselect/default/nis/nsswitch.conf
93643d
-%{_datadir}/authselect/default/nis/password-auth
93643d
-%{_datadir}/authselect/default/nis/postlogin
93643d
-%{_datadir}/authselect/default/nis/README
93643d
-%{_datadir}/authselect/default/nis/REQUIREMENTS
93643d
-%{_datadir}/authselect/default/nis/system-auth
93643d
 %{_datadir}/authselect/default/sssd/dconf-db
93643d
 %{_datadir}/authselect/default/sssd/dconf-locks
93643d
 %{_datadir}/authselect/default/sssd/fingerprint-auth
93643d
diff --git a/src/compat/authcompat.py.in.in b/src/compat/authcompat.py.in.in
93643d
index 4e39b7ec66d0e2ba911c7280467ba78fd29c196c..7c0fdf341212250f03dc14ddf6680e90da8e217e 100755
93643d
--- a/src/compat/authcompat.py.in.in
93643d
+++ b/src/compat/authcompat.py.in.in
93643d
@@ -240,20 +240,6 @@ class Configuration:
93643d
 
93643d
             config.write(keys)
93643d
 
93643d
-    class Network(Base):
93643d
-        def __init__(self, options):
93643d
-            super(Configuration.Network, self).__init__(options)
93643d
-
93643d
-        def write(self):
93643d
-            nisdomain = self.get("nisdomain")
93643d
-            config = EnvironmentFile(Path.System('network'))
93643d
-
93643d
-            if nisdomain is None:
93643d
-                return
93643d
-
93643d
-            config.set("NISDOMAIN", nisdomain)
93643d
-            config.write()
93643d
-
93643d
     class SSSD(Base):
93643d
         def __init__(self, options):
93643d
             super(Configuration.SSSD, self).__init__(options, ServiceName="sssd")
93643d
@@ -375,83 +361,6 @@ class Configuration:
93643d
             # other applications may depend on it.
93643d
             return
93643d
 
93643d
-    class NIS(Base):
93643d
-        def __init__(self, options):
93643d
-            super(Configuration.NIS, self).__init__(options)
93643d
-            self.rpcbind = Service("rpcbind")
93643d
-            self.ypbind = Service("ypbind")
93643d
-
93643d
-        def isEnabled(self):
93643d
-            if not self.isset("nis"):
93643d
-                return None
93643d
-
93643d
-            return self.getBool("nis")
93643d
-
93643d
-        def enableService(self, nostart):
93643d
-            if not self.isset("nisdomain"):
93643d
-                return
93643d
-
93643d
-            nisdom = self.get("nisdomain")
93643d
-
93643d
-            if not nostart:
93643d
-                cmd = Command(Path.System('cmd-domainname'), [nisdom])
93643d
-                cmd.run()
93643d
-
93643d
-            cmd = Command(Path.System('cmd-setsebool'),
93643d
-                          ['-P', 'allow_ypbind', '1'])
93643d
-            cmd.run()
93643d
-
93643d
-            self.rpcbind.enable()
93643d
-            self.ypbind.enable()
93643d
-
93643d
-            if not nostart:
93643d
-                self.rpcbind.start(Restart=False)
93643d
-                self.ypbind.start()
93643d
-
93643d
-        def disableService(self, nostop):
93643d
-            if not nostop:
93643d
-                cmd = Command(Path.System('cmd-domainname'), ["(none)"])
93643d
-                cmd.run()
93643d
-
93643d
-            cmd = Command(Path.System('cmd-setsebool'),
93643d
-                          ['-P', 'allow_ypbind', '0'])
93643d
-            cmd.run()
93643d
-
93643d
-            self.rpcbind.disable()
93643d
-            self.ypbind.disable()
93643d
-
93643d
-            if not nostop:
93643d
-                self.rpcbind.stop()
93643d
-                self.ypbind.stop()
93643d
-
93643d
-        def write(self):
93643d
-            if not self.isset("nisdomain"):
93643d
-                return
93643d
-
93643d
-            output = "domain " + self.get("nisdomain")
93643d
-
93643d
-            additional_servers = []
93643d
-            if self.isset("nisserver"):
93643d
-                servers = self.get("nisserver").split(",")
93643d
-                additional_servers = servers[1:]
93643d
-                output += " server " + servers[0] + "\n"
93643d
-            else:
93643d
-                output += " broadcast\n"
93643d
-
93643d
-            for server in additional_servers:
93643d
-                output += "ypserver " + server + "\n"
93643d
-
93643d
-            filename = Path.System('yp.conf')
93643d
-            if self.getBool("test-call"):
93643d
-                print("========== BEGIN Content of [%s] ==========" % filename)
93643d
-                print(output)
93643d
-                print("========== END   Content of [%s] ==========\n" % filename)
93643d
-                return
93643d
-
93643d
-            with open(filename, "w") as f:
93643d
-                f.write(output)
93643d
-
93643d
-
93643d
 class AuthCompat:
93643d
     def __init__(self):
93643d
         self.sysconfig = EnvironmentFile(Path.System('authconfig'))
93643d
@@ -533,8 +442,6 @@ class AuthCompat:
93643d
         if (self.options.getBool("ldap") or self.options.getBool("ldapauth") or
93643d
                 self.options.getBool("sssd") or self.options.getBool("sssdauth")):
93643d
             profile = "sssd"
93643d
-        elif self.options.getBool("nis"):
93643d
-            profile = "nis"
93643d
         elif self.options.getBool("winbind"):
93643d
             profile = "winbind"
93643d
 
93643d
@@ -591,13 +498,11 @@ class AuthCompat:
93643d
     def writeConfiguration(self):
93643d
         configs = [
93643d
             Configuration.LDAP(self.options),
93643d
-            Configuration.Network(self.options),
93643d
             Configuration.Kerberos(self.options),
93643d
             Configuration.SSSD(self.options),
93643d
             Configuration.Winbind(self.options),
93643d
             Configuration.PWQuality(self.options),
93643d
             Configuration.MakeHomedir(self.options),
93643d
-            Configuration.NIS(self.options)
93643d
         ]
93643d
 
93643d
         for config in configs:
93643d
diff --git a/src/compat/authcompat_Options.py b/src/compat/authcompat_Options.py
93643d
index 433a3340bac29739174e78928701214c08ec6f3c..2712d85a377ee92c7816e3d2284302307084b0c4 100644
93643d
--- a/src/compat/authcompat_Options.py
93643d
+++ b/src/compat/authcompat_Options.py
93643d
@@ -79,9 +79,6 @@ class Options:
93643d
         # However, they will just make sure that an authentication against
93643d
         # expected service is working. They may not result in the exact same
93643d
         # configuration as authconfig would generate.
93643d
-        Option.Feature("nis",             _("NIS for user information by default")),
93643d
-        Option.Valued ("nisdomain",       _("<domain>"), _("default NIS domain")),
93643d
-        Option.Valued ("nisserver",       _("<server>"), _("default NIS server")),
93643d
         Option.Feature("ldap",            _("LDAP for user information by default")),
93643d
         Option.Feature("ldapauth",        _("LDAP for authentication by default")),
93643d
         Option.Valued ("ldapserver",      _("<server>"), _("default LDAP server hostname or URI")),
93643d
@@ -164,6 +161,11 @@ class Options:
93643d
         Option.UnsupportedFeature("locauthorize"),
93643d
         Option.UnsupportedFeature("sysnetauth"),
93643d
         Option.UnsupportedValued ("faillockargs", _("<options>")),
93643d
+
93643d
+        # NIS is no longer supported
93643d
+        Option.UnsupportedFeature("nis"),
93643d
+        Option.UnsupportedValued ("nisdomain", _("<domain>")),
93643d
+        Option.UnsupportedValued ("nisserver", _("<server>")),
93643d
     ]
93643d
 
93643d
     Map = {
93643d
diff --git a/src/man/authselect-migration.7.adoc b/src/man/authselect-migration.7.adoc
93643d
index a27af036738274d8d392f7fe1f7d59c89e9c4ffb..515104b160d956d04b9ec8cacd25d166983e02d5 100644
93643d
--- a/src/man/authselect-migration.7.adoc
93643d
+++ b/src/man/authselect-migration.7.adoc
93643d
@@ -72,7 +72,7 @@ configuration file for required services.
93643d
 |--enablesssd --enablesssdauth       |sssd
93643d
 |--enablekrb5                        |sssd
93643d
 |--enablewinbind --enablewinbindauth |winbind
93643d
-|--enablenis                         |nis
93643d
+|--enablenis                         |none
93643d
 |=========================================================
93643d
 
93643d
 .Relation of authconfig options to authselect profile features
93643d
-- 
93643d
2.20.1
93643d