control-socket name one character short
I have installed version 2.1.1 on FreeBSD 7.0 from source obtained at download link on www.freeradius.org. The server "just works"! Thank you Mr. DeKok et. al. I wanted to try radmin, so I copied control-socket from sites-available to sites-enabled. When I started the server I received # radiusd -X <snip> radiusd: #### Opening IP addresses and Ports #### listen { type = "auth" ipaddr = * port = 0 } listen { type = "acct" ipaddr = * port = 0 } listen { type = "control" listen { socket = "/usr/local/var/run/radiusd/radiusd.sock" } Failed setting permissions on /usr/local/var/run/radiusd/radiusd.sock: No such file or directory # # ls /usr/local/var/run/radiusd radiusd.soc The socket was created but the name was missing a character I tried on a FreeBSD 6.2 box with the same results. Other than not being able to enable control-socket, everything else works fine. I did try building from the github sources, but received an error: . . . gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -DNDEBUG -D_LIBRADIUS -I/usr/home/tester/Work/RADIUS/radius-2.1.1z/src -c valuepair.c -fPIC -DPIC -o .libs/valuepair.o valuepair.c: In function `pairread': valuepair.c:1737: error: `pair' undeclared (first use in this function) valuepair.c:1737: error: (Each undeclared identifier is reported only once valuepair.c:1737: error: for each function it appears in.) valuepair.c:1742: error: break statement not within loop or switch valuepair.c:1747: error: case label not within a switch statement valuepair.c:1762: error: break statement not within loop or switch valuepair.c: At top level: valuepair.c:1768: error: syntax error before "if" gmake[4]: *** [valuepair.lo] Error 1 gmake[4]: Leaving directory `/usr/home/tester/Work/RADIUS/radius-2.1.1z/src/lib' gmake[3]: *** [common] Error 2 gmake[3]: Leaving directory `/usr/home/tester/Work/RADIUS/radius-2.1.1z/src' gmake[2]: *** [all] Error 2 gmake[2]: Leaving directory `/usr/home/tester/Work/RADIUS/radius-2.1.1z/src' gmake[1]: *** [common] Error 2 gmake[1]: Leaving directory `/usr/home/tester/Work/RADIUS/radius-2.1.1z' gmake: *** [all] Error 2 Judging from the commit times, I believe valuepair.c was in the process of being changed and may already be fixed. When do you sleep Mr. DeKok? -- Zoltan Ori
Zoltan Ori wrote:
I have installed version 2.1.1 on FreeBSD 7.0 from source obtained at download link on www.freeradius.org. The server "just works"! Thank you Mr. DeKok et. al.
You're welcome. That's the goal...
I wanted to try radmin, so I copied control-socket from sites-available to sites-enabled. When I started the server I received .. The socket was created but the name was missing a character
Hmm... OK. The code should be using SUN_LEN to get the size of the socket. I'll commit a fix.
I did try building from the github sources, but received an error:
I've committed a fix for that. And the github version is just a mirror of git.freeradius.org.
When do you sleep Mr. DeKok?
:) Rarely. I also have a day job. I'm co-chair of a working group at a standards body. I follow multiple other standards bodies. I have two other companies I'm involved with... A lot of it is the ability to read very fast, and to type very fast. Alan DeKok.
Alan DeKok wrote:
Zoltan Ori wrote:
I have installed version 2.1.1 on FreeBSD 7.0 from source obtained at download link on www.freeradius.org. The server "just works"! Thank you Mr. DeKok et. al.
You're welcome. That's the goal...
I wanted to try radmin, so I copied control-socket from sites-available to sites-enabled. When I started the server I received
..
The socket was created but the name was missing a character
Hmm... OK. The code should be using SUN_LEN to get the size of the socket. I'll commit a fix.
I look at this thread, because I also would like to use radmin on Freebsd 7.0, and have had the same type of issue. Did you had time to commit a fix or will that be available in future releases. Thomas
I did try building from the github sources, but received an error:
I've committed a fix for that.
And the github version is just a mirror of git.freeradius.org.
When do you sleep Mr. DeKok?
:) Rarely.
I also have a day job. I'm co-chair of a working group at a standards body. I follow multiple other standards bodies. I have two other companies I'm involved with...
A lot of it is the ability to read very fast, and to type very fast.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Thomas Fagart wrote:
I look at this thread, because I also would like to use radmin on Freebsd 7.0, and have had the same type of issue. Did you had time to commit a fix or will that be available in future releases.
Grab the "stable" tar file from github. See git.freeradius.org for instructions. It will be 2.1.2 in a week or so. Alan DeKok.
Alan DeKok wrote:
Thomas Fagart wrote:
I look at this thread, because I also would like to use radmin on Freebsd 7.0, and have had the same type of issue. Did you had time to commit a fix or will that be available in future releases.
Grab the "stable" tar file from github. See git.freeradius.org for instructions. It will be 2.1.2 in a week or so.
Ok now it creates properly radiusd.sock, thank you ,but I still can't get connected through the socket Below some debug if that could help ----------------------------------------- Radiusd -X Listening on authentication address * port 1812 Listening on accounting address * port 1813 Listening on command file /usr/local/var/run/radiusd/radiusd.sock Listening on status address 127.0.0.1 port 18120 as server status Listening on proxy address * port 1814 Ready to process requests. -------------------------------- portable-bsd# ls -l total 0 srw-rw---- 1 root freeradius 0 Oct 21 23:10 radiusd.sock portable-bsd# pwd /usr/local/var/run/radiusd portable-bsd# radmin radmin: Failed connecting to /usr/local/var/run/radiusd/radiusd.sock: No such file or directory portable-bsd# radmin -f /usr/local/var/run/radiusd/radiusd.sock radmin: Failed connecting to /usr/local/var/run/radiusd/radiusd.sock: No such file or directory portable-bsd# Thomas
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Thomas Fagart wrote:
Ok now it creates properly radiusd.sock, thank you ,but I still can't get connected through the socket ... Listening on command file /usr/local/var/run/radiusd/radiusd.sock
Ok, so the file *should* be there.
portable-bsd# radmin radmin: Failed connecting to /usr/local/var/run/radiusd/radiusd.sock: No such file or directory
So... is the file there? You can use "ls" to see it. I don't have access to a BSD machine, so I can't test this. Alan DeKok.
On Wed, 22 Oct 2008 10:24:32 +0200, Alan DeKok <aland@deployingradius.com> wrote:
Thomas Fagart wrote:
Ok now it creates properly radiusd.sock, thank you ,but I still can't get connected through the socket ... Listening on command file /usr/local/var/run/radiusd/radiusd.sock
Ok, so the file *should* be there.
Yes it is (it was in my previous mail, but I can show it again) portable-bsd# ls -l total 0 srw-rw---- 1 root freeradius 0 Oct 21 23:10 radiusd.sock portable-bsd# pwd /usr/local/var/run/radiusd I though it was a question of rights, but even when I chmod/chown it with more rights I still get the following error. radmin: Failed connecting to /usr/local/var/run/radiusd/radiusd.sock: No such file or directory
portable-bsd# radmin radmin: Failed connecting to /usr/local/var/run/radiusd/radiusd.sock: No such file or directory
So... is the file there? You can use "ls" to see it.
I don't have access to a BSD machine, so I can't test this.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Thomas Fagart wrote:
I though it was a question of rights, but even when I chmod/chown it with more rights I still get the following error.
radmin: Failed connecting to /usr/local/var/run/radiusd/radiusd.sock: No such file or directory
<shrug> If that's the error being returned by the OS, I'm not sure what else to suggest. Alan DeKok.
Alan DeKok wrote:
Thomas Fagart wrote:
I though it was a question of rights, but even when I chmod/chown it with more rights I still get the following error.
radmin: Failed connecting to /usr/local/var/run/radiusd/radiusd.sock: No such file or directory
<shrug> If that's the error being returned by the OS, I'm not sure what else to suggest.
strace/truss and find out what filename it is really trying to use? -- REALITY.SYS not found: Universe halted.
Andrew Hood wrote:
Alan DeKok wrote:
Thomas Fagart wrote:
I though it was a question of rights, but even when I chmod/chown it with more rights I still get the following error.
radmin: Failed connecting to /usr/local/var/run/radiusd/radiusd.sock: No such file or directory
<shrug> If that's the error being returned by the OS, I'm not sure what else to suggest.
strace/truss and find out what filename it is really trying to use?
I've tried with truss and it gives the following portable-bsd# truss radmin .... .... stat("/usr/local/etc/raddb/sites-enabled/control-socket",{mode=-rw-r----- ,inode=2357223,size=2056,blksize=4096}) = 0 (0x0) stat("/usr/local/etc/raddb/sites-enabled/control-socket",{mode=-rw-r----- ,inode=2357223,size=2056,blksize=4096}) = 0 (0x0) open("/usr/local/etc/raddb/sites-enabled/control-socket",O_RDONLY,0666) = 5 (0x5) fstat(5,{mode=-rw-r----- ,inode=2357223,size=2056,blksize=4096}) = 0 (0x0) read(5,"# -*- text -*-\n################"...,4096) = 2056 (0x808) read(5,0x2834c000,4096) = 0 (0x0) close(5) = 0 (0x0) getdirentries(0x4,0x2830d000,0x1000,0x2830c894,0x0,0x1000) = 0 (0x0) lseek(4,0x0,SEEK_SET) = 0 (0x0) close(4) = 0 (0x0) read(3,0x28308000,4096) = 0 (0x0) close(3) = 0 (0x0) socket(PF_LOCAL,SOCK_STREAM,0) = 3 (0x3) connect(3,{ AF_UNIX "/usr/local/var/run/radiusd/radiusd.sock(ô(Dì¿¿8X(Ê(" },40) ERR#2 'No such file or directory' radmin: Failed connecting to /usr/local/var/run/radiusd/radiusd.sock: No such file or directory write(2,"radmin: Failed connecting to /us"...,96) = 96 (0x60) close(3) = 0 (0x0) I'll try to understand what does it means, but do you have a clue with that output ? Thomas
Thomas Fagart wrote:
socket(PF_LOCAL,SOCK_STREAM,0) = 3 (0x3) connect(3,{ AF_UNIX "/usr/local/var/run/radiusd/radiusd.sock(ô(Dì¿¿8X(Ê(" },40) ERR#2 'No such file or directory' radmin: Failed connecting to /usr/local/var/run/radiusd/radiusd.sock: No such file or directory
I'll try to understand what does it means, but do you have a clue with that output ?
Look at the file name above, it has garbage at the end doesn't it? "/usr/local/var/run/radiusd/radiusd.sock(ô(Dì¿¿8X(Ê(" is not the same as: "/usr/local/var/run/radiusd/radiusd.sock" That's why it's not found. Also note in fr_domain_socket() the path is mem copied into struct sockaddr_un saremote but the error message uses the path directly. This is why the error show the correct path name but the connect call does not (because it's using saremote). Also observe when the path is copied into saremote the null terminator is not copied. I suspect this is the cause of the corruption of the path string in the saremote.sun_path field. sun_path should be null-terminated and the logic in fr_domain_socket needs to account for 1 extra byte for the null terminator in some fashion. -- John Dennis <jdennis@redhat.com>
John Dennis wrote:
Also note in fr_domain_socket() the path is mem copied into struct sockaddr_un saremote but the error message uses the path directly. This is why the error show the correct path name but the connect call does not (because it's using saremote). Also observe when the path is copied into saremote the null terminator is not copied. I suspect this is the cause of the corruption of the path string in the saremote.sun_path field. sun_path should be null-terminated and the logic in fr_domain_socket needs to account for 1 extra byte for the null terminator in some fashion.
Ah, yes. The fix that went into the server side didn't go into radmin. I'll do that now. Alan DeKok.
On Wed, 22 Oct 2008 18:00:56 -0400, John Dennis <jdennis@redhat.com> wrote:
Thomas Fagart wrote:
socket(PF_LOCAL,SOCK_STREAM,0) = 3 (0x3) connect(3,{ AF_UNIX "/usr/local/var/run/radiusd/radiusd.sock(ô(Dì¿¿8X(Ê(" },40) ERR#2 'No such file or directory' radmin: Failed connecting to /usr/local/var/run/radiusd/radiusd.sock: No such file or directory
I'll try to understand what does it means, but do you have a clue with that output ?
Look at the file name above, it has garbage at the end doesn't it?
"/usr/local/var/run/radiusd/radiusd.sock(ô(Dì¿¿8X(Ê("
is not the same as:
"/usr/local/var/run/radiusd/radiusd.sock"
That's why it's not found.
Ok thanks I've understood.
Also note in fr_domain_socket() the path is mem copied into struct sockaddr_un saremote but the error message uses the path directly. This is why the error show the correct path name but the connect call does not (because it's using saremote). Also observe when the path is copied into saremote the null terminator is not copied. I suspect this is the cause of the corruption of the path string in the saremote.sun_path field. sun_path should be null-terminated and the logic in fr_domain_socket needs to account for 1 extra byte for the null terminator in some fashion.
Hum this is not very clear for me, then what should I do for radmin to work, wait for new releases or bug corrections in FR, or is there something I should change in my system. Thomas
Many thanks, It works portable-bsd# radmin radmin 2.1.2 - FreeRADIUS Server administration tool. Copyright (C) 2008 The FreeRADIUS server project and contributors. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You may redistribute copies of FreeRADIUS under the terms of the GNU General Public License v2. radmin> Thomas On Thu, 23 Oct 2008 11:59:32 +0200, Alan DeKok <aland@deployingradius.com> wrote:
Thomas Fagart wrote:
Hum this is not very clear for me, then what should I do for radmin to work, wait for new releases or bug corrections in FR, or is there something I should change in my system.
Grab an updated version of the "stable" branch from github.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (5)
-
Alan DeKok -
Andrew Hood -
John Dennis -
Thomas Fagart -
Zoltan Ori