Unix file path `~foo` should expand to `/home/foo`
Categories
(Core :: XPCOM, defect, P3)
Tracking
()
People
(Reporter: vinny.diehl, Assigned: vinny.diehl)
References
(Regressed 1 open bug)
Details
Attachments
(1 file)
While implementing Bug 93141 I noticed that home directories for arbitrary users do not expand properly, e.g. ~foo/bar should expand to /home/foo/bar. We will need to modify nsLocalFile::InitWithNativePath.
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 1•2 years ago
|
||
| Assignee | ||
Comment 2•2 years ago
|
||
I've added a patch for this. The /home/<USERNAME> syntax is hardcoded and thus this relies on the default home directory having not been changed. We could parse the actual home directory out of /etc/passwd I suppose, but according to my testing Chrome doesn't go this far, so this patch achieves parity as implemented.
Comment 3•2 years ago
|
||
Posix provides getpwnam_r to find the home of a given user.
Updated•2 years ago
|
| Assignee | ||
Comment 4•2 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #3)
Posix provides getpwnam_r to find the home of a given user.
My latest revision implements this suggestion. Chromium explicitly avoids such an implementation, calling it a "nasty blocking call". Do you think there is any merit to this aversion? I don't see much of a risk here.
Comment 5•2 years ago
|
||
Yeah, there's merit to it, considering the password database might be coming from the NIS authentication server, with non-deterministic overhead. BUT, relying on something else than that would be unreliable.
Comment 7•2 years ago
|
||
Backed out for causing gtest crashes.
- Backout link
- Push with failures
- Failure Log
- Failure line: PROCESS-CRASH | MOZ_ASSERT(mRawPtr != nullptr) (You can't dereference a NULL nsCOMPtr with operator->().) [@ nsCOMPtr<nsIFile>::operator->] | gtest
| Assignee | ||
Comment 8•2 years ago
|
||
Looks like these tests are busted on Android. Would you mind vouching for me for try access so I can work this out?
Comment 9•2 years ago
|
||
Hello Vinny! Sorry, but unfortunately I'm not able to vouch for you.. Maybe Aryx could help you in this matter.
Comment 10•2 years ago
|
||
Hi Vinny. To be able to use Try, you need commit access. Please read here how to get access and mention the bug here or put me into the CC to make aware of it and I can then vouch for you.
| Assignee | ||
Comment 11•2 years ago
|
||
Hi :aryx, thank you! I've opened a commit access request at Bug 1852188.
Comment 12•2 years ago
|
||
There is an r+ patch which didn't land and no activity in this bug for 2 weeks.
:vinny.diehl, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 13•2 years ago
•
|
||
:nika I think this is ready to re-land :)
Edit: sorry, this ni? shouldn't have been cleared.
| Assignee | ||
Updated•2 years ago
|
Comment 14•2 years ago
|
||
Comment 16•2 years ago
|
||
| bugherder | ||
Comment 17•2 years ago
|
||
Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.
Comment 18•2 years ago
|
||
The patch landed in nightly and beta is affected.
:vinny.diehl, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox119towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 19•2 years ago
|
||
This is a somewhat fringe feature, much less common than ~. This can ride the trains.
Description
•