rhinstaller / fedup

Deprecated Fedora Upgrade tool
GNU General Public License v2.0
23 stars 13 forks source link

fedup-cli fails if not run as user w/ superuser privileges #2

Closed tflink closed 12 years ago

tflink commented 12 years ago

After installing fedup, it is possible to run fedup-cli as a non-root user without using sudo. If this happens, all the packages are downloaded without issue but right after the upgrade transaction is tested, the following error message shows up:

testing upgrade transaction
rpm transaction 100% [=========================================================================================]
rpm install 100% [=============================================================================================]
setting up system for upgrade
Traceback (most recent call last):
  File "/usr/bin/fedup-cli", line 179, in <module>
    main(args)
  File "/usr/bin/fedup-cli", line 167, in main
    prep_upgrade(pkgs, bootloader=args.bootloader)
  File "/usr/lib/python2.7/site-packages/fedup/download.py", line 211, in prep_upgrade
    link_pkgs(pkgs)
  File "/usr/lib/python2.7/site-packages/fedup/download.py", line 141, in link_pkgs
    os.mkdir(packagedir, 0755)
OSError: [Errno 13] Permission denied: '/var/lib/fedora-upgrade'

I was able to re-run fedup-cli using sudo and it completed without issue.

fedup should probably check for privileges before starting in order to avoid this error

tflink commented 12 years ago

Another side effect of not checking is that adding a non-standard repo fails when running as non-root with no error message about privileges - I had to hack in a log message to figure out why it was failing

wgwoods commented 12 years ago

I left that out intentionally because I was going to use polkit to get privs rather than just a dumb "hey are you root?" check at the start.

Obviously, time is running a bit short for that. I'll add the stupid check now and do the polkit stuff later.