Bug 861113
Summary: | FTP client does not expand home directory correctly after sudo or su | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Danny Oscar Kip <d.o.kip> | ||||
Component: | ftp | Assignee: | Jan Synacek <jsynacek> | ||||
Status: | CLOSED ERRATA | QA Contact: | Lukas "krteknet" Novy <lnovy> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 6.1 | CC: | dapospis, ebenes, lnovy | ||||
Target Milestone: | rc | Keywords: | Patch | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2013-05-21 08:16:49 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Danny Oscar Kip
2012-09-27 14:26:56 UTC
The fact that FTP client takes itÅ› user from /proc/self/loginuid also causes it to propose that originating user as the login user, which is also not correct. But that is not usually a problem, since you can easily supply the user. Created attachment 620658 [details]
[Patch] don't use getlogin()
Quoting man getlogin(3):
"getlogin() returns a pointer to a string containing the name of the user logged in on the controlling terminal of the process"
"Unfortunately, it is often rather easy to fool getlogin(). Sometimes it does not work at all, because some program messed up the utmp file. Often, it gives only the first 8 characters of the login name. The user currently logged in on the controlling tty of our program need not be the user who started it. Avoid getlogin() for security-related purposes."
Just in case nobody noticed: my example was incorrectly pasted, there is a ~ missing after the 'lcd' command. Just issueing 'lcd' will only display your current local dir, not change it. Though I would consider this unexpected behaviour (as 'cd' would take you to your homedir in a shell), and it really would need a 'lpwd' to replace this, the example of this bug as I provided would be an incorrect representation of the actual bug. So please use 'lcd ~' to reproduce correctly. Even the default username just after the connection was not correct. Ftp was using getlogin() which simply doesn't work correctly in this case. The ftp client from the Kerberos workstation package exhibits the same behaviour. In my particular case: /usr/kerberos/bin/ftp from krb5-workstation-1.6.1-31.el5_3.3.i386 Interestingly, that implementation does in fact go to the homedir when entering just 'lcd', instead of just behaving like a local 'pwd' (as /usr/bin/ftp does) The plot thickens :) Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0845.html |