Skip to content

Commit

Permalink
allow comments in config-file like this: allow-ip 8.8.8.8 #Google DNS
Browse files Browse the repository at this point in the history
  • Loading branch information
Root User committed Mar 22, 2019
1 parent 4a8f936 commit 7826756
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pam_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,15 @@ return(RetStr);
void ParseSettingLine(TSettings *Settings, const char *Line)
{
const char *ptr;
char *Config=NULL;

if (! StrLen(Line)) return;
ptr=Line;

//anything after a '#' is comment
GetTok(Line, "#", &Config);
StripTrailingWhitespace(Config);
ptr=Config;

if (strcmp(ptr,"syslog")==0) Settings->Flags |= FLAG_SYSLOG;
else if (strncmp(ptr,"user=",5)==0) Settings->User=CopyStr(Settings->User, ptr+5);
Expand All @@ -246,6 +251,8 @@ const char *ptr;
else if (strncmp(ptr,"dnswhitelist=",13)==0) Settings->DNSWhiteLists=MCatStr(Settings->DNSWhiteLists, ptr+13,",",NULL);
else if (strncmp(ptr,"dnsblacklist=",13)==0) Settings->DNSBlackLists=MCatStr(Settings->DNSBlackLists, ptr+13,",",NULL);
else if (strncmp(ptr,"script=",7)==0) Settings->Script=MCopyStr(Settings->Script, ptr+7, NULL);

Destroy(Config);
}


Expand Down

0 comments on commit 7826756

Please # to comment.