ports/139594: [patch] x11/slim does not setlogin()

Henry Hu henry.hu.sh at gmail.com
Wed Oct 14 08:40:02 UTC 2009


>Number:         139594
>Category:       ports
>Synopsis:       [patch] x11/slim does not setlogin()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 14 08:40:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Henry Hu
>Release:        FreeBSD 7.2-STABLE
>Organization:
Tsinghua University, Beijing, China
>Environment:
FreeBSD henryhu 7.2-STABLE FreeBSD 7.2-STABLE #8: Thu Sep 10 23:11:14 CST 2009     root at henryhu:/usr/obj/usr/src/sys/MYKERNEL  i386

>Description:
x11/slim, as a login manager, does not setlogin(). Some software use getlogin() to decide the user name, so when user is using slim as the login manager, those software would get wrong results, and some programs refuse to start.
>How-To-Repeat:
1. Install x11/slim and enable it
2. Install textproc/ibus and try to start it
>Fix:
Apply the patch, which does setsid() and setlogin()

Patch attached with submission follows:

--- work/slim-1.3.1/switchuser.cpp	2009-10-14 16:28:20.000000000 +0800
+++ /home/henryhu/switchuser.cpp	2009-10-14 16:34:23.000000000 +0800
@@ -38,6 +38,8 @@
 
 void SwitchUser::SetUserId() {
     if( (Pw == 0) ||
+            (setsid() == -1) ||
+            (setlogin(Pw->pw_name) != 0) ||
             (initgroups(Pw->pw_name, Pw->pw_gid) != 0) ||
             (setgid(Pw->pw_gid) != 0) ||
             (setuid(Pw->pw_uid) != 0) ) {


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list