FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Desktop

 
 
LinkBack Thread Tools
 
Old 05-02-2012, 11:23 AM
Martin Gracik
 
Default 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
 

Thread Tools




All times are GMT. The time now is 08:41 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org