Well the quick fix, and maybe the best in an installer program, is to just require it to be run as root. At the entry point in your code make sure that the uid and/or gid is 0 (or username is root). Here is the perl/tk code I used to accomplish this ...
Code:
# check for root like always!
# $< is UID and $) is GID
#
if (($> ne 0) && ($) ne 0)) {
***print "You must be root or an authorized user! Bad user number $<!\n";
***$mw = MainWindow->new(-title => "Sorry");
***$l = $mw->Label(-text => "You must be root to run this program\nBad user number $<\n");
***$b = $mw->Button(-text => "exit",
********* -command => [\&exit_prog,"noask"]);
***$l->pack();
***$b->pack();
***
***MainLoop;
}
Your only other option would be to use PAM or get code from Red Hat/Mandrake that interfaces with PAM.
Bookmarks