1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-29 12:24:17 +02:00
openwrt-packages/net/addrwatch/patches/003-add-space-for-null-byte.patch
Jeffery To 31ae85bca9
addrwatch: Various fixes
Makefile changes include:

* Remove USE_UCLIBC, as uclibc is no longer supported

* Package output modules

* Move main binary (back) to /usr/sbin, as it is system administration
  related and requires superuser privileges

New patches:

* 003-add-space-for-null-byte.patch - from
  374cfd2cab

* 004-more-specific-library-linking.patch - from
  27b57d9da3

* 005-use-c99-format-macro-constants.patch - from
  https://github.com/fln/addrwatch/pull/28

Init script changes include:

* Change from explicit disable to explicit enable, so that the service
  is disabled by default and on first install

* Set config option default values to default values of the main binary

* Fix command-line option names and format (from
  https://forum.openwrt.org/t/cant-start-addrwatch-service/60499/3)

* Always use the --quiet command-line option, as the procd instance is
  not configured to capture stdout/stderr

* Change the syslog config option to start the syslog output module

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2021-07-07 00:18:47 +08:00

21 lines
656 B
Diff

From 374cfd2cabe4db9882d8a210adff430cc579f859 Mon Sep 17 00:00:00 2001
From: Julius Kriukas <julius@kriukas.lt>
Date: Sun, 8 Mar 2020 12:46:55 +0200
Subject: [PATCH] Use HOST_NAME_MAX+1 to add space for null byte
---
src/addrwatch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/addrwatch.c
+++ b/src/addrwatch.c
@@ -501,7 +501,7 @@ int main(int argc, char *argv[])
argp_parse(&argp, argc, argv, 0, &optind, 0);
if (!cfg.hostname) {
- cfg.hostname_len = HOST_NAME_MAX;
+ cfg.hostname_len = HOST_NAME_MAX + 1;
cfg.hostname = (char *)calloc(cfg.hostname_len, sizeof(char));
gethostname(cfg.hostname, cfg.hostname_len);
}