| Summary: | urpmi fails to run via sudo if current directory is on a nfs-share | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | Hartmut Goebel <h.goebel> |
| Component: | RPM Packages | Assignee: | Mageia tools maintainers <mageiatools> |
| Status: | REOPENED --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | thierry.vignaud |
| Version: | Cauldron | Keywords: | PATCH |
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| See Also: | https://bugs.mageia.org/show_bug.cgi?id=17202 | ||
| Whiteboard: | MGA5TOO | ||
| Source RPM: | urpmi-8.06-1.mga5.src.rpm | CVE: | |
| Status comment: | workaround available, need to decide if will be implemented in urpmi | ||
| Attachments: | proposed patch: chdir befroe starting urpm::main_loop::run | ||
|
Description
Hartmut Goebel
2014-02-17 09:47:59 CET
Hartmut Goebel
2014-02-17 09:48:12 CET
Source RPM:
(none) =>
urpmi-7.27.3-2.mga3 My analysis seams to be wrong: I ran sudo urpmi --auto-update on a different directory which is on the same nfs-share and it worked. In this directory, the command failed: $ getfacl ~ # file: home/johndoe # owner: johndoe # group: johndoe user::rwx user:501:rwx #effective:--x [[501 is a obsolete user id]] group::r-x #effective:--x mask::--x other::--x In this directory, the command worked: $ getfacl ~/Downloads/ # file: home/johndoe/Downloads/ # owner: johndoe # group: johndoe user::rwx group::r-x other::r-x So differences in ~/Downloads are: - no mask defined - "others" have read permissions. Please give me hints how I can help debugging this. You cannot. The NFS server simply denies access to root according to file permissions. You could either not call "sudo urpmi" from such a directory or alter your permissions, but it's much simpler to use "sudo -i urpmi". See sudo man page. Status:
NEW =>
RESOLVED Thierry, why at all does urpmi *require* access to the current directory? This, IMHO, is the bug. Status:
RESOLVED =>
REOPENED It doesn't. librpm does. (lib/rpmchroot.c) It needs to keep an open file descriptor on the current working directory in order to go out of the chroot in case it needs to chroot. Status:
REOPENED =>
RESOLVED JFTR: This only fails if the current directory is on a nfs-share with root_sqash. On a local directory, root can always read. This still fails on Mageia 5. Proposed solution: Just before starting urpm::main_loop::run, chdir to some directory root is able to write to, e.g. /tmp. I tested this and this solves the problem. Patch attached. You may wan to choose some other directory, e.g $HOME (wich need to be root's home, tough). Status:
RESOLVED =>
REOPENED Created attachment 7218 [details]
proposed patch: chdir befroe starting urpm::main_loop::run
Hartmut Goebel
2015-11-19 12:47:41 CET
Keywords:
(none) =>
PATCH
Thierry Vignaud
2016-07-11 17:30:49 CEST
See Also:
(none) =>
https://bugs.mageia.org/show_bug.cgi?id=17202
Samuel Verschelde
2016-10-17 14:22:46 CEST
Status comment:
(none) =>
workaround available, need to decide if will be implemented in urpmi
Samuel Verschelde
2016-10-17 14:23:02 CEST
Version:
5 =>
Cauldron Comment on attachment 7218 [details]
proposed patch: chdir befroe starting urpm::main_loop::run
We'd rather chdir() to "/" rather than "/tmp", it's guaranteed to exist
|