directory prefix in freeradius-devel vs. include
eran.pasternak at forescout.com
Wed Oct 21 15:56:50 CEST 2015
Thank you for the reply.
First let me clarify that I use one machine for development (where I compile radius ) and another for testing (where I run radius). The problem was that on the testing machine, radclient tried to access the dictionary in a path different from the one defined in Make.inc (and src/include/radpath.h). Now, thanx to your reply, I understand the reason. In my development env, 'freeradius-devel' was not a softlink but an actual directory! Seems that in one of the earliest code-branching the actual content of the link was copied and since this directory is not *configured*, radpath.h in it wasn't updated - and of course this is the file used for compilation.
So now I just have a question to better understand the usage of all these directories - please correct me if I'm wrong:
/src/include - contains the source headers for development.
/src/freeradius-devel - is a softlink to this dir, which facilitates experimenting with APIs (or any header definitions) by allowing to create copies of the include dir. without altering all the c files.
/usr/include - the installed copy of the headers. This allows using their content for developing or changing modules on the machine itself.
From: Freeradius-Devel [mailto:freeradius-devel-bounces+eran.pasternak=forescout.com at lists.freeradius.org] On Behalf Of Alan DeKok
Sent: Tuesday, October 20, 2015 6:25 PM
To: FreeRadius developers mailing list
Subject: Re: directory prefix in freeradius-devel vs. include
On Oct 20, 2015, at 10:39 AM, Eran Pasternak <eran.pasternak at forescout.com> wrote:
> I'm developing FR which is not installed in the standard location. Specifically raddb dir is not the default so when running radclient (and other applications) I have to add its location (with the '-d' flag). This is required even though the compilation is configured with the appropriate @prefix@ for this location.
Hmm.. you can check the file Make.inc to see what the raddbdir is set to. radclient *will* use that directory.
> I noticed that radclient.c (and others) use h files from 'freeradius-devel' and not 'include'.
Yes. Because you might already have FreeRADIUS headers installed for version X, and are building for version Y. If the build process for version Y used the standard include files, it would grab the headers for version X. And all kinds of things would go wrong.
When the headers are installed, the includes that *they* use are changed. See the make files in src/include.
> Now in the 'include' dir 'build-radpaths-h' uses my configured prefix while in 'freeradius-devel' it doesn't which is obviously the reason why the prefix have no effect for radclient.
I don't know what that means. "freeradius-devel" is a directory. What *file* contains the wrong prefix? Where is that file on disk?
On my system, I get:
$ grep RADDBDIR src/include/*.h
src/include/conf.h:#define RADIUS_DIR RADDBDIR
src/include/radpaths.h:#define RADDBDIR "/home/aland/test/etc/raddb"
Which is fine.
If I look in /usr/include/freeradius/radpaths.h, I might get a different value for RADDBDIR... because it's for a different version of the server.
> I couldn't find a way to make the configure script or whatever to place the prefix in 'freeradius-devel' as well.
Again, freeradius-devel is a directory. The file src/include/radpaths.h has the correct path for RADDBDIR... *for the version you are building*.
The file in /usr/include/freeradius/radpaths.h has the correct path *for the version which is installed*.
The two paths might be different.
> Bottom line is why are these two separate directories which are identical (aside from the paths)?
Because they're for two different versions of the server.
> And how to "convey" the prefix to the files in 'freeradius-devel'.
You don't. It's added there automatically.
When you're running radclient from the *installed* location, it uses the *installed* path for RADDBDIR. When you're building radclient from the *source*, that version of radclient uses the value of RADDBDIR which is taken from src/include/radpaths.h.
And *nothing* in the source tree does:
And the freeradius-devel directory is a symlink to src/include/ in the build tree.
So... *which* radclient are you running? The installed one? Or the one from the source tree?
Most of this confusion can be avoided by *not* installing a production version of FreeRADIUS on a development machine. That way there's only one version of radclient, only one version of the headers, and only one path for RADDBDIR.
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/devel.html
WARNING - CONFIDENTIAL INFORMATION:
The information contained in the e-mail may contain confidential and privileged information and is intended solely for the use of the intended recipient(s). Access for any review, re-transmission, dissemination or other use of, or taking of any action in regard and reliance upon this e-mail by persons or entities other than the intended recipient(s) is unauthorized and prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message and any attachments.
More information about the Freeradius-Devel