Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pi-hole FTL v5.23 #1567

Merged
merged 99 commits into from
May 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
85df4de
Merge pull request #1544 from pi-hole/master
DL6ER Mar 22, 2023
094f33a
Correct declaration for query_blocked().
Smarre Mar 24, 2023
2f29edb
Correct declaration for blockingstatus variable.
Smarre Mar 24, 2023
28ec1f0
Bump actions/stale from 7.0.0 to 8.0.0
dependabot[bot] Mar 25, 2023
5ad479b
Bump actions/checkout from 3.4.0 to 3.5.0
dependabot[bot] Mar 25, 2023
688e1d5
Add gravity parseList funtion to FTL
DL6ER Mar 25, 2023
1097d75
Only match full lines in input file
DL6ER Mar 25, 2023
19c4984
Enhance speed for ABP patterns (don't try to match domains when the l…
DL6ER Mar 25, 2023
e6ba74c
Store in the database instead of into a temporary file
DL6ER Mar 26, 2023
aa0ead7
Merge pull request #1547 from pi-hole/dependabot-github_actions-devel…
DL6ER Mar 26, 2023
16239f5
Merge pull request #1548 from pi-hole/dependabot-github_actions-devel…
DL6ER Mar 26, 2023
6a1de9f
Merge pull request #1546 from Smarre/build_fixes
DL6ER Mar 27, 2023
1a32cb6
Add a few micro-optimizations to enhance speed of the parseList funct…
DL6ER Mar 30, 2023
bed2e80
Allow TLD blocking using ABP style (port of core PR #5240)
DL6ER Mar 30, 2023
37de866
Simplify EDNS handling code and also interpret replies received from …
DL6ER Apr 7, 2023
f99bda1
Implement EDNS(0) EDE
DL6ER Apr 7, 2023
3ac34d3
Use AD bit for IN/SECURE and EDE in SERVFAIL when prox for BOGUSy-dns…
DL6ER Apr 7, 2023
8a4488c
Ignore possible EXTRA-TEXT field in EDNS0 EDE data
DL6ER Apr 7, 2023
ad85e0f
Only try to interpret EDNS EDE when EDE data is available
DL6ER Apr 8, 2023
538c6a0
Log if EDNS header is NULL and we are in debug mode
DL6ER Apr 8, 2023
72b4bc5
Analyse pseudeoheader before it might get stripped off
DL6ER Apr 9, 2023
b22524e
Initial DNSSEC status should be UNSPECIFIED
DL6ER Apr 9, 2023
f216cb0
Explicitly set INSECURE status for replies received either from upstr…
DL6ER Apr 9, 2023
d228fbf
Apply the same logic also for reverse lookups (PTR)
DL6ER Apr 9, 2023
b0bf9c0
Merge pull request #1551 from pi-hole/new/ede-dnssec
DL6ER Apr 11, 2023
d8271ad
Trigger stale workflow on issue comments to remove stale label immedi…
yubiuser Apr 15, 2023
da8d010
Bump actions/checkout from 3.5.0 to 3.5.2
dependabot[bot] Apr 15, 2023
b5c1a84
Run seperate job to trigger removal on comments
yubiuser Apr 16, 2023
71625df
Use env variable
yubiuser Apr 17, 2023
08a8a11
Update embedded Lua to 5.4.5
DL6ER Apr 30, 2023
866ca4b
Apply Pi-hole Lua patches
DL6ER Apr 30, 2023
7720db0
Merge pull request #1554 from pi-hole/update/lua_5.4.5
DL6ER May 2, 2023
49bc744
Add header analysis also in tcp_key_recurse to fix an issue with wron…
DL6ER May 3, 2023
7871ebe
Add extra debugging output
DL6ER May 4, 2023
a2746d7
Also analyze UDP reply headers
DL6ER May 4, 2023
f8dbd2b
Merge pull request #1555 from pi-hole/fix/server_key_recurse
DL6ER May 4, 2023
51ca8f3
Do not log running out of disk space when the disk occupation is > 10…
DL6ER May 7, 2023
b847da4
Merge pull request #1556 from pi-hole/fix/macOS_exabytes
DL6ER May 8, 2023
b05ada4
Move dhcp-discover into a dedicated "tools" target
DL6ER May 13, 2023
29a3310
Add pihole-FTL arp-scan [{-v,-a}]
DL6ER May 13, 2023
36bd2a5
Unify warning
DL6ER May 13, 2023
26396bd
Use dedicated counters per MAC for a more accurate per-device reply m…
DL6ER May 14, 2023
65d5b12
Add our own address to the scan results so we can detect IP conflicts…
DL6ER May 14, 2023
0e74485
Include hostnames (if available)
DL6ER May 14, 2023
d6695eb
Update embedded Lua to 5.4.6
DL6ER May 14, 2023
ec72408
Re-apply Pi-hole specific Lua patches
DL6ER May 14, 2023
b7d5234
Merge pull request #1553 from pi-hole/dependabot-github_actions-devel…
DL6ER May 14, 2023
b2d36ef
Merge pull request #1552 from pi-hole/tweak/stale
DL6ER May 14, 2023
2931fa3
Skip ABP extended CSS selectors (port of core PR #5247)
DL6ER May 14, 2023
ff1437e
Spellcheck correction
DL6ER May 14, 2023
bd256cd
Merge pull request #1558 from pi-hole/update/lua
DL6ER May 14, 2023
6913775
Use OVER constant instead of carridge return
DL6ER May 15, 2023
041092a
Print progress in verbose arp-scanning mode
DL6ER May 15, 2023
1e0f20b
Print different warnings if we received multiple replies from (appare…
DL6ER May 15, 2023
f1b4a33
Consolidate output in main process
DL6ER May 15, 2023
5dcdbd7
Scale progress percentage according to number of addresses to be scan…
DL6ER May 16, 2023
1bc05b9
Only print progress if it has changed. Otherwise, print "." as hearth…
DL6ER May 16, 2023
4387ff2
Always skip the loopback interface, also in "-a" mode
DL6ER May 16, 2023
d45a7c4
Interface names can be up to 16 bytes long. Docker bridge interfaces …
DL6ER May 16, 2023
2d6a361
Clearly log when scanning interfaces failed
DL6ER May 16, 2023
8a29911
Log more verbose human-readable error string if available
DL6ER May 16, 2023
e3550c1
Add capabilities check for CAP_NET_RAW (root always has it)
DL6ER May 16, 2023
73e3d88
Optimize thread_data structure and store a thread-local copy of the i…
DL6ER May 17, 2023
6ce6eae
Add arp-scan -xtreme mode for very unreliable connections
DL6ER May 17, 2023
ba8807c
Give reply rate in percent instead of showing the reply matrix
DL6ER May 17, 2023
615be9c
Exit early if insufficient memory is available, perform as many inter…
DL6ER May 18, 2023
4d7640c
Reduce memory requirements by factor 4x
DL6ER May 18, 2023
d1f70d7
Further reduce memory requirements by factor 10x (if not in -x mode)
DL6ER May 18, 2023
b66f7f1
Update SQLite3 to 3.42.0
DL6ER May 18, 2023
c336434
Apply Pi-hole specific patches
DL6ER May 18, 2023
31a90da
Align % in reply rate column
DL6ER May 20, 2023
2fa2d86
Merge pull request #1557 from pi-hole/new/arp-scan
DL6ER May 20, 2023
1bcee5f
Merge remote-tracking branch 'origin/development' into new/parseList
DL6ER May 20, 2023
04a7633
Add capabilities check for feature dhcp-discover in the same way we a…
DL6ER May 20, 2023
9dd3d77
Merge pull request #1560 from pi-hole/update/sqlite_3.42.0
DL6ER May 20, 2023
9b45d5c
Merge pull request #1561 from pi-hole/tweak/dhcp-discover-capabilities
DL6ER May 20, 2023
69ecc2c
Merge pull request #1559 from pi-hole/new/parseList
DL6ER May 20, 2023
aa8821a
Modify logging in such a way that concurrent printing by the involved…
DL6ER May 20, 2023
25a1d06
Query IPv4-capable interfaces instead of packet-interfaces when scann…
DL6ER May 20, 2023
6b531e7
Improve deplay.sh script to check against exact matches instead of re…
DL6ER May 21, 2023
1a02c10
Improve message when packet is rejected by wireguard interfaces
DL6ER May 21, 2023
d75305b
Ensure we are in lock-mode when printing the final result
DL6ER May 21, 2023
b38ed40
Skip interfaces that are either down or are of loopback type
DL6ER May 21, 2023
59a1180
Do not try to scan for DHCP servers in network where the kernel knows…
DL6ER May 21, 2023
88502af
Do not run ARP scans in networks where the kernel knows that ARP is n…
DL6ER May 21, 2023
c2bdc24
Merge pull request #1562 from pi-hole/tweak/dhcp-discover
DL6ER May 22, 2023
9689b98
Allowing underscore and hyfen in any position for gravity parseList
rdwebdesign May 22, 2023
90ecc7d
Merge pull request #1563 from pi-hole/test/new_gravity_pattern
DL6ER May 23, 2023
2a13beb
Do not consider false positives as invalid domains
rdwebdesign May 23, 2023
f437487
Improving the comments
rdwebdesign May 24, 2023
825146f
Adding anchors to false_positives_regex
rdwebdesign May 24, 2023
38335a7
Merge pull request #1564 from pi-hole/tweak/false_positives
DL6ER May 24, 2023
14dc131
Update adlist.date_updated in parseList command
DL6ER May 24, 2023
15faf3c
Rename src/{gravity-tools.* => tools/gravity-parseList.*}
DL6ER May 24, 2023
42b36cf
Update src/tools/gravity-parseList.c
DL6ER May 24, 2023
0515abe
Merge pull request #1565 from pi-hole/tweak/gravity-adlist-updated
DL6ER May 25, 2023
487d4d2
Remove code duplication found in gravit.sh gravity_ParseFileIntoDomai…
yubiuser May 27, 2023
dad2b9f
Remove traces of ABP_CSS
yubiuser May 27, 2023
78c16f3
Merge pull request #1566 from pi-hole/tweak/gravity_1
DL6ER May 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
-
name: Checkout code
uses: actions/checkout@v3.4.0
uses: actions/checkout@v3.5.2
-
name: "Calculate required variables"
id: variables
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
steps:
-
name: Checkout code
uses: actions/checkout@v3.4.0
uses: actions/checkout@v3.5.2
-
name: "Fix ownership of repository"
run: chown -R root .
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
steps:
-
name: Checkout code
uses: actions/checkout@v3.4.0
uses: actions/checkout@v3.5.2
-
name: Get Binaries built in previous jobs
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
-
name: Checkout repository
uses: actions/checkout@v3.4.0
uses: actions/checkout@v3.5.2
-
name: Spell-Checking
uses: codespell-project/actions-codespell@master
Expand Down
29 changes: 24 additions & 5 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,44 @@ name: Mark stale issues

on:
schedule:
- cron: '0 8 * * *'
- cron: '0 8 * * *'
workflow_dispatch:
issue_comment:

jobs:
stale:
env:
stale_label: stale

jobs:
stale_action:
if: github.event_name != 'issue_comment'
runs-on: ubuntu-latest
permissions:
issues: write

steps:
- uses: actions/stale@v7.0.0
- uses: actions/stale@v8.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30
days-before-close: 5
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.'
stale-issue-label: 'stale'
stale-issue-label: $stale_label
exempt-issue-labels: 'Fixed in next release, Bug, Bug:Confirmed, Bugfix in progress, documentation needed, internal'
exempt-all-issue-assignees: true
operations-per-run: 300
close-issue-reason: 'not_planned'

remove_stale: # trigger "stale" removal immediately when stale issues are commented on
if: github.event_name == 'issue_comment'
permissions:
contents: read # for actions/checkout
issues: write # to edit issues label
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Remove 'stale' label
run: gh issue edit ${{ github.event.issue.number }} --remove-label $stale_label
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion .github/workflows/stale_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/stale@v7.0.0
- uses: actions/stale@v8.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Do not automatically mark PR/issue as stale
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-back-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Syncing branches
steps:
- name: Checkout
uses: actions/checkout@v3.4.0
uses: actions/checkout@v3.5.2
- name: Opening pull request
run: gh pr create -B development -H master --title 'Sync master back into development' --body 'Created by Github action' --label 'internal'
env:
Expand Down
17 changes: 12 additions & 5 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,18 @@ for dir in "${path[@]}"; do
ls -1"
)"

# Only try to create the subdir if does not already exist
if [[ "${dir_content[*]}" =~ "${dir}" ]]; then
echo "Dir: ${old_path}/${dir} already exists"
else
echo "Creating dir: ${old_path}/${dir}"
# Loop over the dir content and check if this exact dir already exists
path_exists=0
for content in "${dir_content[@]}"; do
if [[ "${content}" == "${dir}" ]]; then
echo "Dir: ${old_path}/${dir} already exists"
path_exists=1
fi
done

# If the dir does not exist, create it
if [[ "${path_exists}" -eq 0 ]]; then
echo "Dir: ${old_path}/${dir} does not exist. Creating it."
sftp -b - "${USER}"@"${HOST}" <<< "cd ${old_path}
-mkdir ${dir}"
fi
Expand Down
4 changes: 2 additions & 2 deletions patch/lua/0001-add-pihole-library.patch
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ index 454ce12f..a363925c 100644
+ ftl_lua_init(L);
+ /***************************************************/
+
if (!runargs(L, argv, script)) /* execute arguments -e and -l */
if (!runargs(L, argv, optlim)) /* execute arguments -e and -l */
return 0; /* something failed */
if (script < argc && /* execute main script (if there is one) */
if (script > 0) { /* execute main script (if there is one) */
@@ -616,7 +622,9 @@ static int pmain (lua_State *L) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ set(sources
daemon.h
datastructure.c
datastructure.h
dhcp-discover.c
dhcp-discover.h
dnsmasq_interface.c
dnsmasq_interface.h
edns0.c
Expand Down Expand Up @@ -180,6 +178,7 @@ add_executable(pihole-FTL
$<TARGET_OBJECTS:lua>
$<TARGET_OBJECTS:tre-regex>
$<TARGET_OBJECTS:syscalls>
$<TARGET_OBJECTS:tools>
)
if(STATIC STREQUAL "true")
set_target_properties(pihole-FTL PROPERTIES LINK_SEARCH_START_STATIC ON)
Expand Down Expand Up @@ -253,3 +252,4 @@ add_subdirectory(lua)
add_subdirectory(lua/scripts)
add_subdirectory(tre-regex)
add_subdirectory(syscalls)
add_subdirectory(tools)
67 changes: 55 additions & 12 deletions src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@
#include "shmem.h"
// LUA dependencies
#include "lua/ftl_lua.h"
// gravity_parseList()
#include "tools/gravity-parseList.h"
// run_dhcp_discover()
#include "dhcp-discover.h"
#include "tools/dhcp-discover.h"
// run_arp_scan()
#include "tools/arp-scan.h"
// defined in dnsmasq.c
extern void print_dnsmasq_version(const char *yellow, const char *green, const char *bold, const char *normal);

Expand Down Expand Up @@ -124,7 +128,15 @@ static const char __attribute__ ((pure)) *cli_color(const char *color)
return is_term() ? color : "";
}

static inline bool strEndsWith(const char *input, const char *end){
// Go back to beginning of line and erase to end of line if STDOUT is a terminal
const char __attribute__ ((pure)) *cli_over(void)
{
// \x1b[K is the ANSI escape sequence for "erase to end of line"
return is_term() ? "\r\x1b[K" : "\r";
}

static inline bool strEndsWith(const char *input, const char *end)
{
return strcmp(input + strlen(input) - strlen(end), end) == 0;
}

Expand Down Expand Up @@ -163,6 +175,39 @@ void parse_args(int argc, char* argv[])
(argc > 1 && strEndsWith(argv[1], ".db")))
exit(sqlite3_shell_main(argc, argv));

// If the first argument is "gravity" (e.g., /usr/bin/pihole-FTL gravity),
// we offer some specialized gravity tools
if(argc > 1 && strcmp(argv[1], "gravity") == 0)
{
// pihole-FTL gravity parseList <infile> <outfile> <adlistID>
if(argc == 6 && strcmp(argv[2], "parseList") == 0)
{
// Parse the given list and write the result to the given file
exit(gravity_parseList(argv[3], argv[4], argv[5]));
}

printf("Incorrect usage of pihole-FTL gravity subcommand\n");
exit(EXIT_FAILURE);
}

// DHCP discovery mode
if(argc > 1 && strcmp(argv[1], "dhcp-discover") == 0)
{
// Enable stdout printing
cli_mode = true;
exit(run_dhcp_discover());
}

// ARP scanning mode
if(argc > 1 && strcmp(argv[1], "arp-scan") == 0)
{
// Enable stdout printing
cli_mode = true;
const bool scan_all = argc > 2 && strcmp(argv[2], "-a") == 0;
const bool extreme_mode = argc > 2 && strcmp(argv[2], "-x") == 0;
exit(run_arp_scan(scan_all, extreme_mode));
}

// start from 1, as argv[0] is the executable name
for(int i = 1; i < argc; i++)
{
Expand Down Expand Up @@ -415,14 +460,6 @@ void parse_args(int argc, char* argv[])
}
}

// Regex test mode
if(strcmp(argv[i], "dhcp-discover") == 0)
{
// Enable stdout printing
cli_mode = true;
exit(run_dhcp_discover());
}

// List of implemented arguments
if(strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "help") == 0 || strcmp(argv[i], "--help") == 0)
{
Expand Down Expand Up @@ -495,13 +532,19 @@ void parse_args(int argc, char* argv[])

printf("%sDebugging and special use:%s\n", yellow, normal);
printf("\t%sd%s, %sdebug%s Enter debugging mode\n", green, normal, green, normal);
printf("\t%stest%s Don't start pihole-FTL but\n", green, normal);
printf("\t instead quit immediately\n");
printf("\t%stest%s Don't start pihole-FTL but instead\n", green, normal);
printf("\t quit immediately\n");
printf("\t%s-f%s, %sno-daemon%s Don't go into daemon mode\n\n", green, normal, green, normal);

printf("%sOther:%s\n", yellow, normal);
printf("\t%sdhcp-discover%s Discover DHCP servers in the local\n", green, normal);
printf("\t network\n");
printf("\t%sarp-scan %s[-a/-x]%s Use ARP to scan local network for\n", green, cyan, normal);
printf("\t possible IP conflicts\n");
printf("\t Append %s-a%s to force scan on all\n", cyan, normal);
printf("\t interfaces\n");
printf("\t Append %s-x%s to force scan on all\n", cyan, normal);
printf("\t interfaces and scan 10x more often\n");
printf("\t%s-h%s, %shelp%s Display this help and exit\n\n", green, normal, green, normal);
exit(EXIT_SUCCESS);
}
Expand Down
1 change: 1 addition & 0 deletions src/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const char *cli_qst(void) __attribute__ ((const));
const char *cli_done(void) __attribute__ ((pure));
const char *cli_bold(void) __attribute__ ((pure));
const char *cli_normal(void) __attribute__ ((pure));
const char *cli_over(void) __attribute__ ((pure));

// defined in dnsmasq_interface.c
int check_struct_sizes(void);
Expand Down
41 changes: 41 additions & 0 deletions src/capabilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,47 @@ static const unsigned int capabilityIDs[] = { CAP_CHOWN , CAP_DAC_OVERRIDE ,
static const char* capabilityNames[] = {"CAP_CHOWN", "CAP_DAC_OVERRIDE", "CAP_DAC_READ_SEARCH", "CAP_FOWNER", "CAP_FSETID", "CAP_KILL", "CAP_SETGID", "CAP_SETUID", "CAP_SETPCAP", "CAP_LINUX_IMMUTABLE", "CAP_NET_BIND_SERVICE", "CAP_NET_BROADCAST", "CAP_NET_ADMIN", "CAP_NET_RAW", "CAP_IPC_LOCK", "CAP_IPC_OWNER", "CAP_SYS_MODULE", "CAP_SYS_RAWIO", "CAP_SYS_CHROOT", "CAP_SYS_PTRACE", "CAP_SYS_PACCT", "CAP_SYS_ADMIN", "CAP_SYS_BOOT", "CAP_SYS_NICE", "CAP_SYS_RESOURCE", "CAP_SYS_TIME", "CAP_SYS_TTY_CONFIG", "CAP_MKNOD", "CAP_LEASE", "CAP_AUDIT_WRITE", "CAP_AUDIT_CONTROL", "CAP_SETFCAP"};
static const unsigned int numCaps = sizeof(capabilityIDs) / sizeof(*capabilityIDs);

bool check_capability(const unsigned int cap)
{
// First assume header version 1
int capsize = 1; // VFS_CAP_U32_1
cap_user_data_t data = NULL;
cap_user_header_t hdr = calloc(sizeof(*hdr), capsize);

// Determine capabilities version used by the current kernel
capget(hdr, NULL);

// Check version
if (hdr->version != LINUX_CAPABILITY_VERSION_1)
{
// If unknown version, use largest supported version (3)
// Version 2 is deprecated according to linux/capability.h
if (hdr->version != LINUX_CAPABILITY_VERSION_2)
{
hdr->version = LINUX_CAPABILITY_VERSION_3;
capsize = 2; // VFS_CAP_U32_3
}
else
{
// Use version 2
capsize = 2; // VFS_CAP_U32_2
}
}

// Get current capabilities
data = calloc(sizeof(*data), capsize);
capget(hdr, data);

// Check if the capability is available
const bool available = ((data->permitted & (1 << cap)) && (data->effective & (1 << cap)));

// Free memory
free(hdr);
free(data);

return available;
}

bool check_capabilities(void)
{
// First assume header version 1
Expand Down
1 change: 1 addition & 0 deletions src/capabilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef CAPABILITIES_H
#define CAPABILITIES_H

bool check_capability(const unsigned int cap);
bool check_capabilities(void);

#endif //CAPABILITIES_H
8 changes: 0 additions & 8 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,6 @@ static char *parse_FTLconf(FILE *fp, const char *key)
// Go to beginning of file
fseek(fp, 0L, SEEK_SET);

if(config.debug & DEBUG_EXTRA)
logg("initial: conflinebuffer = %p, keystr = %p, size = %zu", conflinebuffer, keystr, size);

// Set size to zero if conflinebuffer is not available here
// This causes getline() to allocate memory for the buffer itself
if(conflinebuffer == NULL && size != 0)
Expand All @@ -848,11 +845,6 @@ static char *parse_FTLconf(FILE *fp, const char *key)
errno = 0;
while(getline(&conflinebuffer, &size, fp) != -1)
{
if(config.debug & DEBUG_EXTRA)
{
logg("conflinebuffer = %p, keystr = %p, size = %zu", conflinebuffer, keystr, size);
logg(" while reading line \"%s\" looking for \"%s\"", conflinebuffer, keystr);
}
// Check if memory allocation failed
if(conflinebuffer == NULL)
break;
Expand Down
Loading