]> git.pld-linux.org Git - packages/pam.git/commitdiff
drop update motd patch commented out for 4 years
authorJan Palus <atler@pld-linux.org>
Thu, 2 Feb 2023 20:15:17 +0000 (21:15 +0100)
committerJan Palus <atler@pld-linux.org>
Thu, 2 Feb 2023 20:15:17 +0000 (21:15 +0100)
pam.spec
update-motd.patch [deleted file]

index 475f311a5d9e88eb1a997ac47ce39be9d8cde145..c4e9f1cfa8177eb8df1a8cae93ca94fffdd81122 100644 (file)
--- a/pam.spec
+++ b/pam.spec
@@ -50,8 +50,7 @@ Patch2:               %{name}-tally-fail-close.patch
 Patch3:                %{name}-mkhomedir-notfound.patch
 Patch4:                %{name}-db-gdbm.patch
 Patch5:                %{name}-exec-failok.patch
-Patch6:                update-motd.patch
-Patch7:                pam_console_pam_tty.patch
+Patch6:                pam_console_pam_tty.patch
 URL:           http://www.linux-pam.org/
 %{?with_audit:BuildRequires:   audit-libs-devel >= 1.6.9}
 BuildRequires: autoconf >= 2.61
@@ -297,10 +296,7 @@ danych GDBM.
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
-# upstream has similar approach for multiple files (not no exec):
-# https://github.com/linux-pam/linux-pam/pull/48
-#%patch6 -p1
-%patch7 -p1
+%patch6 -p1
 
 %build
 %{__libtoolize}
diff --git a/update-motd.patch b/update-motd.patch
deleted file mode 100644 (file)
index d319f1b..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-Patch for Ubuntu bug #399071
-https://bugs.launchpad.net/ubuntu/+source/pam/+bug/399071
-
-Provide a more dynamic MOTD, based on the short-lived update-motd project.
-
-Authors: Dustin Kirkland <kirkland@canonical.com>
-
-Upstream status: not yet submitted
-
---- Linux-PAM-1.3.0/modules/pam_motd/pam_motd.c~       2016-05-30 11:18:57.000000000 +0300
-+++ Linux-PAM-1.3.0/modules/pam_motd/pam_motd.c        2016-06-02 16:33:27.912175360 +0300
-@@ -48,13 +48,38 @@
- static char default_motd[] = DEFAULT_MOTD;
-+static void display_file(pam_handle_t *pamh, const char *motd_path)
-+{
-+    int fd;
-+    char *mtmp = NULL;
-+    while ((fd = open(motd_path, O_RDONLY, 0)) >= 0) {
-+      struct stat st;
-+      /* fill in message buffer with contents of motd */
-+      if ((fstat(fd, &st) < 0) || !st.st_size || st.st_size > 0x10000)
-+          break;
-+      if (!(mtmp = malloc(st.st_size+1)))
-+          break;
-+      if (pam_modutil_read(fd, mtmp, st.st_size) != st.st_size)
-+          break;
-+      if (mtmp[st.st_size-1] == '\n')
-+          mtmp[st.st_size-1] = '\0';
-+      else
-+          mtmp[st.st_size] = '\0';
-+      pam_info (pamh, "%s", mtmp);
-+      break;
-+    }
-+    _pam_drop (mtmp);
-+    if (fd >= 0)
-+      close(fd);
-+}
-+
- int pam_sm_open_session(pam_handle_t *pamh, int flags,
-                       int argc, const char **argv)
- {
-     int retval = PAM_IGNORE;
--    int fd;
-+    int do_update = 1;
-     const char *motd_path = NULL;
--    char *mtmp = NULL;
-+    struct stat st;
-     if (flags & PAM_SILENT) {
-       return retval;
-@@ -73,6 +98,9 @@
-                          "motd= specification missing argument - ignored");
-           }
-       }
-+      else if (!strcmp(*argv,"noupdate")) {
-+              do_update = 0;
-+      }
-       else
-           pam_syslog(pamh, LOG_ERR, "unknown option: %s", *argv);
-     }
-@@ -80,34 +108,23 @@
-     if (motd_path == NULL)
-       motd_path = default_motd;
--    while ((fd = open(motd_path, O_RDONLY, 0)) >= 0) {
--      struct stat st;
--
--      /* fill in message buffer with contents of motd */
--      if ((fstat(fd, &st) < 0) || !st.st_size || st.st_size > 0x10000)
--          break;
--
--      if (!(mtmp = malloc(st.st_size+1)))
--          break;
--
--      if (pam_modutil_read(fd, mtmp, st.st_size) != st.st_size)
--          break;
--
--      if (mtmp[st.st_size-1] == '\n')
--          mtmp[st.st_size-1] = '\0';
--      else
--          mtmp[st.st_size] = '\0';
--
--      pam_info (pamh, "%s", mtmp);
--      break;
-+    /* Run the update-motd dynamic motd scripts, outputting to /var/run/motd.
-+       If /etc/motd -> /var/run/motd, the displayed MOTD will be dynamic.
-+       Otherwise, the admin can force a static MOTD by breaking that symlink
-+       and publishing into an /etc/motd text file. */
-+    if (do_update && (stat("/etc/update-motd.d", &st) == 0)
-+        && S_ISDIR(st.st_mode))
-+    {
-+      mode_t old_mask = umask(0022);
-+      if (!system("/usr/bin/env -i PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin run-parts /etc/update-motd.d > /var/run/motd.new"))
-+          rename("/var/run/motd.new", "/var/run/motd");
-+      umask(old_mask);
-     }
--    _pam_drop (mtmp);
--
--    if (fd >= 0)
--      close(fd);
-+    /* Display the updated motd */
-+    display_file(pamh, motd_path);
--     return retval;
-+    return retval;
- }
-Index: pam.ubuntu/modules/pam_motd/pam_motd.8.xml
-===================================================================
---- pam.ubuntu.orig/modules/pam_motd/pam_motd.8.xml
-+++ pam.ubuntu/modules/pam_motd/pam_motd.8.xml
-@@ -52,6 +52,17 @@
-           </para>
-         </listitem>
-       </varlistentry>
-+      <varlistentry>
-+        <term>
-+          <option>noupdate</option>
-+        </term>
-+        <listitem>
-+          <para>
-+            Don't run the scripts in <filename>/etc/update-motd.d</filename>
-+            to refresh the motd file.
-+          </para>
-+        </listitem>
-+      </varlistentry>
-     </variablelist>
-   </refsect1>
-Index: pam.ubuntu/modules/pam_motd/pam_motd.8
-===================================================================
---- pam.ubuntu.orig/modules/pam_motd/pam_motd.8
-+++ pam.ubuntu/modules/pam_motd/pam_motd.8
-@@ -45,6 +45,13 @@
- /path/filename
- file is displayed as message of the day\&.
- .RE
-+.PP
-+\fBnoupdate\fR
-+.RS 4
-+Don\*(Aqt run the scripts in
-+/etc/update\-motd\&.d
-+to refresh the motd file\&.
-+.RE
- .SH "MODULE TYPES PROVIDED"
- .PP
- Only the
-Index: pam.ubuntu/modules/pam_motd/README
-===================================================================
---- pam.ubuntu.orig/modules/pam_motd/README
-+++ pam.ubuntu/modules/pam_motd/README
-@@ -14,6 +14,10 @@
-     The /path/filename file is displayed as message of the day.
-+noupdate
-+
-+    Don't run the scripts in /etc/update-motd.d to refresh the motd file.
-+
- EXAMPLES
- The suggested usage for /etc/pam.d/login is:
This page took 0.178065 seconds and 4 git commands to generate.