This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年11月22日 13:01 by giampaolo.rodola, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| mywork.patch | εσχατοκυριος, 2014年06月07日 17:48 | review | ||
| Messages (6) | |||
|---|---|---|---|
| msg122117 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) | Date: 2010年11月22日 13:01 | |
http://docs.python.org/library/os.html#os.getuid os.getuid() documentation just states: > Return the current process’s user id. It is not clear, however, whether "user id" refers to real, effective or saved user id. As per: http://linux.about.com/library/cmd/blcmdl2_getuid.htm ...it should refer to _real_ user id. |
|||
| msg122123 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) | Date: 2010年11月22日 13:42 | |
Update: I think also os.getlogin() doc is wrong. This is what it states (2.7 doc): > Return the name of the user logged in on the controlling terminal of > the process. For most purposes, it is more useful to use the > environment variable LOGNAME to find out who the user is, or > pwd.getpwuid(os.getuid())[0] to get the login name of the currently > effective user id. Since os.getuid() refers to _real_ uid the last sentence should be changed as such: - ... to get the login name of the currently effective user id. + ... to get the login name of the currently real user id. |
|||
| msg122161 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2010年11月22日 20:17 | |
These are wrappers around the posix functions. As such the unix man pages are a better authority than the Python docs :) Still, we could certainly improve the docs. The getlogin error is probably a miscopy from the man page: the man page on my system shows the example as getpwuid(geteuid()), but it is actually showing a replacement for 'cuserid', not 'getlogin'. |
|||
| msg122165 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) | Date: 2010年11月22日 20:37 | |
Indeed, now that I google for "getlogin", it's not easy to figure out what kind of user it is supposed to return exactly. For getuid() it seems pretty clear that we're talking about _real_ uid, though. http://www.manpagez.com/man/2/getuid/ http://linux.die.net/man/2/getuid |
|||
| msg219954 - (view) | Author: Greg (εσχατοκυριος) * | Date: 2014年06月07日 17:48 | |
Here's a wording change in the documentation to clarify this. |
|||
| msg219973 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2014年06月07日 20:52 | |
New changeset 19172062e5c0 by Benjamin Peterson in branch '3.4': specify that getuid() returns the real uid (closes #10503) http://hg.python.org/cpython/rev/19172062e5c0 New changeset 6dfbe504f659 by Benjamin Peterson in branch '2.7': specify that getuid() returns the real uid (closes #10503) http://hg.python.org/cpython/rev/6dfbe504f659 New changeset 8866ac6f2269 by Benjamin Peterson in branch 'default': merge 3.4 (#10503) http://hg.python.org/cpython/rev/8866ac6f2269 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:09 | admin | set | github: 54712 |
| 2014年06月07日 20:52:00 | python-dev | set | status: open -> closed nosy: + python-dev messages: + msg219973 resolution: fixed stage: needs patch -> resolved |
| 2014年06月07日 17:48:07 | εσχατοκυριος | set | files:
+ mywork.patch nosy: + εσχατοκυριος messages: + msg219954 keywords: + patch |
| 2011年07月21日 17:04:57 | adam.woodbeck | set | nosy:
+ adam.woodbeck |
| 2010年11月22日 20:37:40 | giampaolo.rodola | set | messages: + msg122165 |
| 2010年11月22日 20:17:13 | r.david.murray | set | versions:
- Python 2.6 nosy: + r.david.murray messages: + msg122161 type: behavior stage: needs patch |
| 2010年11月22日 13:42:40 | giampaolo.rodola | set | messages: + msg122123 |
| 2010年11月22日 13:01:10 | giampaolo.rodola | create | |