Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Desktop (http://www.linux-archive.org/ubuntu-desktop/)
-   -   Check if firstboot is run under root (#816628) (http://www.linux-archive.org/ubuntu-desktop/662191-check-if-firstboot-run-under-root-816628-a.html)

Martin Gracik 05-02-2012 11:23 AM

Check if firstboot is run under root (#816628)
 
---
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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 06:35 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.