Skip to content

Commit

Permalink
Merge pull request #497 from pi-hole/release/v4.2.1
Browse files Browse the repository at this point in the history
Pi-hole FTL v4.2.1
  • Loading branch information
dschaper authored Feb 7, 2019
2 parents 178cc52 + d2a71a0 commit 5f98312
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
6 changes: 4 additions & 2 deletions dnsmasq/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@
#define HOSTSFILE "/etc/hosts"
#define ETHERSFILE "/etc/ethers"
#define DEFLEASE 3600 /* default lease time, 1 hour */
#define CHUSER "nobody"
#define CHGRP "dip"
/**** Pi-hole modification ****/
#define CHUSER "root"
#define CHGRP "root"
/******************************/
#define TFTP_MAX_CONNECTIONS 50 /* max simultaneous connections */
#define LOG_MAX 5 /* log-queue length */
#define RANDFILE "/dev/urandom"
Expand Down
6 changes: 4 additions & 2 deletions dnsmasq/rfc1035.c
Original file line number Diff line number Diff line change
Expand Up @@ -1725,8 +1725,10 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
nxdomain = 1;
if (!dryrun)
{
log_query(crecp->flags, name, NULL, NULL);
FTL_cache(crecp->flags, name, NULL, NULL, daemon->log_display_id);
// Pi-hole modification: Added record_source(crecp->uid) such that the subroutines know
// where the reply dame from (e.g. gravity.list)
log_query(crecp->flags, name, NULL, record_source(crecp->uid));
FTL_cache(crecp->flags, name, NULL, record_source(crecp->uid), daemon->log_display_id);
}
}
else
Expand Down
7 changes: 5 additions & 2 deletions log.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,14 @@ void log_counter_info(void)
logg(" -> Known forward destinations: %i", counters->forwarded);
}

void log_FTL_version(void)
void log_FTL_version(bool crashreport)
{
logg("FTL branch: %s", GIT_BRANCH);
logg("FTL version: %s", GIT_TAG);
logg("FTL commit: %s", GIT_HASH);
logg("FTL date: %s", GIT_DATE);
logg("FTL user: %s", username);
if(crashreport)
logg("FTL user: started as %s, ended as %s", username, getUserName());
else
logg("FTL user: %s", username);
}
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main (int argc, char* argv[])
open_FTL_log(true);
timer_start(EXIT_TIMER);
logg("########## FTL started! ##########");
log_FTL_version();
log_FTL_version(false);

// Initialize shared memory
if(!init_shmem())
Expand Down
2 changes: 1 addition & 1 deletion routines.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void logg(const char* format, ...);
void logg_struct_resize(const char* str, int to, int step);
void log_counter_info(void);
void format_memory_size(char *prefix, unsigned long int bytes, double *formated);
void log_FTL_version(void);
void log_FTL_version(bool crashreport);

// datastructure.c
void gettimestamp(int *querytimestamp, int *overTimetimestamp);
Expand Down
2 changes: 1 addition & 1 deletion signals.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static void SIGSEGV_handler(int sig, siginfo_t *si, void *unused)
{
logg("FTL has been running for %i seconds", time(NULL)-FTLstarttime);
}
log_FTL_version();
log_FTL_version(true);

logg("Received signal: %s", strsignal(sig));
logg(" at address: %lu", (unsigned long) si->si_addr);
Expand Down

0 comments on commit 5f98312

Please sign in to comment.