Changing to the dialout group added
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1015 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
9
fhem.pl
9
fhem.pl
@@ -167,7 +167,7 @@ my $nextat; # Time when next timer will be triggered.
|
||||
my $intAtCnt=0;
|
||||
my %duplicate; # Pool of received msg for multi-fhz/cul setups
|
||||
my $duplidx=0; # helper for the above pool
|
||||
my $cvsid = '$Id: fhem.pl,v 1.151 2011-09-12 15:22:06 rudolfkoenig Exp $';
|
||||
my $cvsid = '$Id: fhem.pl,v 1.152 2011-09-23 11:52:00 rudolfkoenig Exp $';
|
||||
my $namedef =
|
||||
"where <name> is either:\n" .
|
||||
"- a single device name\n" .
|
||||
@@ -251,6 +251,13 @@ if(int(@ARGV) != 1 && int(@ARGV) != 2) {
|
||||
|
||||
# If started as root, and there is a fhem user in the /etc/passwd, su to it
|
||||
if($^O !~ m/Win/ && $< == 0) {
|
||||
|
||||
my @gr = getgrnam("dialout");
|
||||
if(@gr) {
|
||||
use POSIX qw(setgid);
|
||||
setgid($gr[2]);
|
||||
}
|
||||
|
||||
my @pw = getpwnam("fhem");
|
||||
if(@pw) {
|
||||
use POSIX qw(setuid);
|
||||
|
||||
Reference in New Issue
Block a user