Bug 380681 - pungi requires root to run gather and createrepo stage
pungi requires root to run gather and createrepo stage
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: pungi (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-13 13:49 EST by Josh Cogliati
Modified: 2013-01-09 20:43 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-15 15:27:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Josh Cogliati 2007-11-13 13:49:02 EST
Description of problem:
If pungi is run as a non-root user, it prints out "You must run pungi as root" 
However, pungi can be run as non-root for the Gather stage and the Createrepo
stage (possibly others, but I haven't checked).  

In fedora 7, I used the gather and createrepo stages to create a repository that
I then burned onto a DVD and used for updating other computers.  This worked
fine as a user.  Now, to do this I have to modify  /usr/bin/pungi to eliminate
the check.  

Version-Release number of selected component (if applicable):
pungi-1.1.9-1.fc8

How reproducible:
$ pungi --help
You must run pungi as root
$ pungi -G
You must run pungi as root
...

Steps to Reproduce:
1. run pungi as non-root user.
2. Watch error message even for something that would have succeeded.
3.
  
Actual results:
pungi doesn't run.

Expected results:
pungi should only output the message for the stages that cannot be run as a
regular user, or if all the stages are enabled.


Additional info:
A fix would be to move the check for root until after the command line arguments
are parsed, and only output the message if a stage that requires root is being
run.  
So:
$ pungi -G
.... run pungi gather stage.
$ pungi -I
You must run the pungi CreateISO stage as root.

Alternatively, create a --force-no-root-check argument that causes the uid=0
check to be ignored.  
So: 
$ pungi -G
You must run pungi as root
$ pungi --help 
...
 --force-no-root-check  Disables root check.  May cause pungi to fail later.
...
$ pungi -G --force-no-root-check
Warning: running pungi as user.  May fail.
... rest of pungi running.
Comment 1 Jesse Keating 2007-11-15 15:27:55 EST
Filed https://hosted.fedoraproject.org/projects/pungi/ticket/56 , will track there.

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