FreeRADIUS 2.1.8 fails to build when configured --without-pthreads
FreeRADIUS 2.1.8 HP NonStop OSS src/main/event.c compile fails when configured --without-pthreads, because WITH_PROXY is still defined in radius.h I defined WITHOUT_PROXY and WITHOUT_COA and am still getting a lot of errors. Any advice? Also, how should WITHOUT_PROXY/WITHOUT_COA/whatever be specified during configure -- by using CPPFLAGS? And how should I report nitpicky gcc-isms?
Scott Neugroschl wrote:
src/main/event.c compile fails when configured --without-pthreads, because WITH_PROXY is still defined in radius.h
Why are you configuring it with those options? While they're intended to work, they are *not* intended for general use. i.e. if you care enough about program size, complexity, whatever to edit those options, you're in a very esoteric problem space.
Any advice?
Edit the source code...
Also, how should WITHOUT_PROXY/WITHOUT_COA/whatever be specified during configure -- by using CPPFLAGS?
Yes. They are not intended for general use.
And how should I report nitpicky gcc-isms?
We see them already when doing development builds. Please report fixes, not compiler warnings. Alan DeKok.
Quoth Alan Dekok:
And how should I report nitpicky gcc-isms?
We see them already when doing development builds. Please report fixes, not compiler warnings.
diff -C 1 -c listings: [[SAN]] *** freeradius-server-2.1.8/libltdl/ltdl.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/libltdl/ltdl.c.new Tue Apr 20 07:25:27 2010 *************** *** 2442,2453 **** while (loader) { if (useloader && strcmp(loader->loader_name, useloader)) { loader = loader->next; continue; } ! lt_user_data data = loader->dlloader_data; cur->module = loader->module_open (data, filename); --- 2442,2455 ---- while (loader) { + lt_user_data data; /* san */ if (useloader && strcmp(loader->loader_name, useloader)) { loader = loader->next; continue; } ! /* lt_user_data data = loader->dlloader_data; */ /* SAN */ ! data = loader->dlloader_data; /* SAN */ cur->module = loader->module_open (data, filename); *** freeradius-server-2.1.8/src/include/missing.h Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/include/missing.h.new Tue Apr 20 07:32:53 2010 *************** *** 273,278 **** --- 273,282 ---- uint16_t ss_family; /* Address family, etc. */ char ss_padding[128 - (sizeof(uint16_t))]; }; + #else /* BEGIN SAN */ + #ifdef __TANDEM + #define ss_family __ss_family + #endif #endif /* HAVE_STRUCT_SOCKADDR_STORAGE */ #ifndef HAVE_STRUCT_ADDRINFO *** freeradius-server-2.1.8/src/main/auth.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/main/auth.c.new Tue Apr 20 09:28:18 2010 *************** *** 175,183 **** */ cur_config_item = request->config_items; while(((auth_type_pair = pairfind(cur_config_item, PW_AUTH_TYPE))) != NULL) { auth_type = auth_type_pair->vp_integer; auth_type_count++; ! DICT_VALUE *dv = dict_valbyattr(auth_type_pair->attribute, auth_type_pair->vp_integer); RDEBUG2("Found Auth-Type = %s", --- 175,187 ---- */ cur_config_item = request->config_items; while(((auth_type_pair = pairfind(cur_config_item, PW_AUTH_TYPE))) != NULL) { + DICT_VALUE *dv = NULL; /* SAN */ auth_type = auth_type_pair->vp_integer; auth_type_count++; ! /* SAN DICT_VALUE *dv = dict_valbyattr(auth_type_pair->attribute, ! auth_type_pair->vp_integer); ! */ ! dv = dict_valbyattr(auth_type_pair->attribute, auth_type_pair->vp_integer); RDEBUG2("Found Auth-Type = %s", *** freeradius-server-2.1.8/src/main/command.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/main/command.c.new Tue Apr 20 09:33:16 2010 *************** *** 842,848 **** return 0; } ! cf_section2file(fp, client->cs); fclose(fp); return 1; --- 842,848 ---- return 0; } ! cf_section2file(fp, /* SAN */(CONF_SECTION*)client->cs); fclose(fp); return 1; *** freeradius-server-2.1.8/src/main/event.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/main/event.c.new Tue Apr 20 10:04:32 2010 *************** *** 21,26 **** --- 21,30 ---- * Copyright 2007 Alan DeKok <aland@deployingradius.com> */ + + #define WITHOUT_PROXY /* SAN */ + #define WITHOUT_COA /* SAN */ + #include <freeradius-devel/ident.h> RCSID("$Id$") *** freeradius-server-2.1.8/src/main/listen.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/main/listen.c.new Tue Apr 20 09:33:05 2010 *************** *** 126,132 **** last_printed = now; } ! listener->print(listener, name, sizeof(name)); radlog(L_ERR, "Ignoring request to %s from unknown client %s port %d", name, inet_ntop(ipaddr->af, &ipaddr->ipaddr, --- 126,132 ---- last_printed = now; } ! listener->print(/* SAN */(rad_listen_t*)listener, name, sizeof(name)); radlog(L_ERR, "Ignoring request to %s from unknown client %s port %d", name, inet_ntop(ipaddr->af, &ipaddr->ipaddr, *************** *** 206,212 **** request = request_alloc(); if (!request) goto unknown; ! request->listener = listener; request->client = client; request->packet = rad_recv(listener->fd, 0x02); /* MSG_PEEK */ if (!request->packet) { /* badly formed, etc */ --- 206,212 ---- request = request_alloc(); if (!request) goto unknown; ! request->listener = /* SAN */(rad_listen_t*)listener; request->client = client; request->packet = rad_recv(listener->fd, 0x02); /* MSG_PEEK */ if (!request->packet) { /* badly formed, etc */ *** freeradius-server-2.1.8/src/main/log.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/main/log.c.new Tue Apr 20 09:35:58 2010 *************** *** 384,390 **** s[1] = '\0'; } ! s = fr_int2str(levels, (lvl & ~L_CONS), ": "); strcat(buffer, s); len = strlen(buffer); --- 384,390 ---- s[1] = '\0'; } ! s = /* SAN */ (char *) fr_int2str(levels, (lvl & ~L_CONS), ": "); strcat(buffer, s); len = strlen(buffer); *** freeradius-server-2.1.8/src/main/xlat.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/main/xlat.c.new Tue Apr 20 09:49:52 2010 *************** *** 572,578 **** * Register the internal packet xlat's. */ for (i = 0; internal_xlat[i] != NULL; i++) { ! xlat_register(internal_xlat[i], xlat_packet, &xlat_inst[i]); c = xlat_find(internal_xlat[i]); rad_assert(c != NULL); c->internal = TRUE; --- 572,578 ---- * Register the internal packet xlat's. */ for (i = 0; internal_xlat[i] != NULL; i++) { ! xlat_register(internal_xlat[i], xlat_packet, /* SAN */(void*)&xlat_inst[i]); c = xlat_find(internal_xlat[i]); rad_assert(c != NULL); c->internal = TRUE; *************** *** 581,587 **** /* * New name: "control" */ ! xlat_register("control", xlat_packet, &xlat_inst[0]); c = xlat_find("control"); rad_assert(c != NULL); c->internal = TRUE; --- 581,587 ---- /* * New name: "control" */ ! xlat_register("control", xlat_packet, /* SAN */(void*)&xlat_inst[0]); c = xlat_find("control"); rad_assert(c != NULL); c->internal = TRUE; *************** *** 593,599 **** buffer[1] = '\0'; for (i = 0; i <= REQUEST_MAX_REGEX; i++) { buffer[0] = '0' + i; ! xlat_register(buffer, xlat_regex, &xlat_inst[i]); c = xlat_find(buffer); rad_assert(c != NULL); c->internal = TRUE; --- 593,599 ---- buffer[1] = '\0'; for (i = 0; i <= REQUEST_MAX_REGEX; i++) { buffer[0] = '0' + i; ! xlat_register(buffer, xlat_regex, /* SAN */(void*)&xlat_inst[i]); c = xlat_find(buffer); rad_assert(c != NULL); c->internal = TRUE; *************** *** 601,612 **** #endif /* HAVE_REGEX_H */ ! xlat_register("debug", xlat_debug, &xlat_inst[0]); c = xlat_find("debug"); rad_assert(c != NULL); c->internal = TRUE; ! xlat_register("md5", xlat_md5, &xlat_inst[0]); c = xlat_find("md5"); rad_assert(c != NULL); c->internal = TRUE; --- 601,612 ---- #endif /* HAVE_REGEX_H */ ! xlat_register("debug", xlat_debug, /* SAN */(void*)&xlat_inst[0]); c = xlat_find("debug"); rad_assert(c != NULL); c->internal = TRUE; ! xlat_register("md5", xlat_md5, /* SAN */(void*)&xlat_inst[0]); c = xlat_find("md5"); rad_assert(c != NULL); c->internal = TRUE; *** freeradius-server-2.1.8/src/modules/rlm_dbm/rlm_dbm.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/modules/rlm_dbm/rlm_dbm.c.new Tue Apr 20 07:43:17 2010 *************** *** 206,212 **** if ( parse_state == SMP_PATTERN ) { /* pattern line found */ DEBUG2("process pattern"); /* check pattern against request */ ! if ( paircompare(req, request, vp, reply ) == 0 ) { DEBUG2("rlm_dbm: Pattern matched, look for request"); pairmove(&tmp_config, &vp); pairfree(&vp); --- 206,212 ---- if ( parse_state == SMP_PATTERN ) { /* pattern line found */ DEBUG2("process pattern"); /* check pattern against request */ ! if ( paircompare(req, /* SAN */ (VALUE_PAIR*)request, vp, reply ) == 0 ) { DEBUG2("rlm_dbm: Pattern matched, look for request"); pairmove(&tmp_config, &vp); pairfree(&vp); *** freeradius-server-2.1.8/src/modules/rlm_policy/parse.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/modules/rlm_policy/parse.c.new Tue Apr 20 09:24:14 2010 *************** *** 1532,1538 **** } if ((lexer->debug & POLICY_DEBUG_PRINT_POLICY) != 0) { ! rlm_policy_print(this); } return 1; --- 1532,1538 ---- } if ((lexer->debug & POLICY_DEBUG_PRINT_POLICY) != 0) { ! rlm_policy_print(/* SAN */(policy_item_t*)this); } return 1;
Scott Neugroschl wrote:
diff -C 1 -c listings:
Please also see doc/DIFFS.
*** freeradius-server-2.1.8/libltdl/ltdl.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/libltdl/ltdl.c.new Tue Apr 20 07:25:27 2010 *************** *** 2442,2453 ****
while (loader) { if (useloader && strcmp(loader->loader_name, useloader)) { loader = loader->next; continue; } ! lt_user_data data = loader->dlloader_data;
What does that do?
+ lt_user_data data; /* san */
I would really prefer to see patches without /* san */. It's unnecessary, and it complicates the code.
+ #else /* BEGIN SAN */ + #ifdef __TANDEM + #define ss_family __ss_family + #endif
That's a good patch which doesn't affect any other platform.
*** freeradius-server-2.1.8/src/main/auth.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/main/auth.c.new Tue Apr 20 09:28:18 2010 *************** *** 175,183 **** */ cur_config_item = request->config_items; while(((auth_type_pair = pairfind(cur_config_item, PW_AUTH_TYPE))) != NULL) { auth_type = auth_type_pair->vp_integer; auth_type_count++; ! DICT_VALUE *dv = dict_valbyattr(auth_type_pair->attribute, auth_type_pair->vp_integer);
I don't see why that's necessary.
*** freeradius-server-2.1.8/src/main/command.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/main/command.c.new Tue Apr 20 09:33:16 2010 *************** *** 842,848 **** return 0; }
! cf_section2file(fp, client->cs);
What is that patch supposed to do?
+ + #define WITHOUT_PROXY /* SAN */ + #define WITHOUT_COA /* SAN */ +
Absolutely not. Patches which *force* behavior for a particular platform also *break* behavior for all other platforms. The server is supposed to work on platforms other than /* san */. If you want to maintain a platform-specific version, learn to use "git".
*** freeradius-server-2.1.8/src/main/listen.c Wed Dec 30 07:44:35 2009 --- freeradius-server-2.1.8/src/main/listen.c.new Tue Apr 20 09:33:05 2010 *************** *** 126,132 **** last_printed = now; }
! listener->print(listener, name, sizeof(name));
I see... "fix" compile warnings by deleting the code. Absolutely not. This shows you haven't spent any time thinking about any side-effects of the patches. After that... I've ignored the rest of your patches. I don't feel like double-checking changes which destroy the server. Alan DeKok.
-----Original Message----- From: freeradius-devel-bounces+redfloyd=gmail.com@lists.freeradius.org [mailto:freeradius-devel- bounces+redfloyd=gmail.com@lists.freeradius.org] On Behalf Of Alan DeKok Sent: Tuesday, April 20, 2010 1:38 PM To: FreeRadius developers mailing list Subject: Re: FreeRADIUS 2.1.8 fails to build when configured --without- pthreads
Scott Neugroschl wrote:
diff -C 1 -c listings:
Please also see doc/DIFFS.
Sorry. My system doesn't have "diff -u", it's not a GNU-based system. Suggestions?
On 04/20/2010 05:47 PM, Scott Neugroschl wrote:
-----Original Message----- From: freeradius-devel-bounces+redfloyd=gmail.com@lists.freeradius.org [mailto:freeradius-devel- bounces+redfloyd=gmail.com@lists.freeradius.org] On Behalf Of Alan DeKok Sent: Tuesday, April 20, 2010 1:38 PM To: FreeRadius developers mailing list Subject: Re: FreeRADIUS 2.1.8 fails to build when configured --without- pthreads
Scott Neugroschl wrote:
diff -C 1 -c listings:
Please also see doc/DIFFS.
Sorry.
My system doesn't have "diff -u", it's not a GNU-based system. Suggestions?
man diff And find out which arg produces a a "unified diff". Unified diff should be available because it's been in use for two decades and is the preferred format. If your diff program can't produce the unified format then the "context" format you supplied should be acceptable because every patch implementation I'm aware of accepts the older context format. Also you should supply (at least) 3 lines of context. -- John Dennis <jdennis@redhat.com> Looking to carve out IT costs? www.redhat.com/carveoutcosts/
-----Original Message----- From: John Dennis [mailto:jdennis@redhat.com] man diff
And find out which arg produces a a "unified diff". [[SAN]] None did. It's an oddball system.
Unified diff should be available because it's been in use for two decades and is the preferred format.
If your diff program can't produce the unified format then the "context" format you supplied should be acceptable because every patch implementation I'm aware of accepts the older context format. Also you should supply (at least) 3 lines of context.
[[SAN]] Thanks, John. I got access to a system with GNU diff.
participants (3)
-
Alan DeKok -
John Dennis -
Scott Neugroschl