[firstboot 1/2] Check if firstboot is run under root (#816628)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 progs/firstboot |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/progs/firstboot b/progs/firstboot
index e7a08e6..754bcdf 100755
--- a/progs/firstboot
+++ b/progs/firstboot
@@ -51,6 +51,11 @@ sys.excepthook = exception_handler
 
 if __name__ == '__main__':
 
+    # only root can do this
+    if not os.geteuid() == 0:
+        print >> sys.stderr, 'only root can do this'
+        sys.exit(1)
+
     parser = optparse.OptionParser()
     parser.add_option('-m', '--moduledir', dest='module_dir')
     parser.add_option('-r', '--reconfig',
-- 
1.7.5.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux