New trunk snapshot as prepared by Doktor Notor in bug 306961. Fixes/closes bugs 26171...
authorJeremy Olexa <darkside@gentoo.org>
Sun, 28 Mar 2010 03:25:25 +0000 (03:25 +0000)
committerJeremy Olexa <darkside@gentoo.org>
Sun, 28 Mar 2010 03:25:25 +0000 (03:25 +0000)
Package-Manager: portage-2.1.8.3/cvs/Linux x86_64

x11-misc/slim/ChangeLog
x11-misc/slim/Manifest
x11-misc/slim/files/14509-fix-keyboard-in-tty-from-which-slim-is-lauched.patch [new file with mode: 0644]
x11-misc/slim/files/15287-fix-pam-authentication-with-pam_unix2.patch [new file with mode: 0644]
x11-misc/slim/files/261713-restart-xserver-if-killed.patch [new file with mode: 0644]
x11-misc/slim/slim-1.3.1_p20091114.ebuild [new file with mode: 0644]

index 7fcc5d37d3256c870b365fd61bca49b1caf0ba6a..b441e215ba2edc73b09a94d0781a7ddfaad46260 100644 (file)
@@ -1,6 +1,16 @@
 # ChangeLog for x11-misc/slim
 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-misc/slim/ChangeLog,v 1.41 2010/03/20 17:03:20 armin76 Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/slim/ChangeLog,v 1.42 2010/03/28 03:25:25 darkside Exp $
+
+*slim-1.3.1_p20091114 (28 Mar 2010)
+
+  28 Mar 2010; Jeremy Olexa <darkside@gentoo.org>
+  +files/14509-fix-keyboard-in-tty-from-which-slim-is-lauched.patch,
+  +files/15287-fix-pam-authentication-with-pam_unix2.patch,
+  +files/261713-restart-xserver-if-killed.patch,
+  +slim-1.3.1_p20091114.ebuild:
+  New trunk snapshot as prepared by Doktor Notor in bug 306961. Fixes/closes
+  bugs 261713, 270345, 297655 including security bug
 
   20 Mar 2010; Raúl Porcel <armin76@gentoo.org> slim-1.3.1-r5.ebuild:
   sparc stable wrt #302473
index 3ed1f0e451d9a947247574dcfbb4cd3d6b286901..c0ef748a4072023847f9f82c0dde119345334c00 100644 (file)
@@ -1,8 +1,13 @@
+AUX 14509-fix-keyboard-in-tty-from-which-slim-is-lauched.patch 754 RMD160 079984153eb6ca97dafc94b065aeff6c57cf19ee SHA1 25fc499e10133c5325823453202aefdf828c3c21 SHA256 72995a16600174994864b9af959659d321c1fc6aa093650ed0b95b6760d91a13
+AUX 15287-fix-pam-authentication-with-pam_unix2.patch 3017 RMD160 ae6a20b9eb313bd6b9f93726d5519309a2bafc85 SHA1 e17c582fe0cc1d2a07e51d410db2d61c11aba4c6 SHA256 ced3b92f48ba09cd61287b72737ea58e499a7eedd4f61e25ee1b148d0b6cfbb3
+AUX 261713-restart-xserver-if-killed.patch 3198 RMD160 97b6627b17f74a6fb88a967fee7364bdb3280710 SHA1 15d7bffb0588ac33ece488aa209c2418023d4739 SHA256 c4ff22a4930d6ef12ee6ff30f4782b64785c00d54f687ac620e5cbd5eee283f9
 AUX slim-1.3.1-config.diff 1589 RMD160 dd92d5bc0ecc507309d7d36631cde9310002dd3c SHA1 8e84e9c99fc3fbb2f0893578cebf4a76cb7a0263 SHA256 cda9414dd9586f22b6996815e368078688488a234d672ecc9f647012ae8d3889
 AUX slim-1.3.1-gcc4.4.patch 380 RMD160 e2b1f057d32857239591474b5562b717a8ddab2c SHA1 60749d3357630cf54dadbc68f37d2e7831710f8f SHA256 52f6941889687a87f343f25b6aa590f0db08542bc2de65554f6e076d2033f7b1
 AUX slim.logrotate 102 RMD160 ccf614eca8c0b8fc1fbc2dfb8bf71b02485a743b SHA1 d2bc9202862f0d33bb902eba3aa8fefe0797d7a3 SHA256 d0559cf7764147f601f2bab8077fd956b1171adad4872c0d324279f6a978264a
 DIST slim-1.3.1.tar.gz 219446 RMD160 dc0c7c7257dfa8c2bee47ffa5ec8ddf17fd38f70 SHA1 30152b280724daf75299a8ee16585041f253ed4f SHA256 acd7a4024bfd7c2a4f3cd5d77ffed4956d13727a8f554042126d0568defe0f77
+DIST slim-1.3.1_p20091114.tar.bz2 216441 RMD160 61ede89624ed6983c08d05512c9f6458cff6425e SHA1 127aa0eb599c5bcbd87ce1ee040f8bb59bd63491 SHA256 ba68da747db4ef87329064fd3990f0402ad840ad723b03cea5e7c6c15a2c1a7b
 EBUILD slim-1.3.1-r4.ebuild 2495 RMD160 bdfc04c2227af16eafec39f51b121a6f95c31723 SHA1 6c7529ec061aa000b5e6188b5b7e3fa03b5206a1 SHA256 c6c68f8957040bccdd881895122b7750d43378a38c1a46094f46d6383161ca32
 EBUILD slim-1.3.1-r5.ebuild 2631 RMD160 73e737080d45aff3810aad0263b08f708e0ef867 SHA1 bdcea32bad18c00701059a0d33b35864f2ca9d67 SHA256 b20457bb3e60aac07ef3eb4c54bcd2f0eab53bd25b6cbbab3368da42c3ff8048
-MISC ChangeLog 6092 RMD160 c6dd223d2296029a3992ed057949650c48bc2cd0 SHA1 13b19322a3eb09146b4c2029059fe0e724d80890 SHA256 a4c5ba6e22819b2a12f6ffef47d1c469ff6e01a2789fffb137aedb50093410a5
+EBUILD slim-1.3.1_p20091114.ebuild 2882 RMD160 c92f1b18912b06307418046c724fb05144e9e744 SHA1 b56ac87fe0b74f6502078d7a96acbf1355e157a3 SHA256 ac57cd46a90c6335ade190e19566bc000ffa914ce4d217a1a016feb8bca10299
+MISC ChangeLog 6521 RMD160 48a402f0740bc81ddb2b1dd7407b157b59748c90 SHA1 fb1de317f0b526fdc0f069869117b619bb01a45c SHA256 4b3c9970130f1e8a32cdb6b26bd6ae984f5655872c4219238f72c29492f04421
 MISC metadata.xml 348 RMD160 22b309bfa0ee5378b0476cc4c7fe8ea3eabe8fbc SHA1 4f8c2e941ce68487614dfab204737ff51f9f8531 SHA256 821a30989eb2cad5bd636c79abffbdb600b31d67cd1b6fb219204d8aedd987bb
diff --git a/x11-misc/slim/files/14509-fix-keyboard-in-tty-from-which-slim-is-lauched.patch b/x11-misc/slim/files/14509-fix-keyboard-in-tty-from-which-slim-is-lauched.patch
new file mode 100644 (file)
index 0000000..c9d8d0a
--- /dev/null
@@ -0,0 +1,29 @@
+--- app.cpp.orig       2009-01-13 11:30:36.000000000 +0900
++++ app.cpp    2009-01-13 11:32:27.000000000 +0900
+@@ -270,21 +270,22 @@
+         signal(SIGALRM, AlarmSignal);
+ 
+ #ifndef XNEST_DEBUG
+-        OpenLog();
+-        
+         if (!force_nodaemon && cfg->getOption("daemon") == "yes") {
+             daemonmode = true;
+         }
+ 
+         // Daemonize
+         if (daemonmode) {
+-            if (daemon(0, 1) == -1) {
++            if (daemon(0, 0) == -1) {
+                 cerr << APPNAME << ": " << strerror(errno) << endl;
+                 exit(ERR_EXIT);
+             }
+-            UpdatePid();
+         }
+ 
++        OpenLog();
++        
++        if (daemonmode) UpdatePid();
++
+         CreateServerAuth();
+         StartServer();
+         alarm(2);
diff --git a/x11-misc/slim/files/15287-fix-pam-authentication-with-pam_unix2.patch b/x11-misc/slim/files/15287-fix-pam-authentication-with-pam_unix2.patch
new file mode 100644 (file)
index 0000000..2163d20
--- /dev/null
@@ -0,0 +1,89 @@
+diff -rc slim-1.3.1-orig/app.cpp slim-1.3.1/app.cpp
+*** slim-1.3.1-orig/app.cpp    2008-09-26 02:54:15.000000000 +0200
+--- slim-1.3.1/app.cpp 2009-02-17 19:50:06.000000000 +0100
+***************
+*** 41,48 ****
+      Panel* panel = *static_cast<Panel**>(appdata_ptr);
+      int result = PAM_SUCCESS;
+      for (int i=0; i<num_msg; i++){
+!         resp[i]->resp=0;
+!         resp[i]->resp_retcode=0;
+          switch(msg[i]->msg_style){
+              case PAM_PROMPT_ECHO_ON:
+                  // We assume PAM is asking for the username
+--- 41,48 ----
+      Panel* panel = *static_cast<Panel**>(appdata_ptr);
+      int result = PAM_SUCCESS;
+      for (int i=0; i<num_msg; i++){
+!         (*resp)[i].resp=0;
+!         (*resp)[i].resp_retcode=0;
+          switch(msg[i]->msg_style){
+              case PAM_PROMPT_ECHO_ON:
+                  // We assume PAM is asking for the username
+***************
+*** 51,63 ****
+                      case Panel::Suspend:
+                      case Panel::Halt:
+                      case Panel::Reboot:
+!                         resp[i]->resp=strdup("root");
+                          break;
+  
+                      case Panel::Console:
+                      case Panel::Exit:
+                      case Panel::Login:
+!                         resp[i]->resp=strdup(panel->GetName().c_str());
+                          break;
+                  }
+                  break;
+--- 51,63 ----
+                      case Panel::Suspend:
+                      case Panel::Halt:
+                      case Panel::Reboot:
+!                         (*resp)[i].resp=strdup("root");
+                          break;
+  
+                      case Panel::Console:
+                      case Panel::Exit:
+                      case Panel::Login:
+!                         (*resp)[i].resp=strdup(panel->GetName().c_str());
+                          break;
+                  }
+                  break;
+***************
+*** 73,79 ****
+  
+                      default:
+                          panel->EventHandler(Panel::Get_Passwd);
+!                         resp[i]->resp=strdup(panel->GetPasswd().c_str());
+                          break;
+                  }
+                  break;
+--- 73,79 ----
+  
+                      default:
+                          panel->EventHandler(Panel::Get_Passwd);
+!                         (*resp)[i].resp=strdup(panel->GetPasswd().c_str());
+                          break;
+                  }
+                  break;
+***************
+*** 89,97 ****
+      }
+      if (result!=PAM_SUCCESS){
+          for (int i=0; i<num_msg; i++){
+!             if (resp[i]->resp==0) continue;
+!             free(resp[i]->resp);
+!             resp[i]->resp=0;
+          };
+          free(*resp);
+          *resp=0;
+--- 89,97 ----
+      }
+      if (result!=PAM_SUCCESS){
+          for (int i=0; i<num_msg; i++){
+!             if ((*resp)[i].resp==0) continue;
+!             free((*resp)[i].resp);
+!             (*resp)[i].resp=0;
+          };
+          free(*resp);
+          *resp=0;
diff --git a/x11-misc/slim/files/261713-restart-xserver-if-killed.patch b/x11-misc/slim/files/261713-restart-xserver-if-killed.patch
new file mode 100644 (file)
index 0000000..2ea774b
--- /dev/null
@@ -0,0 +1,143 @@
+Index: trunk/app.h
+===================================================================
+--- trunk/app.h        (revision 151)
++++ trunk/app.h        (working copy)
+@@ -34,6 +34,7 @@
+     ~App();
+     void Run();
+     int GetServerPID();
++    void RestartServer();
+     void StopServer();
+ 
+     // Lock functions
+@@ -48,7 +49,6 @@
+     void Console();
+     void Exit();
+     void KillAllClients(Bool top);
+-    void RestartServer();
+     void ReadConfig();
+     void OpenLog();
+     void CloseLog();
+Index: trunk/app.cpp
+===================================================================
+--- trunk/app.cpp      (revision 151)
++++ trunk/app.cpp      (working copy)
+@@ -100,6 +100,11 @@
+ 
+ extern App* LoginApp;
+ 
++int xioerror(Display *disp) {
++      LoginApp->RestartServer();
++    return 0;
++}
++
+ void CatchSignal(int sig) {
+     cerr << APPNAME << ": unexpected signal " << sig << endl;
+     LoginApp->StopServer();
+@@ -107,19 +112,6 @@
+     exit(ERR_EXIT);
+ }
+ 
+-
+-void AlarmSignal(int sig) {
+-    int pid = LoginApp->GetServerPID();
+-    if(waitpid(pid, NULL, WNOHANG) == pid) {
+-        LoginApp->StopServer();
+-        LoginApp->RemoveLock();
+-        exit(OK_EXIT);
+-    }
+-    signal(sig, AlarmSignal);
+-    alarm(2);
+-}
+-
+-
+ void User1Signal(int sig) {
+     signal(sig, User1Signal);
+ }
+@@ -257,7 +249,6 @@
+         signal(SIGHUP, CatchSignal);
+         signal(SIGPIPE, CatchSignal);
+         signal(SIGUSR1, User1Signal);
+-        signal(SIGALRM, AlarmSignal);
+ 
+ #ifndef XNEST_DEBUG
+         OpenLog();
+@@ -277,7 +268,6 @@
+ 
+         CreateServerAuth();
+         StartServer();
+-        alarm(2);
+ #endif
+ 
+     }
+@@ -575,6 +565,8 @@
+     int status;
+     while (wpid != pid) {
+         wpid = wait(&status);
++              if (wpid == ServerPID)
++                      xioerror(Dpy);  // Server died, simulate IO error
+     }
+     if (WIFEXITED(status) && WEXITSTATUS(status)) {
+         LoginPanel->Message("Failed to execute login command");
+@@ -620,9 +612,6 @@
+ 
+ 
+ void App::Reboot() {
+-    // Stop alarm clock
+-    alarm(0);
+-
+ #ifdef USE_PAM
+     try{
+         pam.end();
+@@ -645,9 +634,6 @@
+ 
+ 
+ void App::Halt() {
+-    // Stop alarm clock
+-    alarm(0);
+-
+ #ifdef USE_PAM
+     try{
+         pam.end();
+@@ -733,6 +719,7 @@
+ 
+     StopServer(); 
+     RemoveLock();
++      while (waitpid(-1, NULL, WNOHANG) > 0); // Collects all dead childrens
+     Run();
+ } 
+ 
+@@ -803,6 +790,7 @@
+ 
+     for(cycles = 0; cycles < ncycles; cycles++) {
+         if((Dpy = XOpenDisplay(DisplayName))) {
++            XSetIOErrorHandler(xioerror);
+             return 1;
+         } else {
+             if(!ServerTimeout(1, "X server to begin accepting connections"))
+@@ -885,9 +873,6 @@
+             ServerPID = -1;
+             break;
+         }
+-        alarm(15);
+-        pause();
+-        alarm(0);
+ 
+         // Wait for server to start up
+         if(WaitForServer() == 0) {
+@@ -920,15 +905,12 @@
+ 
+ 
+ void App::StopServer() {
+-    // Stop alars clock and ignore signals
+-    alarm(0);
+     signal(SIGQUIT, SIG_IGN);
+     signal(SIGINT, SIG_IGN);
+     signal(SIGHUP, SIG_IGN);
+     signal(SIGPIPE, SIG_IGN);
+     signal(SIGTERM, SIG_DFL);
+     signal(SIGKILL, SIG_DFL);
+-    signal(SIGALRM, SIG_DFL);
+ 
+     // Catch X error
+     XSetIOErrorHandler(IgnoreXIO);
diff --git a/x11-misc/slim/slim-1.3.1_p20091114.ebuild b/x11-misc/slim/slim-1.3.1_p20091114.ebuild
new file mode 100644 (file)
index 0000000..f05b5cf
--- /dev/null
@@ -0,0 +1,94 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-misc/slim/slim-1.3.1_p20091114.ebuild,v 1.1 2010/03/28 03:25:25 darkside Exp $
+
+EAPI=2
+
+inherit toolchain-funcs pam eutils
+
+DESCRIPTION="Simple Login Manager"
+HOMEPAGE="http://slim.berlios.de"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="branding screenshot pam"
+
+DEPEND="x11-proto/xproto
+       x11-libs/libXmu
+       x11-libs/libX11
+       x11-libs/libXpm
+       x11-libs/libXft
+       media-libs/libpng
+       media-libs/jpeg
+       pam? ( virtual/pam )"
+RDEPEND="${DEPEND}
+       x11-apps/sessreg
+       screenshot? ( media-gfx/imagemagick )
+       branding? ( >=x11-themes/slim-themes-1.2.3a-r3 )"
+
+src_prepare() {
+       # respect C[XX]FLAGS, fix crosscompile,
+       # fix linking order for --as-needed"
+       sed -i -e "s:^CXX=.*:CXX=$(tc-getCXX) ${CXXFLAGS}:" \
+               -e "s:^CC=.*:CC=$(tc-getCC) ${CFLAGS}:" \
+               -e "s:^MANDIR=.*:MANDIR=/usr/share/man:" \
+               -e "s:^\t\(.*\)\ \$(LDFLAGS)\ \(.*\):\t\1\ \2\ \$(LDFLAGS):g" \
+               -r -e "s:^LDFLAGS=(.*):LDFLAGS=\1 ${LDFLAGS}:" \
+               Makefile || die "sed failed in Makefile"
+       epatch "${FILESDIR}/${PN}-1.3.1-config.diff"
+
+       if use branding; then
+               sed -i -e 's/  default/  slim-gentoo-simple/' slim.conf || die
+       fi
+
+       # Gentoo bug 297655
+       epatch "${FILESDIR}/14509-fix-keyboard-in-tty-from-which-${PN}-is-lauched.patch"
+       # Upstream bug #15287
+       epatch "${FILESDIR}/15287-fix-pam-authentication-with-pam_unix2.patch"
+       # Gentoo Bug 261713
+       epatch "${FILESDIR}/261713-restart-xserver-if-killed.patch"
+}
+
+src_compile() {
+       if use pam ; then
+               emake USE_PAM=1 || die "emake failed."
+       else
+               emake || die "emake failed."
+       fi
+}
+
+src_install() {
+       if use pam ; then
+               emake USE_PAM=1 DESTDIR="${D}" install || die "emake install failed."
+               pamd_mimic_system slim auth account password session
+       else
+               emake DESTDIR="${D}" install || die "emake install failed."
+       fi
+
+       insinto /etc/logrotate.d
+       newins "${FILESDIR}/slim.logrotate" slim || die "newins failed"
+
+       dodoc xinitrc.sample ChangeLog README TODO THEMES
+}
+
+pkg_postinst() {
+       elog
+       elog "The configuration file is located at /etc/slim.conf."
+       elog
+       elog "If you wish ${PN} to start automatically, set DISPLAYMANAGER=\"${PN}\" "
+       elog "in /etc/conf.d/xdm and run \"rc-update add xdm default\"."
+       elog "By default, ${PN} will use default XSESSION value set in /etc/rc.conf."
+       elog
+       elog "If you want to use .xinitrc in the user's home directory for session"
+       elog "management instead, see README and xinitrc.sample in"
+       elog "/usr/share/doc/${PF} and change your login_cmd in /etc/slim.conf"
+       elog "accordingly."
+       elog
+       if ! use pam; then
+               elog "You have merged ${PN} without USE=pam, this will cause ${PN} to fall back to"
+               elog "the console when restarting your window manager. If this is not"
+               elog "desired, then please remerge ${PN} with USE=pam"
+       fi
+}