diff options
| author | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-08-12 00:40:07 +0300 |
|---|---|---|
| committer | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-08-12 00:40:07 +0300 |
| commit | 428333c9bb283ceb998332481867a59e7cea33b4 (patch) | |
| tree | ca2e2467cc47a3220e3a32aa17da820d745f816c /accel-pppd | |
| parent | 1c69485e1ebd17bf3cc6e8fc4728f9bdb431de94 (diff) | |
| download | accel-ppp-428333c9bb283ceb998332481867a59e7cea33b4.tar.gz accel-ppp-428333c9bb283ceb998332481867a59e7cea33b4.zip | |
log_pgsql: deprecate the module and rename its build flag
The PostgreSQL logging target sees little use and has been a source of
memory safety bugs. Mark it as deprecated and scheduled for removal, but
give anyone depending on it a chance to object first.
To make sure this is not missed, the LOG_PGSQL build flag now fails the
build with an explanation, building the module requires the renamed
LOG_PGSQL_DEPRECATED flag, cmake prints a warning when it is used, and the
module logs a deprecation warning on startup.
Diffstat (limited to 'accel-pppd')
| -rw-r--r-- | accel-pppd/accel-ppp.conf | 2 | ||||
| -rw-r--r-- | accel-pppd/accel-ppp.conf.5 | 5 | ||||
| -rw-r--r-- | accel-pppd/logs/CMakeLists.txt | 10 | ||||
| -rw-r--r-- | accel-pppd/logs/log_pgsql.c | 13 |
4 files changed, 28 insertions, 2 deletions
diff --git a/accel-pppd/accel-ppp.conf b/accel-pppd/accel-ppp.conf index 56fe0a8c..3fefcf27 100644 --- a/accel-pppd/accel-ppp.conf +++ b/accel-pppd/accel-ppp.conf @@ -2,7 +2,7 @@ log_file #log_syslog #log_tcp -#log_pgsql +#log_pgsql (deprecated, scheduled for removal) connlimit diff --git a/accel-pppd/accel-ppp.conf.5 b/accel-pppd/accel-ppp.conf.5 index bcddfed4..eee33bf0 100644 --- a/accel-pppd/accel-ppp.conf.5 +++ b/accel-pppd/accel-ppp.conf.5 @@ -36,6 +36,7 @@ This is logging target which logs messages over TCP/IP. .TP .BI log_pgsql This is logging target which logs messages to PostgreSQL. +Deprecated and scheduled for removal, see the [log-pgsql] section. .TP .BI pptp .br @@ -1337,6 +1338,10 @@ log all messages including debug messages .SH [log-pgsql] .br Configuration of log_pgsql module. +.br +This module is deprecated and scheduled for removal. It is built only when +accel-ppp is configured with LOG_PGSQL_DEPRECATED=TRUE. If you depend on it, +please object at https://github.com/accel-ppp/accel-ppp/issues. .TP .BI "conninfo=" conninfo Conninfo to connect to PostgreSQL server. diff --git a/accel-pppd/logs/CMakeLists.txt b/accel-pppd/logs/CMakeLists.txt index 4d8a631a..0052e1ae 100644 --- a/accel-pppd/logs/CMakeLists.txt +++ b/accel-pppd/logs/CMakeLists.txt @@ -33,7 +33,15 @@ IF(LOG_SYSLOG) ) ENDIF(LOG_SYSLOG) +# log_pgsql is deprecated and scheduled for removal, the build flag was +# renamed so that nobody keeps building it without noticing IF(LOG_PGSQL) + message(FATAL_ERROR "${Esc}[31mLOG_PGSQL is deprecated.\n The log_pgsql module is scheduled for removal in a future release.\n Build with -DLOG_PGSQL_DEPRECATED=TRUE if you still need it, and please say so at https://github.com/accel-ppp/accel-ppp/issues so that it is kept${Esc}[m") +ENDIF(LOG_PGSQL) + +IF(LOG_PGSQL_DEPRECATED) + message(WARNING "${Esc}[33mBuilding deprecated module log_pgsql, it is scheduled for removal in a future release.\n Please say so at https://github.com/accel-ppp/accel-ppp/issues if you need it kept${Esc}[m") + find_library(PGSQL_LIBRARY pq HINTS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib PATHS ${CMAKE_SOURCE_DIR}/lib/linux/gcc/${BIT}/lib @@ -47,5 +55,5 @@ IF(LOG_PGSQL) INSTALL(TARGETS log_pgsql LIBRARY DESTINATION lib${LIB_SUFFIX}/accel-ppp ) -ENDIF(LOG_PGSQL) +ENDIF(LOG_PGSQL_DEPRECATED) diff --git a/accel-pppd/logs/log_pgsql.c b/accel-pppd/logs/log_pgsql.c index 5b3fd6ae..6589da0e 100644 --- a/accel-pppd/logs/log_pgsql.c +++ b/accel-pppd/logs/log_pgsql.c @@ -1,3 +1,13 @@ +/* + * DEPRECATED + * + * This module is scheduled for removal in a future release. It is built + * only when the deprecated LOG_PGSQL_DEPRECATED build flag is given. + * If you depend on it, please object at + * https://github.com/accel-ppp/accel-ppp/issues, otherwise it will be + * deleted. + */ + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -293,6 +303,9 @@ static void init(void) { char *opt; + log_warn("log_pgsql: this module is deprecated and is scheduled for removal," + " please object at https://github.com/accel-ppp/accel-ppp/issues if you need it\n"); + spinlock_init(&queue_lock); opt = conf_get_opt("log-pgsql", "conninfo"); |
