summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Olexa <darkside@gentoo.org>2010-03-28 03:25:25 +0000
committerJeremy Olexa <darkside@gentoo.org>2010-03-28 03:25:25 +0000
commitfff44e7bea3f2afe9303b3f2e571138cb2beb208 (patch)
tree0b78c09486d53b3f0042c828a5810275848b7651 /x11-misc/slim
parentVersion bump, small bug fixes and fix for bug 309685 (diff)
downloadgentoo-2-fff44e7bea3f2afe9303b3f2e571138cb2beb208.tar.gz
gentoo-2-fff44e7bea3f2afe9303b3f2e571138cb2beb208.tar.bz2
gentoo-2-fff44e7bea3f2afe9303b3f2e571138cb2beb208.zip
New trunk snapshot as prepared by Doktor Notor in bug 306961. Fixes/closes bugs 261713, 270345, 297655 including security bug
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'x11-misc/slim')
-rw-r--r--x11-misc/slim/ChangeLog12
-rw-r--r--x11-misc/slim/files/14509-fix-keyboard-in-tty-from-which-slim-is-lauched.patch29
-rw-r--r--x11-misc/slim/files/15287-fix-pam-authentication-with-pam_unix2.patch89
-rw-r--r--x11-misc/slim/files/261713-restart-xserver-if-killed.patch143
-rw-r--r--x11-misc/slim/slim-1.3.1_p20091114.ebuild94
5 files changed, 366 insertions, 1 deletions
diff --git a/x11-misc/slim/ChangeLog b/x11-misc/slim/ChangeLog
index 7fcc5d37d325..b441e215ba2e 100644
--- a/x11-misc/slim/ChangeLog
+++ b/x11-misc/slim/ChangeLog
@@ -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
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
index 000000000000..c9d8d0a5aed1
--- /dev/null
+++ b/x11-misc/slim/files/14509-fix-keyboard-in-tty-from-which-slim-is-lauched.patch
@@ -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
index 000000000000..2163d20a5e32
--- /dev/null
+++ b/x11-misc/slim/files/15287-fix-pam-authentication-with-pam_unix2.patch
@@ -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
index 000000000000..2ea774b81eac
--- /dev/null
+++ b/x11-misc/slim/files/261713-restart-xserver-if-killed.patch
@@ -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
index 000000000000..f05b5cf0c8d1
--- /dev/null
+++ b/x11-misc/slim/slim-1.3.1_p20091114.ebuild
@@ -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
+}