[Bug 195759] x11/slim fails to honour login.conf

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Dec 16 03:21:31 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195759

--- Comment #4 from Henry Hu <henry.hu.sh at gmail.com> ---
(In reply to Jonathan Chen from comment #3)
> I had a quick look, and I believe that patch-switchuser.cpp should make use
> of setusercontext() in login_class(3); instead of just setlogin(2).

Nice catch. It seems like that we can replace multiple calls with a single
setusercontext():
setlogin -> LOGIN_SETLOGIN
initgroups, setgid -> LOGIN_SETGROUP
setuid -> LOGIN_SETUSER

and other problems are solved as well:
path -> LOGIN_SETPATH
lang -> LOGIN_SETENV

seems like that we should just use LOGIN_SETALL.

To get the login_cap_t, currently I'm using login_getpwclass(). I should use
login_getuserclass() at the same time, and query the later one first, and turn
to the first one if something is not present in the later one. However,
setusercontext() does not support this, so just use login_getpwclass() for now.

I've created a patch for this. Please test it. I'm not sure if all these APIs
are present on older systems.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list