Bug 157282 - [MAINTAINER PATCH] net/xrdp: effective login name is not set by xrdp-sesman
Summary: [MAINTAINER PATCH] net/xrdp: effective login name is not set by xrdp-sesman
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Steve Wills
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-23 21:40 UTC by Iwao Koichiro
Modified: 2012-09-09 23:20 UTC (History)
0 users

See Also:


Attachments
patch-sesman__session.c (3.00 KB, text/plain)
2011-05-23 21:40 UTC, Iwao Koichiro
no flags Details
patch-sesman__session_1.patch (3.21 KB, patch)
2011-10-27 04:39 UTC, Iwao Koichiro
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Iwao Koichiro 2011-05-23 21:40:09 UTC
xrdp is originally made for Linux, handling setlogin/getlogin is not enough for *BSD.
Some programs like mysql fail to get actual username.
Also, this may cause a security issue like FreeBSD-SA-02:07.k5su due to setlogin system call.
http://security.freebsd.org/advisories/FreeBSD-SA-02:07.k5su.asc

Added file:
 - files/patch-sesman__session.c

Fix: See attached patch.
How-To-Repeat: Login to the host via xrdp, run `id -p` on xterm, the login name will be wrong.

The result will be:
$ id -p
login	root
uid	meta
groups	meta

ex) mysql gets username as 'root' even if the actual user is not root:
$ whoami
meta
$ mysql
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Login shuld be as same as uid:
$ id -p
uid	meta
groups	meta
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-05-23 21:40:20 UTC
Class Changed
From-To: sw-bug->maintainer-update

Fix category (submitter is maintainer) (via the GNATS Auto Assign Tool)
Comment 2 Iwao Koichiro 2011-08-05 06:37:20 UTC
some bugs are found in my patch. wait until sending new one.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2011-10-15 22:26:23 UTC
State Changed
From-To: open->suspended

awaiting patch from submitter 


Comment 4 Eitan Adler freebsd_committer freebsd_triage 2011-10-15 22:26:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->eadler

awaiting patch from submitter
Comment 5 Iwao Koichiro 2011-10-27 04:39:37 UTC
new patch is ready. see attached.
the patch is also available here.
http://www.club.kyutech.ac.jp/~meta/patches/patch-sesman__session_1.patch
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2011-10-27 04:45:41 UTC
State Changed
From-To: suspended->open

Submitter has fixed.
Comment 7 Eitan Adler freebsd_committer freebsd_triage 2011-10-27 20:50:07 UTC
State Changed
From-To: open->feedback

Any chance of getting this commited upstream?
Comment 8 Eitan Adler freebsd_committer freebsd_triage 2011-10-28 16:46:21 UTC
State Changed
From-To: feedback->open

per private reply, apperently not
Comment 9 Eitan Adler freebsd_committer freebsd_triage 2011-11-02 22:02:36 UTC
Responsible Changed
From-To: eadler->freebsd-x11

ENOTIME
Comment 10 Steve Wills freebsd_committer freebsd_triage 2012-09-09 23:08:59 UTC
Responsible Changed
From-To: freebsd-x11->swills

I'll take it.
Comment 11 Steve Wills freebsd_committer freebsd_triage 2012-09-09 23:20:28 UTC
State Changed
From-To: open->closed

Committed. Thanks!