Bug 380681 - pungi requires root to run gather and createrepo stage
Summary: pungi requires root to run gather and createrepo stage
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: pungi
Version: 8
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: David Cantrell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-13 18:49 UTC by Josh Cogliati
Modified: 2013-01-10 01:43 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-15 20:27:55 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Josh Cogliati 2007-11-13 18:49:02 UTC
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 20:27:55 UTC
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.