Bug 6083 - online upgrade fails if a download directory not owned by root is selected
Summary: online upgrade fails if a download directory not owned by root is selected
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 1
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
: 6114 6305 (view as bug list)
Depends on: 6114
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-25 14:40 CEST by José Jorge
Modified: 2021-04-05 13:01 CEST (History)
5 users (show)

See Also:
Source RPM: mgaonline
CVE:
Status comment:


Attachments

Description José Jorge 2012-05-25 14:40:12 CEST
Description of problem:
1.From an updated 1, click on upgrade, ask to download all before install.
2.Then select where to download, I choose my home downloads directory.
3. Click "next", it fails saying the owner of the directory is not good.

End of the log :
....
webkit-1.8.1-1.mga2.x86_64
webkit1.0-1.8.1-1.mga2.x86_64
(118 paquetages, 279 Mo)
=> ok(auto)
Vidage du répertoire /var/cache/urpmi/partial et de /var/cache/urpmi/rpms
propriétaire invalide pour le répertoire /home/jose/Téléchargements
unlocking rpm database
unlocking urpmi database
Comment 1 Manuel Hiebel 2012-05-27 12:21:31 CEST
what said ll /home/jose/Té* ?
Manuel Hiebel 2012-05-27 13:48:35 CEST

Depends on: (none) => 6114

Comment 2 Manuel Hiebel 2012-06-03 13:39:25 CEST
*** Bug 6305 has been marked as a duplicate of this bug. ***

CC: (none) => marcello.anni

Comment 3 José Jorge 2012-06-03 20:19:29 CEST
(In reply to comment #1)
> what said ll /home/jose/Té* ?

ll nothing, but ls -al :
drwxr-xr-x   6 jose jose     12288 Jun  1 20:50 ./
drwxr-xr-x 158 jose jose     12288 Jun  3 20:13 ../

well this are the normal permissions for a users folder...
Comment 4 Marcello Anni 2012-06-18 13:59:52 CEST
news?
Manuel Hiebel 2012-06-22 13:45:03 CEST

Component: Installer => RPM Packages

Comment 5 Thierry Vignaud 2012-09-07 17:13:59 CEST
This messages cames from urpmi, when it fails to write in that directory which should be possible according to what you posted

CC: (none) => thierry.vignaud

Comment 6 Thierry Vignaud 2012-09-07 17:14:37 CEST
Unless UTF-8 got mangled somewhere.
Comment 7 Thierry Vignaud 2012-09-07 17:48:15 CEST
The message is unclear bug the real reason is that urpmi we refuse to download in a directory not owned by root for security reason.

Summary: online upgrade fails if a directory is selected => online upgrade fails if a download directory not owned by root is selected
Status: NEW => ASSIGNED

Comment 8 Thierry Vignaud 2012-09-07 18:07:50 CEST
Fixed in git

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED

Comment 9 Manuel Hiebel 2012-09-07 18:31:07 CEST
(In reply to comment #7)
> The message is unclear bug the real reason is that urpmi we refuse to download
> in a directory not owned by root for security reason.

exaclty see https://bugs.mageia.org/show_bug.cgi?id=6114

can you backport the fix in mga2 at least for not have again the bug on the >mga3 upgrade ?
Comment 10 Thierry Vignaud 2012-09-07 19:18:07 CEST
*** Bug 6114 has been marked as a duplicate of this bug. ***

CC: (none) => doktor5000

Comment 11 Thierry Vignaud 2012-09-07 19:18:21 CEST
A backport is intended.
Comment 12 José Jorge 2012-09-07 20:39:30 CEST
(In reply to comment #11)
> A backport is intended.

I can test it right now if it is backported to MGA1 : I will migrate a system to MGA2.
Comment 13 Marcello Anni 2012-09-07 22:02:43 CEST
i'm too should be available to test it, thierry please let me know.
Comment 14 Jean-Christophe Cardot 2021-04-04 20:20:54 CEST
I have a (small) problem with this commit: it does not work if /var/cache/urpmi is a link e.g. to /home/var/cache/urpmi.
In this case, the applet says: "Vous devez spécifier un répertoire appartenant à l'administrateur système"
Of course, the all folders in the hierarchy /home/var/cache/urpmi belong to root, but the applet is looking at /var/cache/urpmi, and the following code (line 401 of mgaapplet):
my $ok = -d $temp_dir && ! -l $temp_dir && ((stat($temp_dir))[4] == 0);
prevents that the temporary dir be a link.

Why are the links "forbidden" by the "! -l"?

Should not we change this to:

-l $temp_dir && $temp_dir = readlink($temp_dir);
my $ok = -d $temp_dir && ((stat($temp_dir))[4] == 0);

What do you think Thierry?

CC: (none) => mageia

Comment 15 Morgan Leijström 2021-04-05 13:01:38 CEST
Does it work at all even for normal folder in home for you?

I now entered:

Bug 28724 - mgaapplet upgrade: asks where to first download all packages but dont respect neither location nor "all first"

CC: (none) => fri


Note You need to log in before you can comment on or make changes to this bug.