The current version of x11/slim (1.2.4) leaks memory on second and later logins and it does not restart X11 upon logout which is a potential security issue (leaving applications running after logout from your window manager). Fix: Both of these issues have been fixed in later versions of x11/slim. The patch below upgrades x11/slim to 1.2.6 and moves it from X11BASE to LOCALBASE. This move likely warrants an entry in ports/UPDATING as the configuration file location will move from /usr/X11R6/etc/slim.conf to /usr/local/etc/slim.conf. How-To-Repeat: Install x11/slim and set it up as the graphical login manager. Log in and start a graphical application like sysutils/conky, log out and notice that conky is still running. Log in and out a couple of times and see the memory use of slim rise.
State Changed From-To: open->feedback Awaiting maintainers feedback
Responsible Changed From-To: freebsd-ports-bugs->rafan Eat.
Hi Henrik and Edwin Thanks for the update and improvment. I missed that there is a new version of slim available. I tried out the patch and I can't quite get it to work with a default install. When started in daemon mode (the rc startup script does this by default), I lose keyboard input, i.e. I can't type anything after the login screen shows up. I had this problem before when not switching to the right vt (hence the comment at the beginning of slim.conf). Can you look at this again and see if you can reproduce this? Or alternatively, I'll have a go at fixing it, but that won't be before the first week of December, as I'll be away next week. I still use slim actively and I'm happy to keep maintaining the port, however if you want to take it, I'm also happy to pass maintainership to you. Thanks, Tobias
Hi Tobias, On Fri, Nov 24, 2006 at 07:42:48AM +0100, Tobias Roth wrote: > I tried out the patch and I can't quite get it to work with a default > install. When started in daemon mode (the rc startup script does this > by default), I lose keyboard input, i.e. I can't type anything after > the login screen shows up. I had this problem before when not switching > to the right vt (hence the comment at the beginning of slim.conf). I can reproduce that here. I didn't notice that since I launch slim from /etc/ttys. > Can you look at this again and see if you can reproduce this? Or > alternatively, I'll have a go at fixing it, but that won't be before the > first week of December, as I'll be away next week. I'll look into it this weekend. Regards, Brix -- Henrik Brix Andersen <henrik@brixandersen.dk>
Found the problem: there's a bug in how slim detects whether or not a vtXX argument has been specified in $xserver_arguments. The bug causes slim to always spawn on vt07 when in daemon mode. Here is an updated patch containing a files/patch-app.cpp diff for fixing this issue (I will submit this patch upstream as well). The patch also makes slim default to vt09 instead of vt07 when in daemon mode - unless overridden in $xserver_arguments. diff -urpN /usr/ports/x11/slim/Makefile ports/x11/slim/Makefile --- /usr/ports/x11/slim/Makefile Thu Mar 23 16:23:31 2006 +++ ports/x11/slim/Makefile Sun Nov 26 19:08:02 2006 @@ -6,7 +6,7 @@ # PORTNAME= slim -PORTVERSION= 1.2.4 +PORTVERSION= 1.2.6 CATEGORIES= x11 MASTER_SITES= http://download.berlios.de/slim/ \ http://depot.fsck.ch/mirror/distfiles/ @@ -20,7 +20,6 @@ LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics RUN_DEPENDS= ${X11BASE}/bin/X:${X_SERVER_PORT} BUILD_DEPENDS= ${X11BASE}/include/X11/Xft/Xft.h:${PORTSDIR}/x11-fonts/libXft -USE_X_PREFIX= yes USE_XLIB= yes USE_RC_SUBR= slim.sh @@ -29,22 +28,24 @@ MAN1= slim.1 MAKEFILE= Makefile.freebsd pre-build: - @${REINPLACE_CMD} -e 's|%%X11BASE%%|${X11BASE}|g' \ + @${REINPLACE_CMD} \ + -e 's|%%X11BASE%%|${X11BASE}|g' \ + -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/Makefile.freebsd \ ${WRKSRC}/slim.conf do-install: - @${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${X11BASE}/bin - @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${X11BASE}/etc/${PORTNAME}.conf.sample - @${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${X11BASE}/man/man1 + @${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${LOCALBASE}/bin + @${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.conf ${LOCALBASE}/etc/${PORTNAME}.conf.sample + @${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${LOCALBASE}/man/man1 @${MKDIR} ${DATADIR}/themes/default @${INSTALL_DATA} ${WRKSRC}/themes/default/${PORTNAME}.theme ${DATADIR}/themes/default @${INSTALL_DATA} ${WRKSRC}/themes/default/panel.png ${DATADIR}/themes/default @${INSTALL_DATA} ${WRKSRC}/themes/default/background.jpg ${DATADIR}/themes/default post-install: - @if [ ! -f ${X11BASE}/etc/slim.conf ]; then \ - ${CP} -p ${X11BASE}/etc/slim.conf.sample ${X11BASE}/etc/slim.conf ; \ + @if [ ! -f ${LOCALBASE}/etc/slim.conf ]; then \ + ${CP} -p ${LOCALBASE}/etc/slim.conf.sample ${LOCALBASE}/etc/slim.conf ; \ fi .include <bsd.port.mk> diff -urpN /usr/ports/x11/slim/distinfo ports/x11/slim/distinfo --- /usr/ports/x11/slim/distinfo Thu Mar 23 16:23:31 2006 +++ ports/x11/slim/distinfo Thu Nov 16 17:30:44 2006 @@ -1,3 +1,3 @@ -MD5 (slim-1.2.4.tar.gz) = b4aec9724050cf0fd582f8a39bf30f1e -SHA256 (slim-1.2.4.tar.gz) = 84d0fbbd39d012821de195ee3a14af421a40afc0fb68aaa06dc6c5996ace2a62 -SIZE (slim-1.2.4.tar.gz) = 214449 +MD5 (slim-1.2.6.tar.gz) = 1bf891f046014a03236c21ce6cbe455b +SHA256 (slim-1.2.6.tar.gz) = 4f0a51c88d0d4f942d3552efcfbfcb245bc558336a1ed3f531dbe65252ad8c5e +SIZE (slim-1.2.6.tar.gz) = 219003 diff -urpN /usr/ports/x11/slim/files/patch-Makefile.freebsd ports/x11/slim/files/patch-Makefile.freebsd --- /usr/ports/x11/slim/files/patch-Makefile.freebsd Sun Jan 8 22:48:57 2006 +++ ports/x11/slim/files/patch-Makefile.freebsd Thu Nov 16 17:57:38 2006 @@ -1,26 +1,25 @@ ---- Makefile.freebsd.orig Sun Sep 11 18:50:36 2005 -+++ Makefile.freebsd Sun Jan 8 12:17:45 2006 -@@ -3,15 +3,15 @@ +--- Makefile.freebsd.orig Thu Nov 16 17:47:00 2006 ++++ Makefile.freebsd Thu Nov 16 17:57:34 2006 +@@ -3,14 +3,15 @@ # Edit the following section to adjust the options # to fit into your operating system / distribution ####################################################### -CXX=/usr/bin/g++ -CC=/usr/bin/gcc -CFLAGS=-I. -I/usr/X11R6/include -I/usr/local/include/freetype2 -I/usr/local/include/freetype2/config -I/usr/local/include/libpng -I/usr/local/include -I/usr/include --CXXLAGS=$(CFLAGS) --LDFLAGS=-L/usr/X11R6/lib -L/usr/local/lib -lXft -lX11 -lfreetype -lXrender -lfontconfig -lpng -lz -lm -lcrypt -lXpm -lXmu -lpng -ljpeg +-LDFLAGS=-L/usr/X11R6/lib -L/usr/local/lib -lXft -lX11 -lfreetype -lXrender -lfontconfig -lpng -lz -lm -lcrypt -lXmu -lpng -ljpeg +CXX?=/usr/bin/g++ +CC?=/usr/bin/gcc +CFLAGS+=-I%%X11BASE%%/include `freetype-config --cflags` `libpng-config --cflags` +CXXLAGS+=$(CFLAGS) -+LDFLAGS=-L%%X11BASE%%/lib `freetype-config --libs` `libpng-config --libs` -lXft -lX11 -lXrender -lfontconfig -lz -lm -lcrypt -lXpm -lXmu -ljpeg ++LDFLAGS=-L%%X11BASE%%/lib `freetype-config --libs` `libpng-config --libs` -lXft -lX11 -lXrender -lfontconfig -lz -lm -lcrypt -lXmu -ljpeg CUSTOM=-DNEEDS_BASENAME -PREFIX=/usr -CFGDIR=/etc -MANDIR=/usr/share/man -+PREFIX=%%X11BASE%% -+CFGDIR=%%X11BASE%%/etc -+MANDIR=%%X11BASE%%/man ++PREFIX=%%LOCALBASE%% ++CFGDIR=%%LOCALBASE%%/etc ++MANDIR=%%LOCALBASE%%/man DESTDIR= ####################################################### diff -urpN /usr/ports/x11/slim/files/patch-app.cpp ports/x11/slim/files/patch-app.cpp --- /usr/ports/x11/slim/files/patch-app.cpp Thu Jan 1 01:00:00 1970 +++ ports/x11/slim/files/patch-app.cpp Sun Nov 26 23:15:16 2006 @@ -0,0 +1,37 @@ +--- app.cpp.orig Fri Nov 24 16:36:58 2006 ++++ app.cpp Sun Nov 26 23:14:35 2006 +@@ -560,13 +560,6 @@ int App::StartServer() { + } else if (pos == 0) { + server[argc++] = args+pos; + } +- if (server[argc-1][0] == 'v' && server[argc-1][1] == 't') { +- bool ok = false; +- Cfg::string2int(server[argc-1]+2, &ok); +- if (ok) { +- hasVtSet = true; +- } +- } + ++pos; + + if (argc+1 >= MAX_XSERVER_ARGS) { +@@ -576,8 +569,19 @@ int App::StartServer() { + break; + } + } ++ ++ for (int i=0; i<argc; i++) { ++ if (server[i][0] == 'v' && server[i][1] == 't') { ++ bool ok = false; ++ Cfg::string2int(server[i]+2, &ok); ++ if (ok) { ++ hasVtSet = true; ++ } ++ } ++ } ++ + if (!hasVtSet && daemonmode) { +- server[argc++] = "vt07"; ++ server[argc++] = "vt09"; + } + server[argc] = NULL; + diff -urpN /usr/ports/x11/slim/files/patch-slim.conf ports/x11/slim/files/patch-slim.conf --- /usr/ports/x11/slim/files/patch-slim.conf Thu Mar 16 16:46:14 2006 +++ ports/x11/slim/files/patch-slim.conf Thu Nov 16 18:35:38 2006 @@ -1,10 +1,13 @@ ---- slim.conf.orig Sun Sep 11 18:50:36 2005 -+++ slim.conf Sun Jan 8 14:32:02 2006 -@@ -1,13 +1,15 @@ +--- slim.conf.orig Thu Nov 16 17:59:38 2006 ++++ slim.conf Thu Nov 16 18:14:31 2006 +@@ -1,17 +1,19 @@ # Path, X server and arguments (if needed) - default_path ./:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin - default_xserver /usr/X11R6/bin/X + # Note: -xauth $authfile is automatically appended +-default_path ./:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin +-default_xserver /usr/X11R6/bin/X -#xserver_arguments -dpi 75 ++default_path ./:/bin:/usr/bin:%%LOCALBASE%%/bin:%%X11BASE%%/bin ++default_xserver %%X11BASE%%/bin/X +# The X server needs to be started on an unused virtual terminal, +# for FreeBSD in a default configuration, the first one of those is #09 +xserver_arguments vt09 @@ -15,12 +18,16 @@ reboot_cmd /sbin/shutdown -r now -console_cmd /usr/X11R6/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/issue; exec /bin/login" -#suspend_cmd /usr/sbin/suspend -+console_cmd /usr/X11R6/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/motd; exec /usr/bin/login" ++console_cmd %%X11BASE%%/bin/xterm -C -fg white -bg black +sb -T "Console login" -e /bin/sh -c "/bin/cat /etc/motd; exec /usr/bin/login" +suspend_cmd /usr/sbin/acpiconf -s 3 - # This command is executed after a succesful login. - # you can place the %session and %theme variables -@@ -17,8 +19,8 @@ + # Full path to the xauth binary +-xauth_path /usr/X11R6/bin/xauth ++xauth_path %%X11BASE%%/bin/xauth + + # Xauth file for server + authfile /var/run/slim.auth +@@ -32,8 +34,8 @@ # NOTE: if your system does not have bash you need # to adjust the command according to your preferred shell, # i.e. for freebsd use: @@ -29,9 +36,9 @@ +login_cmd exec /bin/sh - ~/.xinitrc %session +#login_cmd exec /bin/bash -login ~/.xinitrc %session - # Available sessions (first one is the default). - # The current chosen session name is replaced in the login_cmd -@@ -33,7 +35,7 @@ + # Commands executed when starting and exiting a session. + # They can be used for registering a X11 session with +@@ -60,7 +62,7 @@ welcome_msg Welcome to %host # shutdown / reboot messages @@ -40,7 +47,7 @@ reboot_msg The system is rebooting... # default user, leave blank or remove this line -@@ -45,7 +47,7 @@ +@@ -72,7 +74,7 @@ current_theme default # Lock file diff -urpN /usr/ports/x11/slim/files/slim.sh.in ports/x11/slim/files/slim.sh.in --- /usr/ports/x11/slim/files/slim.sh.in Sun Jan 8 22:48:57 2006 +++ ports/x11/slim/files/slim.sh.in Thu Nov 16 18:11:01 2006 @@ -18,7 +18,7 @@ load_rc_config $name : ${slim_enable="NO"} -command=%%X11BASE%%/bin/slim +command=%%LOCALBASE%%/bin/slim command_args="-d" pidfile=/var/run/slim.pid -- Henrik Brix Andersen <henrik@brixandersen.dk>
On Mon, Nov 27, 2006 at 11:26:02AM +0100, Henrik Brix Andersen wrote: > Here is an updated patch containing a files/patch-app.cpp diff for > fixing this issue (I will submit this patch upstream as well). Just a FYI: the upstream author has accepted my patch for the next version of slim. Regards, Brix -- Henrik Brix Andersen <henrik@brixandersen.dk>
State Changed From-To: feedback->closed Committed. Thanks!
rafan 2006-12-11 13:01:21 UTC FreeBSD ports repository Modified files: x11/slim Makefile distinfo x11/slim/files patch-Makefile.freebsd patch-slim.conf slim.sh.in Added files: x11/slim/files patch-app.cpp Log: - Update to 1.2.6 - Move to LOCALBASE We waited the maintainer's opinion about the issue he found for 14 days. The fix is submitted to upstream and will be in next release. PR: ports/105634 Submitted by: Henrik Brix Andersen <henrik at brixandersen.dk> Approved by: Tobias Roth <ports at fsck.ch> (maintainer) Revision Changes Path 1.4 +9 -8 ports/x11/slim/Makefile 1.3 +3 -3 ports/x11/slim/distinfo 1.2 +8 -9 ports/x11/slim/files/patch-Makefile.freebsd 1.1 +37 -0 ports/x11/slim/files/patch-app.cpp (new) 1.3 +20 -13 ports/x11/slim/files/patch-slim.conf 1.2 +1 -1 ports/x11/slim/files/slim.sh.in _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"