Gentoo Archives: gentoo-commits

From: Quentin Retornaz <gentoo@××××××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/libressl:master commit in: net-dialup/freeradius/, net-dialup/freeradius/files/
Date: Sat, 07 May 2022 01:31:57
Message-Id: 1651887081.a50726125d40c90f6a65462e7d04506af800f121.quentin@gentoo
1 commit: a50726125d40c90f6a65462e7d04506af800f121
2 Author: orbea <orbea <AT> riseup <DOT> net>
3 AuthorDate: Fri May 6 21:50:22 2022 +0000
4 Commit: Quentin Retornaz <gentoo <AT> retornaz <DOT> com>
5 CommitDate: Sat May 7 01:31:21 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=a5072612
7
8 net-dialup/freeradius: Remove old version
9
10 Signed-off-by: orbea <orbea <AT> riseup.net>
11 Closes: https://github.com/gentoo/libressl/pull/405
12 Signed-off-by: Quentin Retornaz <gentoo <AT> retornaz.com>
13
14 net-dialup/freeradius/Manifest | 1 -
15 .../files/freeradius-3.0.18-libressl.patch | 63 ---
16 .../files/freeradius-3.0.20-py3-fixes.patch | 472 ---------------------
17 net-dialup/freeradius/files/radius.conf-r4 | 16 -
18 net-dialup/freeradius/files/radius.init-r3 | 31 --
19 net-dialup/freeradius/freeradius-3.0.20-r1.ebuild | 267 ------------
20 6 files changed, 850 deletions(-)
21
22 diff --git a/net-dialup/freeradius/Manifest b/net-dialup/freeradius/Manifest
23 index 849cc39..9237577 100644
24 --- a/net-dialup/freeradius/Manifest
25 +++ b/net-dialup/freeradius/Manifest
26 @@ -1,2 +1 @@
27 DIST freeradius-3.0.25.tar.gz 5300245 BLAKE2B bf8908aa7bfabb9e15fa841457f176a4f2697bdec7994485516ef338908b46f2168260b7acf1a7120a687e543f0381bb787567bb4d564b9d14a3eb464a0e9ed6 SHA512 13382a53e6a1a4495c6f53e662ce21b80d73b6134a72f099f05495b64c56ae1a6c1cd1281311f1c3695d8532207fe5bd3d2026ed2c45f3cb5adb1011f1505ee7
28 -DIST freeradius-server-3.0.20.tar.gz 5002727 BLAKE2B f481ad22105694a4af3f0f0c1b4f6e395e8da0fe65274e32ebeed07e3c9b1869029e6ffbc655cfa41d5de2a1dcba54acee33a7a10d28bfbfce791b7ccd0fc57a SHA512 513ed0a5d9e6b9a8d89a9b02c86ff528a9ff14d928f4c1040ca44702465abd711588fe6afa35554cb2c8e8bd7f19dd5be3dbc78445c62c7b00bf5cbc4c621312
29
30 diff --git a/net-dialup/freeradius/files/freeradius-3.0.18-libressl.patch b/net-dialup/freeradius/files/freeradius-3.0.18-libressl.patch
31 deleted file mode 100644
32 index 129e251..0000000
33 --- a/net-dialup/freeradius/files/freeradius-3.0.18-libressl.patch
34 +++ /dev/null
35 @@ -1,63 +0,0 @@
36 -From 39e4ac0cf8d415b41dc2ff1fc329de0522b135ca Mon Sep 17 00:00:00 2001
37 -From: Stefan Strogin <stefan.strogin@×××××.com>
38 -Date: Wed, 24 Apr 2019 09:16:12 +0300
39 -Subject: [PATCH] Fix build to LibreSSL
40 -
41 -Upstream-Status: Inappropriate
42 -[https://github.com/FreeRADIUS/freeradius-server/commit/9652affe38f41ba2484e013cf9d2c0bcb8c80d67]
43 -Signed-off-by: Stefan Strogin <stefan.strogin@×××××.com>
44 ----
45 - src/main/tls.c | 9 ++++++---
46 - src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c | 3 ++-
47 - 2 files changed, 8 insertions(+), 4 deletions(-)
48 -
49 -diff --git a/src/main/tls.c b/src/main/tls.c
50 -index 9726953234..840724bf61 100644
51 ---- a/src/main/tls.c
52 -+++ b/src/main/tls.c
53 -@@ -1579,7 +1579,8 @@ done:
54 - return 0;
55 - }
56 -
57 --#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
58 -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
59 -+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2090100fL)
60 - static SSL_SESSION *cbtls_get_session(SSL *ssl, unsigned char *data, int len, int *copy)
61 - #else
62 - static SSL_SESSION *cbtls_get_session(SSL *ssl, const unsigned char *data, int len, int *copy)
63 -@@ -3379,14 +3380,16 @@ post_ca:
64 - */
65 - SSL_CTX_sess_set_cache_size(ctx, conf->session_cache_size);
66 -
67 --#if OPENSSL_VERSION_NUMBER >= 0x10101000L
68 -+/* Not implemented in LibreSSL 2.9.1 */
69 -+#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
70 - SSL_CTX_set_num_tickets(ctx, 1);
71 - #endif
72 -
73 - } else {
74 - SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
75 -
76 --#if OPENSSL_VERSION_NUMBER >= 0x10101000L
77 -+/* Not implemented in LibreSSL 2.9.1 */
78 -+#if OPENSSL_VERSION_NUMBER >= 0x10101000L && !defined(LIBRESSL_VERSION_NUMBER)
79 - /*
80 - * This controls the number of stateful or stateless tickets
81 - * generated with TLS 1.3. In OpenSSL 1.1.1 it's also
82 -diff --git a/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c b/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c
83 -index fa9c58f3c3..a53341fc20 100644
84 ---- a/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c
85 -+++ b/src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c
86 -@@ -44,7 +44,8 @@ static int openssl_get_keyblock_size(REQUEST *request, SSL *ssl)
87 - {
88 - const EVP_CIPHER *c;
89 - const EVP_MD *h;
90 --#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
91 -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
92 -+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2090100fL)
93 - int md_size;
94 -
95 - if (ssl->enc_read_ctx == NULL || ssl->enc_read_ctx->cipher == NULL ||
96 ---
97 -2.21.0
98 -
99
100 diff --git a/net-dialup/freeradius/files/freeradius-3.0.20-py3-fixes.patch b/net-dialup/freeradius/files/freeradius-3.0.20-py3-fixes.patch
101 deleted file mode 100644
102 index 83dc200..0000000
103 --- a/net-dialup/freeradius/files/freeradius-3.0.20-py3-fixes.patch
104 +++ /dev/null
105 @@ -1,472 +0,0 @@
106 -diff --git a/raddb/mods-available/python3 b/raddb/mods-available/python3
107 -index 246dfd74ce..0593c69f1a 100644
108 ---- a/raddb/mods-available/python3
109 -+++ b/raddb/mods-available/python3
110 -@@ -13,7 +13,7 @@ python3 {
111 - # item is GLOBAL TO THE SERVER. That is, you cannot have two
112 - # instances of the python module, each with a different path.
113 - #
114 --# python_path="/path/to/python/files:/another_path/to/python_files/"
115 -+# python_path="${modconfdir}/${.:name}:/another_path/to/python_files"
116 -
117 - module = example
118 -
119 -diff --git a/src/modules/rlm_python3/configure.ac b/src/modules/rlm_python3/configure.ac
120 -index a00320fda4..295a2486d2 100644
121 ---- a/src/modules/rlm_python3/configure.ac
122 -+++ b/src/modules/rlm_python3/configure.ac
123 -@@ -8,128 +8,75 @@ if test x$with_[]modname != xno; then
124 - AC_PROG_CC
125 - AC_PROG_CPP
126 -
127 -- dnl extra argument: --with-rlm-python3-bin
128 -- PYTHON3_BIN=
129 -- AC_ARG_WITH(rlm-python3-bin,
130 -- [ --with-rlm-python3-bin=PATH Path to python3 binary []],
131 -+ dnl extra argument: --with-rlm-python3-config-bin
132 -+ PYTHON3_CONFIG_BIN=
133 -+ AC_ARG_WITH(rlm-python3-config-bin,
134 -+ [ --with-rlm-python3-config-bin=PATH Path to python-config3 binary []],
135 - [ case "$withval" in
136 - no)
137 -- AC_MSG_ERROR(Need rlm-python3-bin)
138 -+ AC_MSG_ERROR(Need rlm-python3-config-bin)
139 - ;;
140 - yes)
141 - ;;
142 - *)
143 -- PYTHON3_BIN="$withval"
144 -+ PYTHON3_CONFIG_BIN="$withval"
145 - ;;
146 - esac ]
147 - )
148 -
149 -- if test "x$PYTHON3_BIN" = x; then
150 -- AC_CHECK_PROGS(PYTHON3_BIN, [ python3 ], not-found, [${PATH}:/usr/bin:/usr/local/bin])
151 -+ if test "x$PYTHON3_CONFIG_BIN" = x; then
152 -+ AC_CHECK_PROGS(PYTHON3_CONFIG_BIN, [ python3-config ], not-found, [${PATH}:/usr/bin:/usr/local/bin])
153 - fi
154 -
155 -- if test "x$PYTHON3_BIN" = "xnot-found"; then
156 -- fail="python-binary"
157 -- fi
158 --
159 -- dnl extra argument: --with-rlm-python3-lib-dir
160 -- PY_LIB_DIR=
161 -- AC_ARG_WITH(rlm-python3-lib-dir,
162 -- [ --with-rlm-python3-lib-dir=DIR Directory for Python library files []],
163 -- [ case "$withval" in
164 -- no)
165 -- AC_MSG_ERROR(Need rlm-python3-lib-dir)
166 -- ;;
167 -- yes)
168 -- ;;
169 -- *)
170 -- PY_LIB_DIR="$withval"
171 -- ;;
172 -- esac ]
173 -- )
174 --
175 -- dnl extra argument: --with-rlm-python3-include-dir
176 -- PY_INC_DIR=
177 -- AC_ARG_WITH(rlm-python3-include-dir,
178 -- [ --with-rlm-python3-include-dir=DIR Directory for Python include files []],
179 -- [ case "$withval" in
180 -- no)
181 -- AC_MSG_ERROR(Need rlm-python3-include-dir)
182 -- ;;
183 -- yes)
184 -- ;;
185 -- *)
186 -- PY_INC_DIR="$withval"
187 -- ;;
188 -- esac ]
189 -- )
190 --
191 -- if test x$fail = x; then
192 -- PY_PREFIX=`${PYTHON3_BIN} -c 'import sys ; print(sys.prefix)'`
193 -- AC_MSG_NOTICE([Python sys.prefix \"${PY_PREFIX}\"])
194 --
195 -- PY_EXEC_PREFIX=`${PYTHON3_BIN} -c 'import sys ; print(sys.exec_prefix)'`
196 -- AC_MSG_NOTICE([Python sys.exec_prefix \"${PY_EXEC_PREFIX}\"])
197 --
198 -- PY_SYS_VERSION=`${PYTHON3_BIN} -c 'import sys ; print(sys.version[[0:3]])'`
199 -- AC_MSG_NOTICE([Python sys.version \"${PY_SYS_VERSION}\"])
200 --
201 -- if test "x$PY_LIB_DIR" = "x"; then
202 -- PY_LIB_DIR="$PY_EXEC_PREFIX/lib/python${PY_SYS_VERSION}/config"
203 -- PY_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python${PY_SYS_VERSION}/config"
204 -- fi
205 --
206 -- PY_MAKEFILE="$PY_EXEC_PREFIX/lib/python${PY_SYS_VERSION}/config/Makefile"
207 -- if test -f ${PY_MAKEFILE}; then
208 -- PY_LOCAL_MOD_LIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE | sed -e 's/[[[:blank:]]]/ /g;s/^ *//;s/ *$//'`
209 -- AC_MSG_NOTICE([Python local_mod_libs \"${PY_LOCAL_MOD_LIBS}\"])
210 --
211 -- PY_BASE_MOD_LIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE | sed -e 's/[[[:blank:]]]/ /g;s/^ *//;s/ *$//'`
212 -- AC_MSG_NOTICE([Python base_mod_libs \"${PY_BASE_MOD_LIBS}\"])
213 --
214 -- PY_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PY_MAKEFILE | sed -e 's/[[[:blank:]]]/ /g;s/ / /g;s/^ *//;s/ *$//'`
215 -- PY_OTHER_LDFLAGS=`sed -n -e 's/^LINKFORSHARED=\(.*\)/\1/p' $PY_MAKEFILE | sed -e 's/[[[:blank:]]]/ /g;s/ / /g;s/^ *//;s/ *$//'`
216 -- AC_MSG_NOTICE([Python other_libs \"${PY_OTHER_LDFLAGS} ${PY_OTHER_LIBS}\"])
217 -- fi
218 -- PY_EXTRA_LIBS="$PY_LOCALMODLIBS $PY_BASE_MOD_LIBS $PY_OTHER_LIBS"
219 -+ if test "x$PYTHON3_CONFIG_BIN" = xnot-found; then
220 -+ fail="$fail python3-config"
221 -+ else
222 -+ dnl #
223 -+ dnl # It is necessary due to a weird behavior with 'python3-config'
224 -+ dnl #
225 -+ old_CFLAGS="$CFLAGS"
226 -+ unset CFLAGS
227 -+
228 -+ python3_cflags=`${PYTHON3_CONFIG_BIN} --cflags`
229 -+ AC_MSG_NOTICE([${PYTHON3_CONFIG_BIN}'s cflags were \"${python3_cflags}\"])
230 -+
231 -+ dnl # Convert -I to -isystem to get rid of warnings about issues in Python headers
232 -+ dnl # Strip -systemroot
233 -+ dnl # Strip optimisation flags (-O[0-9]?). We decide our optimisation level, not python.
234 -+ dnl # -D_FORTIFY_SOURCE needs -O.
235 -+ dnl # Strip debug symbol flags (-g[0-9]?). We decide on debugging symbols, not python
236 -+ dnl # Strip -W*, we decide what warnings are important
237 -+ dnl # Strip -DNDEBUG
238 -+ mod_cflags=`echo $python3_cflags | sed -e '\
239 -+ s/-I/-isystem/g;\
240 -+ s/-isysroot[[ =]]\{0,1\}[[^-]]*//g;\
241 -+ s/-O[[^[[:blank:]]]]*//g;\
242 -+ s/-Wp,-D_FORTIFY_SOURCE=[[[:digit:]]]//g;\
243 -+ s/-g[[^ ]]*//g;\
244 -+ s/-W[[^ ]]*//g;\
245 -+ s/-DNDEBUG[[[:blank:]]]*//g;
246 -+ '`
247 -+ AC_MSG_NOTICE([Sanitized cflags were \"${mod_cflags}\"])
248 -+
249 -+ python3_ldflags=`${PYTHON3_CONFIG_BIN} --ldflags`
250 -+ AC_MSG_NOTICE([${PYTHON3_CONFIG_BIN}'s ldflags were \"$python3_ldflags}\"])
251 -+
252 -+ dnl # Strip -Wl,-O1... Is -O even a valid linker flag??
253 -+ dnl # Strip -Wl,-Bsymbolic-functions as thats not always supported or required
254 -+ dnl # Strip -Xlinker -export-dynamic as it causes weird linking issues on Linux
255 -+ dnl # See: https://bugs.python.org/issue36508
256 -+ mod_ldflags=`echo $python3_ldflags | sed -e '\
257 -+ s/-Wl,-O[[[:digit:]]][[[:blank:]]]*//g;\
258 -+ s/-Wl,-Bsymbolic-functions[[[:blank:]]]*//g;\
259 -+ s/-Xlinker -export-dynamic//g;\
260 -+ s/-Wl,-stack_size,[[[:digit:]]]*[[[:blank:]]]//g;
261 -+ '`
262 -+ AC_MSG_NOTICE([Sanitized ldflags were \"${mod_ldflags}\"])
263 -
264 -- old_CFLAGS=$CFLAGS
265 -- CFLAGS="$CFLAGS $PY_CFLAGS"
266 -- smart_try_dir="$PY_PREFIX/include/python$PY_SYS_VERSION"
267 -- FR_SMART_CHECK_INCLUDE(Python.h)
268 - CFLAGS=$old_CFLAGS
269 -
270 -- if test "x$ac_cv_header_Python_h" = "xyes"; then
271 -- mod_cflags="$SMART_CPPFLAGS"
272 -- else
273 -- fail="$fail Python.h"
274 -- targetname=
275 -- fi
276 --
277 -- old_LIBS=$LIBS
278 -- LIBS="$LIBS $PY_LIB_LOC $PY_EXTRA_LIBS -lm"
279 -- smart_try_dir=$PY_LIB_DIR
280 -- FR_SMART_CHECK_LIB(python${PY_SYS_VERSION}, Py_Initialize)
281 -- LIBS=$old_LIBS
282 --
283 -- eval t=\${ac_cv_lib_${sm_lib_safe}_${sm_func_safe}}
284 -- if test "x$t" = "xyes"; then
285 -- mod_ldflags="$PY_LIB_LOC $PY_EXTRA_LIBS $SMART_LIBS -lm"
286 -- targetname=modname
287 -- else
288 -- FR_SMART_CHECK_LIB(python${PY_SYS_VERSION}m, Py_Initialize)
289 -- eval t=\${ac_cv_lib_${sm_lib_safe}_${sm_func_safe}}
290 -- if test "x$t" = "xyes"; then
291 -- mod_ldflags="$PY_LIB_LOC $PY_EXTRA_LIBS $SMART_LIBS -lm"
292 -- targetname=modname
293 -- else
294 -- targetname=
295 -- fail="$fail libpython$PY_SYS_VERSION"
296 -- fi
297 -- fi
298 -+ targetname="rlm_python3"
299 - fi
300 --
301 -- AC_CHECK_FUNCS([dl_iterate_phdr])
302 - else
303 - targetname=
304 - echo \*\*\* module modname is disabled.
305 -diff --git a/src/modules/rlm_python3/rlm_python3.c b/src/modules/rlm_python3/rlm_python3.c
306 -index 06187e4ffa..8e893a0eaa 100644
307 ---- a/src/modules/rlm_python3/rlm_python3.c
308 -+++ b/src/modules/rlm_python3/rlm_python3.c
309 -@@ -67,8 +67,10 @@ static CONF_PARSER module_config[] = {
310 - A(preacct)
311 - A(accounting)
312 - A(checksimul)
313 -+#ifdef WITH_PROXY
314 - A(pre_proxy)
315 - A(post_proxy)
316 -+#endif
317 - A(post_auth)
318 - #ifdef WITH_COA
319 - A(recv_coa)
320 -@@ -98,7 +100,9 @@ static struct {
321 - A(L_AUTH)
322 - A(L_INFO)
323 - A(L_ERR)
324 -+#ifdef WITH_PROXY
325 - A(L_PROXY)
326 -+#endif
327 - A(L_ACCT)
328 - A(L_DBG_WARN)
329 - A(L_DBG_ERR)
330 -@@ -510,6 +514,7 @@ static rlm_rcode_t do_python_single(REQUEST *request, PyObject *pFunc, char cons
331 - goto finish;
332 - }
333 -
334 -+#ifdef WITH_PROXY
335 - /* fill proxy vps */
336 - if (request->proxy) {
337 - if (!mod_populate_vps(pArgs, 4, request->proxy->vps)) {
338 -@@ -517,10 +522,13 @@ static rlm_rcode_t do_python_single(REQUEST *request, PyObject *pFunc, char cons
339 - ret = RLM_MODULE_FAIL;
340 - goto finish;
341 - }
342 -- } else {
343 -+ } else
344 -+#endif
345 -+ {
346 - mod_populate_vps(pArgs, 4, NULL);
347 - }
348 -
349 -+#ifdef WITH_PROXY
350 - /* fill proxy_reply vps */
351 - if (request->proxy_reply) {
352 - if (!mod_populate_vps(pArgs, 5, request->proxy_reply->vps)) {
353 -@@ -528,7 +536,9 @@ static rlm_rcode_t do_python_single(REQUEST *request, PyObject *pFunc, char cons
354 - ret = RLM_MODULE_FAIL;
355 - goto finish;
356 - }
357 -- } else {
358 -+ } else
359 -+#endif
360 -+ {
361 - mod_populate_vps(pArgs, 5, NULL);
362 - }
363 -
364 -@@ -550,9 +560,14 @@ static rlm_rcode_t do_python_single(REQUEST *request, PyObject *pFunc, char cons
365 - PyDict_SetItemString(pDictInput, "request", PyTuple_GET_ITEM(pArgs, 0)) ||
366 - PyDict_SetItemString(pDictInput, "reply", PyTuple_GET_ITEM(pArgs, 1)) ||
367 - PyDict_SetItemString(pDictInput, "config", PyTuple_GET_ITEM(pArgs, 2)) ||
368 -- PyDict_SetItemString(pDictInput, "session-state", PyTuple_GET_ITEM(pArgs, 3)) ||
369 -+ PyDict_SetItemString(pDictInput, "session-state", PyTuple_GET_ITEM(pArgs, 3))
370 -+#ifdef WITH_PROXY
371 -+ ||
372 - PyDict_SetItemString(pDictInput, "proxy-request", PyTuple_GET_ITEM(pArgs, 4)) ||
373 -- PyDict_SetItemString(pDictInput, "proxy-reply", PyTuple_GET_ITEM(pArgs, 5))) {
374 -+ PyDict_SetItemString(pDictInput, "proxy-reply", PyTuple_GET_ITEM(pArgs, 5))
375 -+#endif
376 -+ ) {
377 -+
378 - ERROR("%s:%d, %s - PyDict_SetItemString failed", __func__, __LINE__, funcname);
379 - ret = RLM_MODULE_FAIL;
380 - goto finish;
381 -@@ -819,8 +834,10 @@ MOD_FUNC(authorize)
382 - MOD_FUNC(preacct)
383 - MOD_FUNC(accounting)
384 - MOD_FUNC(checksimul)
385 -+#ifdef WITH_PROXY
386 - MOD_FUNC(pre_proxy)
387 - MOD_FUNC(post_proxy)
388 -+#endif
389 - MOD_FUNC(post_auth)
390 - #ifdef WITH_COA
391 - MOD_FUNC(recv_coa)
392 -@@ -1102,7 +1119,7 @@ static int python_interpreter_init(rlm_python_t *inst, CONF_SECTION *conf)
393 - python_dlhandle = dlopen_libpython(RTLD_NOW | RTLD_GLOBAL);
394 - if (!python_dlhandle) WARN("Failed loading libpython symbols into global symbol table");
395 -
396 --#if PY_VERSION_HEX > 0x03050000
397 -+#if PY_VERSION_HEX >= 0x03050000
398 - {
399 - wchar_t *name;
400 -
401 -@@ -1110,13 +1127,6 @@ static int python_interpreter_init(rlm_python_t *inst, CONF_SECTION *conf)
402 - Py_SetProgramName(name); /* The value of argv[0] as a wide char string */
403 - PyMem_RawFree(name);
404 - }
405 --#elif PY_VERSION_HEX > 0x0300000
406 -- {
407 -- wchar_t *name;
408 --
409 -- MEM(name = _Py_char2wchar(main_config.name, NULL));
410 -- Py_SetProgramName(inst->wide_name); /* The value of argv[0] as a wide char string */
411 -- }
412 - #else
413 - {
414 - char *name;
415 -@@ -1163,37 +1173,34 @@ static int python_interpreter_init(rlm_python_t *inst, CONF_SECTION *conf)
416 - * the lifetime of the module.
417 - */
418 - if (inst->python_path) {
419 -+ char *p, *path;
420 -+ PyObject *sys = PyImport_ImportModule("sys");
421 -+ PyObject *sys_path = PyObject_GetAttrString(sys, "path");
422 -+
423 -+ memcpy(&p, &inst->python_path, sizeof(path));
424 -+
425 -+ for (path = strtok(p, ":"); path != NULL; path = strtok(NULL, ":")) {
426 - #if PY_VERSION_HEX > 0x03050000
427 -- {
428 -- wchar_t *path;
429 -- PyObject* sys = PyImport_ImportModule("sys");
430 -- PyObject* sys_path = PyObject_GetAttrString(sys,"path");
431 --
432 -- MEM(path = Py_DecodeLocale(inst->python_path, NULL));
433 -- PyList_Append(sys_path, PyUnicode_FromWideChar(path,-1));
434 -- PyObject_SetAttrString(sys,"path",sys_path);
435 -- PyMem_RawFree(path);
436 -- }
437 -+ wchar_t *py_path;
438 -+
439 -+ MEM(py_path = Py_DecodeLocale(path, NULL));
440 -+ PyList_Append(sys_path, PyUnicode_FromWideChar(py_path, -1));
441 -+ PyMem_RawFree(py_path);
442 - #elif PY_VERSION_HEX > 0x03000000
443 -- {
444 -- wchar_t *path;
445 -- PyObject* sys = PyImport_ImportModule("sys");
446 -- PyObject* sys_path = PyObject_GetAttrString(sys,"path");
447 --
448 -- MEM(path = _Py_char2wchar(inst->python_path, NULL));
449 -- PyList_Append(sys_path, PyUnicode_FromWideChar(path,-1));
450 -- PyObject_SetAttrString(sys,"path",sys_path);
451 -- }
452 --#else
453 -- {
454 -- char *path;
455 -+ wchar_t *py_path;
456 -
457 -- memcpy(&path, &inst->python_path, sizeof(path));
458 -- Py_SetPath(path);
459 -- }
460 -+ MEM(py_path = _Py_char2wchar(path, NULL));
461 -+ PyList_Append(sys_path, PyUnicode_FromWideChar(py_path, -1));
462 -+ PyMem_RawFree(py_path);
463 -+#else
464 -+ PyList_Append(sys_path, PyLong_FromString(path));
465 - #endif
466 -- }
467 -+ }
468 -
469 -+ PyObject_SetAttrString(sys, "path", sys_path);
470 -+ Py_DecRef(sys);
471 -+ Py_DecRef(sys_path);
472 -+ }
473 - } else {
474 - inst->module = main_module;
475 - Py_IncRef(inst->module);
476 -@@ -1220,7 +1227,7 @@ static int python_interpreter_init(rlm_python_t *inst, CONF_SECTION *conf)
477 - static int mod_instantiate(CONF_SECTION *conf, void *instance)
478 - {
479 - rlm_python_t *inst = instance;
480 -- int code = 0;
481 -+ int code = RLM_MODULE_OK;
482 -
483 - inst->name = cf_section_name2(conf);
484 - if (!inst->name) inst->name = cf_section_name1(conf);
485 -@@ -1245,8 +1252,10 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
486 - PYTHON_FUNC_LOAD(preacct);
487 - PYTHON_FUNC_LOAD(accounting);
488 - PYTHON_FUNC_LOAD(checksimul);
489 -+#ifdef WITH_PROXY
490 - PYTHON_FUNC_LOAD(pre_proxy);
491 - PYTHON_FUNC_LOAD(post_proxy);
492 -+#endif
493 - PYTHON_FUNC_LOAD(post_auth);
494 - #ifdef WITH_COA
495 - PYTHON_FUNC_LOAD(recv_coa);
496 -@@ -1257,12 +1266,14 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
497 - /*
498 - * Call the instantiate function.
499 - */
500 -- code = do_python_single(NULL, inst->instantiate.function, "instantiate", inst->pass_all_vps, inst->pass_all_vps_dict);
501 -- if (code < 0) {
502 -- error:
503 -- python_error_log(); /* Needs valid thread with GIL */
504 -- PyEval_SaveThread();
505 -- return -1;
506 -+ if (inst->instantiate.function) {
507 -+ code = do_python_single(NULL, inst->instantiate.function, "instantiate", inst->pass_all_vps, inst->pass_all_vps_dict);
508 -+ if (code < 0) {
509 -+ error:
510 -+ python_error_log(); /* Needs valid thread with GIL */
511 -+ PyEval_SaveThread();
512 -+ return -1;
513 -+ }
514 - }
515 - PyEval_SaveThread();
516 -
517 -@@ -1272,22 +1283,31 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
518 - static int mod_detach(void *instance)
519 - {
520 - rlm_python_t *inst = instance;
521 -- int ret;
522 -+ int ret = RLM_MODULE_OK;
523 -
524 - /*
525 - * Call module destructor
526 - */
527 - PyEval_RestoreThread(inst->sub_interpreter);
528 -
529 -- ret = do_python_single(NULL, inst->detach.function, "detach", inst->pass_all_vps, inst->pass_all_vps_dict);
530 -+ if (inst->detach.function) ret = do_python_single(NULL, inst->detach.function, "detach", inst->pass_all_vps, inst->pass_all_vps_dict);
531 -
532 - #define PYTHON_FUNC_DESTROY(_x) python_function_destroy(&inst->_x)
533 - PYTHON_FUNC_DESTROY(instantiate);
534 -- PYTHON_FUNC_DESTROY(authorize);
535 - PYTHON_FUNC_DESTROY(authenticate);
536 -+ PYTHON_FUNC_DESTROY(authorize);
537 - PYTHON_FUNC_DESTROY(preacct);
538 - PYTHON_FUNC_DESTROY(accounting);
539 - PYTHON_FUNC_DESTROY(checksimul);
540 -+#ifdef WITH_PROXY
541 -+ PYTHON_FUNC_DESTROY(pre_proxy);
542 -+ PYTHON_FUNC_DESTROY(post_proxy);
543 -+#endif
544 -+ PYTHON_FUNC_DESTROY(post_auth);
545 -+#ifdef WITH_COA
546 -+ PYTHON_FUNC_DESTROY(recv_coa);
547 -+ PYTHON_FUNC_DESTROY(send_coa);
548 -+#endif
549 - PYTHON_FUNC_DESTROY(detach);
550 -
551 - Py_DecRef(inst->pythonconf_dict);
552 -@@ -1313,14 +1333,8 @@ static int mod_detach(void *instance)
553 - PyThreadState_Swap(main_interpreter); /* Swap to the main thread */
554 - Py_Finalize();
555 - dlclose(python_dlhandle);
556 --
557 --#if PY_VERSION_HEX > 0x03050000
558 -- //if (inst->wide_name) PyMem_RawFree(inst->wide_name);
559 -- //if (inst->wide_path) PyMem_RawFree(inst->wide_path);
560 --#endif
561 - }
562 -
563 --
564 - return ret;
565 - }
566 -
567 -@@ -1348,8 +1362,10 @@ module_t rlm_python3 = {
568 - [MOD_PREACCT] = mod_preacct,
569 - [MOD_ACCOUNTING] = mod_accounting,
570 - [MOD_SESSION] = mod_checksimul,
571 -+#ifdef WITH_PROXY
572 - [MOD_PRE_PROXY] = mod_pre_proxy,
573 - [MOD_POST_PROXY] = mod_post_proxy,
574 -+#endif
575 - [MOD_POST_AUTH] = mod_post_auth,
576 - #ifdef WITH_COA
577 - [MOD_RECV_COA] = mod_recv_coa,
578
579 diff --git a/net-dialup/freeradius/files/radius.conf-r4 b/net-dialup/freeradius/files/radius.conf-r4
580 deleted file mode 100644
581 index a5760d2..0000000
582 --- a/net-dialup/freeradius/files/radius.conf-r4
583 +++ /dev/null
584 @@ -1,16 +0,0 @@
585 -# Config file for /etc/init.d/radiusd
586 -
587 -# see man pages for radiusd run `radiusd -h`
588 -# for valid cmdline options
589 -#RADIUSD_OPTS=""
590 -
591 -# Change this value if you change it in /etc/raddb/radiusd.conf
592 -pidfile=/var/run/radiusd/radiusd.pid
593 -
594 -# Change these values if you change them in /etc/raddb/radiusd.conf
595 -RADIUSD_USER=radius
596 -RADIUSD_GROUP=radius
597 -
598 -# If you set up logging to syslog in /etc/raddb/radiusd.conf, you want
599 -# to uncomment the following line.
600 -#rc_use="logger"
601
602 diff --git a/net-dialup/freeradius/files/radius.init-r3 b/net-dialup/freeradius/files/radius.init-r3
603 deleted file mode 100644
604 index b4d7c38..0000000
605 --- a/net-dialup/freeradius/files/radius.init-r3
606 +++ /dev/null
607 @@ -1,31 +0,0 @@
608 -#!/sbin/openrc-run
609 -# Copyright 1999-2021 Gentoo Authors
610 -# Distributed under the terms of the GNU General Public License v2
611 -
612 -command=/usr/sbin/radiusd
613 -command_args="${RADIUSD_OPTS}"
614 -pidfile="${pidfile:-/run/radiusd/radiusd.pid}"
615 -extra_started_commands="reload"
616 -
617 -depend() {
618 - need localmount
619 - use dns
620 -}
621 -
622 -start_pre() {
623 - if [ ! -f /etc/raddb/radiusd.conf ] ; then
624 - eerror "No /etc/raddb/radiusd.conf file exists!"
625 - return 1
626 - fi
627 -
628 - checkpath -m0750 -o "${RADIUSD_USER:-root}:${RADIUSD_GROUP:-root}" -d \
629 - $(dirname ${pidfile}) /var/log/radius
630 - checkpath -m0750 -o "${RADIUSD_USER:-root}:${RADIUSD_GROUP:-root}" -d \
631 - $(dirname ${pidfile}) /run/radiusd
632 -}
633 -
634 -reload() {
635 - ebegin "Reloading radiusd"
636 - kill -HUP $(cat ${pidfile})
637 - eend $?
638 -}
639
640 diff --git a/net-dialup/freeradius/freeradius-3.0.20-r1.ebuild b/net-dialup/freeradius/freeradius-3.0.20-r1.ebuild
641 deleted file mode 100644
642 index 7a83429..0000000
643 --- a/net-dialup/freeradius/freeradius-3.0.20-r1.ebuild
644 +++ /dev/null
645 @@ -1,267 +0,0 @@
646 -# Copyright 1999-2021 Gentoo Authors
647 -# Distributed under the terms of the GNU General Public License v2
648 -
649 -EAPI=7
650 -
651 -PYTHON_COMPAT=( python3_{6,7,8} )
652 -inherit autotools pam python-single-r1 systemd
653 -
654 -MY_P="${PN}-server-${PV}"
655 -
656 -DESCRIPTION="Highly configurable free RADIUS server"
657 -SRC_URI="
658 - ftp://ftp.freeradius.org/pub/radius/${MY_P}.tar.gz
659 - ftp://ftp.freeradius.org/pub/radius/old/${MY_P}.tar.gz
660 -"
661 -HOMEPAGE="http://www.freeradius.org/"
662 -
663 -KEYWORDS="amd64 ~arm arm64 ~ppc ~ppc64 ~sparc x86"
664 -LICENSE="GPL-2"
665 -SLOT="0"
666 -
667 -IUSE="
668 - debug firebird iodbc kerberos ldap memcached mysql mongodb odbc oracle pam
669 - pcap postgres python readline redis rest samba sqlite ssl systemd
670 -"
671 -RESTRICT="test firebird? ( bindist )"
672 -
673 -# NOTE: Temporary freeradius doesn't support linking with mariadb client
674 -# libs also if code is compliant, will be available in the next release.
675 -# (http://lists.freeradius.org/pipermail/freeradius-devel/2018-October/013228.html)a
676 -
677 -# TODO: rlm_mschap works with both samba library or without. I need to avoid
678 -# linking of samba library if -samba is used.
679 -RDEPEND="acct-group/radius
680 - acct-user/radius
681 - !net-dialup/cistronradius
682 - dev-lang/perl:=
683 - sys-libs/gdbm:=
684 - sys-libs/talloc
685 - firebird? ( dev-db/firebird )
686 - iodbc? ( dev-db/libiodbc )
687 - kerberos? ( virtual/krb5 )
688 - ldap? ( net-nds/openldap )
689 - memcached? ( dev-libs/libmemcached )
690 - mysql? ( dev-db/mysql-connector-c )
691 - mongodb? ( >=dev-libs/mongo-c-driver-1.13.0-r1 )
692 - odbc? ( dev-db/unixODBC )
693 - oracle? ( dev-db/oracle-instantclient-basic )
694 - pam? ( sys-libs/pam )
695 - pcap? ( net-libs/libpcap )
696 - postgres? ( dev-db/postgresql:= )
697 - python? ( ${PYTHON_DEPS} )
698 - readline? ( sys-libs/readline:0= )
699 - redis? ( dev-libs/hiredis:= )
700 - rest? ( dev-libs/json-c:= )
701 - samba? ( net-fs/samba )
702 - sqlite? ( dev-db/sqlite:3 )
703 - ssl? ( dev-libs/openssl:0=[-bindist] )
704 - systemd? ( sys-apps/systemd )"
705 -DEPEND="${RDEPEND}"
706 -
707 -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
708 -
709 -S="${WORKDIR}/${MY_P}"
710 -
711 -PATCHES=(
712 - "${FILESDIR}"/${PN}-3.0.18-libressl.patch
713 - "${FILESDIR}"/${P}-systemd-service.patch
714 - # Fix rlm_python3 build
715 - # Backport from rlm_python changes to rlm_python3
716 - "${FILESDIR}"/${P}-py3-fixes.patch
717 -)
718 -
719 -pkg_setup() {
720 - if use python ; then
721 - python-single-r1_pkg_setup
722 - export PYTHONBIN="${EPYTHON}"
723 - fi
724 -}
725 -
726 -src_prepare() {
727 - # most of the configuration options do not appear as ./configure
728 - # switches. Instead it identifies the directories that are available
729 - # and run through them. These might check for the presence of
730 - # various libraries, in which case they are not built. To avoid
731 - # automagic dependencies, we just remove all the modules that we're
732 - # not interested in using.
733 -
734 - eapply_user
735 - default
736 -
737 - use ssl || { rm -r src/modules/rlm_eap/types/rlm_eap_{tls,ttls,peap} || die ; }
738 - use ldap || { rm -r src/modules/rlm_ldap || die ; }
739 - use kerberos || { rm -r src/modules/rlm_krb5 || die ; }
740 - use memcached || { rm -r src/modules/rlm_cache/drivers/rlm_cache_memcached || die ; }
741 - use pam || { rm -r src/modules/rlm_pam || die ; }
742 - # Drop support of python2
743 - rm -r src/modules/rlm_python || die
744 - use python || { rm -r src/modules/rlm_python3 || die ; }
745 - use rest || { rm -r src/modules/rlm_rest || die ; }
746 - use redis || { rm -r src/modules/rlm_redis{,who} || die ; }
747 - # Do not install ruby rlm module, bug #483108
748 - rm -r src/modules/rlm_ruby || die
749 -
750 - # these are all things we don't have in portage/I don't want to deal
751 - # with myself
752 - rm -r src/modules/rlm_eap/types/rlm_eap_tnc || die # requires TNCS library
753 - rm -r src/modules/rlm_eap/types/rlm_eap_ikev2 || die # requires libeap-ikev2
754 - rm -r src/modules/rlm_opendirectory || die # requires some membership.h
755 - rm -r src/modules/rlm_sql/drivers/rlm_sql_{db2,freetds} || die
756 -
757 - # sql drivers that are not part of experimental are loaded from a
758 - # file, so we have to remove them from the file itself when we
759 - # remove them.
760 - usesqldriver() {
761 - local flag=$1
762 - local driver=rlm_sql_${2:-${flag}}
763 -
764 - if ! use ${flag}; then
765 - rm -r src/modules/rlm_sql/drivers/${driver} || die
766 - sed -i -e /${driver}/d src/modules/rlm_sql/stable || die
767 - fi
768 - }
769 -
770 - sed -i \
771 - -e 's:^#\tuser = :\tuser = :g' \
772 - -e 's:^#\tgroup = :\tgroup = :g' \
773 - -e 's:/var/run/radiusd:/run/radiusd:g' \
774 - -e '/^run_dir/s:${localstatedir}::g' \
775 - raddb/radiusd.conf.in || die
776 -
777 - # verbosity
778 - # build shared libraries using jlibtool --shared
779 - sed -i \
780 - -e '/$(LIBTOOL)/s|--quiet ||g' \
781 - -e 's:--mode=\(compile\|link\):& --shared:g' \
782 - Make.inc.in || die
783 -
784 - sed -i \
785 - -e 's|--silent ||g' \
786 - -e 's:--mode=\(compile\|link\):& --shared:g' \
787 - scripts/libtool.mk || die
788 -
789 - # crude measure to stop jlibtool from running ranlib and ar
790 - sed -i \
791 - -e '/LIBRARIAN/s|".*"|"true"|g' \
792 - -e '/RANLIB/s|".*"|"true"|g' \
793 - scripts/jlibtool.c || die
794 -
795 - usesqldriver mysql
796 - usesqldriver postgres postgresql
797 - usesqldriver firebird
798 - usesqldriver iodbc
799 - usesqldriver odbc unixodbc
800 - usesqldriver oracle
801 - usesqldriver sqlite
802 - usesqldriver mongodb mongo
803 -
804 - eautoreconf
805 -}
806 -
807 -src_configure() {
808 - # do not try to enable static with static-libs; upstream is a
809 - # massacre of libtool best practices so you also have to make sure
810 - # to --enable-shared explicitly.
811 - local myeconfargs=(
812 - --enable-shared
813 - --disable-static
814 - --disable-ltdl-install
815 - --with-system-libtool
816 - --with-system-libltdl
817 - --with-ascend-binary
818 - --with-udpfromto
819 - --with-dhcp
820 - --with-iodbc-include-dir=/usr/include/iodbc
821 - --with-experimental-modules
822 - --with-docdir=/usr/share/doc/${PF}
823 - --with-logdir=/var/log/radius
824 - $(use_enable debug developer)
825 - $(use_with ldap edir)
826 - $(use_with ssl openssl)
827 - $(use_with systemd systemd)
828 - )
829 - # fix bug #77613
830 - if has_version app-crypt/heimdal; then
831 - myeconfargs+=( --enable-heimdal-krb5 )
832 - fi
833 -
834 - if use python ; then
835 - myeconfargs+=(
836 - --with-rlm-python3-bin=${EPYTHON}
837 - --with-rlm-python3-config-bin=${EPYTHON}-config
838 - )
839 - fi
840 -
841 - use readline || export ac_cv_lib_readline=no
842 - use pcap || export ac_cv_lib_pcap_pcap_open_live=no
843 -
844 - econf "${myeconfargs[@]}"
845 -}
846 -
847 -src_compile() {
848 - # verbose, do not generate certificates
849 - emake \
850 - Q='' ECHO=true \
851 - LOCAL_CERT_PRODUCTS=''
852 -}
853 -
854 -src_install() {
855 - dodir /etc
856 - diropts -m0750 -o root -g radius
857 - dodir /etc/raddb
858 - diropts -m0750 -o radius -g radius
859 - dodir /var/log/radius
860 - keepdir /var/log/radius/radacct
861 - diropts
862 -
863 - # verbose, do not install certificates
864 - # Parallel install fails (#509498)
865 - emake -j1 \
866 - Q='' ECHO=true \
867 - LOCAL_CERT_PRODUCTS='' \
868 - R="${D}" \
869 - install
870 -
871 - pamd_mimic_system radiusd auth account password session
872 -
873 - # fix #711756
874 - fowners -R radius:radius /etc/raddb
875 - fowners -R radius:radius /var/log/radius
876 -
877 - dodoc CREDITS
878 -
879 - rm "${ED}/usr/sbin/rc.radiusd" || die
880 -
881 - newinitd "${FILESDIR}/radius.init-r3" radiusd
882 - newconfd "${FILESDIR}/radius.conf-r4" radiusd
883 -
884 - if ! use systemd ; then
885 - # If systemd builtin is not enabled we need use Type=Simple
886 - # as systemd .service
887 - sed -i -e 's:^Type=.*::g' \
888 - -e 's:^WatchdogSec=.*::g' -e 's:^NotifyAccess=all.*::g' \
889 - "${S}"/debian/freeradius.service
890 - fi
891 - systemd_dounit "${S}"/debian/freeradius.service
892 -
893 - find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
894 -
895 -}
896 -
897 -pkg_config() {
898 - if use ssl; then
899 - cd "${ROOT}"/etc/raddb/certs || die
900 - ./bootstrap || die "Error while running ./bootstrap script."
901 - fowners root:radius "${ROOT}"/etc/raddb/certs
902 - fowners root:radius "${ROOT}"/etc/raddb/certs/ca.pem
903 - fowners root:radius "${ROOT}"/etc/raddb/certs/server.{key,crt,pem}
904 - fi
905 -}
906 -
907 -pkg_preinst() {
908 - if ! has_version ${CATEGORY}/${PN} && use ssl; then
909 - elog "You have to run \`emerge --config =${CATEGORY}/${PF}\` to be able"
910 - elog "to start the radiusd service."
911 - fi
912 -}