From a578d93a9ed8c74930accfacee8b2b516421ec44 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Sun, 26 Aug 2007 19:48:49 -0400 Subject: [PATCH] Add a rootcheck, stolen from livecd-creator --- Changelog | 1 + ToDo | 2 +- pungi | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 47b90052..c37595e3 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,7 @@ * Sun Aug 26 2007 Jesse Keating - Add better support for %packages syntax using native pykickstart - Add a cache dir for pungi (/var/cache/pungi) and a cli option to override +- Add root check. * Sat Aug 25 2007 Jesse Keating - Use a kickstart file as input now (for cdsize and package manifest) diff --git a/ToDo b/ToDo index b187f310..f1ed22ee 100644 --- a/ToDo +++ b/ToDo @@ -50,7 +50,7 @@ DONE ^^ Drop all stuff but GPL, README, GPG keys, potentially README-BURNING-ISOS ? * From livecd-creator - Steal root check + Steal root check *DONE* Use same cli syntax if possible (conf -> config, etc..) * Figure out how to allow use of $releasever and $basearch diff --git a/pungi b/pungi index c38aab43..6743e156 100755 --- a/pungi +++ b/pungi @@ -22,6 +22,12 @@ import pykickstart.version from ConfigParser import SafeConfigParser def main(): + + # You must be this high to ride. + if os.geteuid () != 0: + print >> sys.stderr, "You must run livecd-creator as root" + return 1 + # Set some default variables, can be overrided in config file # Turn this into a dict someday, to iterate over when setting defaults