In subsection FLAGS it will be checked if the section name FLAG is korrect

isdnlog recognize calls abroad
bugfix for program starts
This commit is contained in:
luethje 1997-06-22 23:03:23 +00:00
parent 61a65e70af
commit 89c36037c0
4 changed files with 65 additions and 31 deletions

View File

@ -1,4 +1,4 @@
/* $Id: isdnlog.c,v 1.12 1997/05/25 19:40:58 luethje Exp $
/* $Id: isdnlog.c,v 1.13 1997/06/22 23:03:23 luethje Exp $
*
* ISDN accounting for isdn4linux. (log-module)
*
@ -19,6 +19,11 @@
* along with this program; if not, write to the Free Software
*
* $Log: isdnlog.c,v $
* Revision 1.13 1997/06/22 23:03:23 luethje
* In subsection FLAGS it will be checked if the section name FLAG is korrect
* isdnlog recognize calls abroad
* bugfix for program starts
*
* Revision 1.12 1997/05/25 19:40:58 luethje
* isdnlog: close all files and open again after kill -HUP
* isdnrep: support vbox version 2.0
@ -874,8 +879,8 @@ int main(int argc, char *argv[], char *envp[])
if (!verbose || ((fprot = fopen(tmpout, "a")) != (FILE *)NULL)) {
for (i = 0; i < MAXCHAN; i++)
clearchan(i, 1);
for (i = 0; i < MAXCHAN; i++)
clearchan(i, 1);
#ifdef Q931
if (q931dmp) {

View File

@ -1,4 +1,4 @@
/* $Id: processor.c,v 1.8 1997/05/29 17:07:22 akool Exp $
/* $Id: processor.c,v 1.9 1997/06/22 23:03:25 luethje Exp $
*
* ISDN accounting for isdn4linux. (log-module)
*
@ -19,6 +19,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: processor.c,v $
* Revision 1.9 1997/06/22 23:03:25 luethje
* In subsection FLAGS it will be checked if the section name FLAG is korrect
* isdnlog recognize calls abroad
* bugfix for program starts
*
* Revision 1.8 1997/05/29 17:07:22 akool
* 1TR6 fix
* suppress some noisy messages (Bearer, Channel, Progress) - can be reenabled with log-level 0x1000
@ -1233,10 +1238,13 @@ static void buildnumber(char *num, int oc3, int oc3a, char *result, int version)
if (*num != '0')
sprintf(result, "%s%s", mycountry, myarea);
else {
strcpy(result, mycountry);
if (num[1] != '0') /* Falls es doch Ausland ist -> nichts machen!!! */
strcpy(result, mycountry);
else
strcpy(result, countryprefix);
while (*num && (*num == '0'))
num++;
while (*num && (*num == '0'))
num++;
} /* else */
} /* if */
break;

View File

@ -1,4 +1,4 @@
/* $Id: start_prog.c,v 1.9 1997/06/15 23:49:38 luethje Exp $
/* $Id: start_prog.c,v 1.10 1997/06/22 23:03:28 luethje Exp $
*
* ISDN accounting for isdn4linux.
*
@ -20,6 +20,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: start_prog.c,v $
* Revision 1.10 1997/06/22 23:03:28 luethje
* In subsection FLAGS it will be checked if the section name FLAG is korrect
* isdnlog recognize calls abroad
* bugfix for program starts
*
* Revision 1.9 1997/06/15 23:49:38 luethje
* Some new variables for the isdnlog
* isdnlog starts programs noe with the file system rights
@ -106,24 +111,29 @@ static int set_user(char *User, char *File)
struct passwd* Ptr = NULL;
struct stat filestat;
if (User == NULL || User[0] == '\0')
return 0;
setpwent();
while ((Ptr = getpwent()) != NULL)
if (User != NULL && User[0] != '\0')
{
if (!strcmp(Ptr->pw_name,User) || atoi(User) == (int) Ptr->pw_uid)
setpwent();
while ((Ptr = getpwent()) != NULL)
{
endpwent();
return setuid(Ptr->pw_uid);
if (!strcmp(Ptr->pw_name,User) || (isdigit(*User) && atoi(User) == (int) Ptr->pw_uid))
{
endpwent();
print_msg(PRT_DEBUG_RING, "New user is %d set by USER\n",(int) Ptr->pw_uid);
return setuid(Ptr->pw_uid);
}
}
endpwent();
}
endpwent();
if (!stat(File,&filestat))
{
print_msg(PRT_DEBUG_RING, "New user is %d set by filestat\n",(int) filestat.st_uid);
return setuid(filestat.st_uid);
}
return 0;
}
@ -136,25 +146,28 @@ static int set_group(char *Group, char *File)
struct stat filestat;
if (Group == NULL || Group[0] == '\0')
return 0;
setgrent();
while ((Ptr = getgrent()) != NULL)
if (Group != NULL && Group[0] != '\0')
{
if (!strcmp(Ptr->gr_name,Group) || atoi(Group) == (int) Ptr->gr_gid)
setgrent();
while ((Ptr = getgrent()) != NULL)
{
endgrent();
return setgid(Ptr->gr_gid);
if (!strcmp(Ptr->gr_name,Group) || (isdigit(*Group) && atoi(Group) == (int) Ptr->gr_gid))
{
endgrent();
print_msg(PRT_DEBUG_RING, "New group is %d set by GROUP\n",(int) Ptr->gr_gid);
return setgid(Ptr->gr_gid);
}
}
endgrent();
}
endgrent();
if (!stat(File,&filestat))
{
print_msg(PRT_DEBUG_RING, "New group is %d set by filestat\n",(int) filestat.st_gid);
return setgid(filestat.st_gid);
}
return 0;
}

View File

@ -1,4 +1,4 @@
/* $Id: isdnconf.c,v 1.11 1997/05/25 19:41:13 luethje Exp $
/* $Id: isdnconf.c,v 1.12 1997/06/22 23:03:34 luethje Exp $
*
* ISDN accounting for isdn4linux. (Utilities)
*
@ -20,6 +20,11 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: isdnconf.c,v $
* Revision 1.12 1997/06/22 23:03:34 luethje
* In subsection FLAGS it will be checked if the section name FLAG is korrect
* isdnlog recognize calls abroad
* bugfix for program starts
*
* Revision 1.11 1997/05/25 19:41:13 luethje
* isdnlog: close all files and open again after kill -HUP
* isdnrep: support vbox version 2.0
@ -1180,6 +1185,9 @@ static info_args** Set_Flags(section *SPtr, int *Flags)
RetCode = Set_Flags(SPtr->next,Flags);
if (strcmp(SPtr->name,CONF_SEC_FLAG))
return RetCode;
RetCode = realloc(RetCode, sizeof(info_args*) * (NumArgs+2));
RetCode[NumArgs] = (info_args*) calloc(1, sizeof(info_args));