3 ** User and post tracking database.
9 #include "inn/innconf.h"
14 /* TrackClient determines whether or not
15 we are interested in tracking the activities
16 of the currently connected host. We have to
17 rely on an external process to set up the
18 entries in the database though which makes
19 this only as reliable as the process that
23 /* Format of the input line is <host>:<username>
26 int TrackClient(char *client, char *user)
30 char line[MAX_LEN],*p,*pp,*lp;
33 dbfile = concatpath(innconf->pathetc, "nnrpd.track");
36 strcpy(user, "unknown");
38 if ((fd=fopen(dbfile,"r"))!=NULL) {
39 while((fgets(line,(MAX_LEN - 1),fd))!=NULL) {
40 if (line[0] == '#' || line[0] == '\n') continue;
41 if ((p=strchr(line,' ')) != NULL) *p='\0';
42 if ((p=strchr(line,'\n')) != NULL) *p='\0';
43 if ((p=strchr(line,':')) != NULL) {
49 if ((lp=strchr(pp,'*')) != NULL) {
52 if (strstr(client,pp)!=NULL) {
62 syslog(L_NOTICE, "%s No logging - can't read %s", ClientHost, dbfile);