After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 583660 - gdm fails to call setusercontext
gdm fails to call setusercontext
Status: RESOLVED INCOMPLETE
Product: gdm
Classification: Core
Component: general
2.26.x
Other All
: Normal major
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-23 17:27 UTC by Thomas Quinot
Modified: 2010-05-29 13:59 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
proposed patch against gdm 2.26.1 sources (2.17 KB, patch)
2009-05-23 17:28 UTC, Thomas Quinot
none Details | Review

Description Thomas Quinot 2009-05-23 17:27:38 UTC
Please describe the problem:
When starting a session on systems that have login_cap.h, gdm does not call setusercontext anymore as it used to do. This causes an invalid value to be returned by subsequent getlogin() calls within the session, and failure to set the PATH environment variable as defined in system configuration (e.g. /etc/login.conf on FreeBSD systems).

Steps to reproduce:
1. Login in using gdm on a FreeBSD system as a non-root user
2. Notice that getlogin(2) still returns "root"
3. Notice that PATH settings from /etc/login.conf haven't been taken into account.


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Thomas Quinot 2009-05-23 17:28:43 UTC
Created attachment 135243 [details] [review]
proposed patch against gdm 2.26.1 sources

This patch re-adds a call to setusercontext as it used to exist in earlier versions of gdm, and appears to indeed fix the described issue on this system.
Comment 2 Thomas Quinot 2009-05-27 11:02:19 UTC
See also FreeBSD PR ports/133793 at
http://www.freebsd.org/cgi/query-pr.cgi?pr=133793
Comment 3 Ray Strode [halfline] 2009-07-15 19:50:46 UTC
So, you do:

 if (setusercontext (NULL, pwent, pwent->pw_uid,
+                            LOGIN_SETLOGIN | LOGIN_SETPATH |
+                            LOGIN_SETPRIORITY | LOGIN_SETRESOURCES |
+                            LOGIN_SETUMASK | LOGIN_SETUSER |
+                            LOGIN_SETENV) < 0) {


LOGIN_SETLOGIN makes sense, but SETPATH, SETUMASK, and SETENV get immediately overwritten afterward right?  Also, SETUSER would as well if you dropped the #else block and just called in unconditionally.

I wonder if we can just call setlogin() instead?  This would drop the potentially costly call to get to getpwnam().

Comment 4 Tobias Mueller 2010-04-06 11:35:25 UTC
Thomas, can you address the questions raised in comment #3?
Comment 5 Tobias Mueller 2010-05-29 13:59:27 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!