control-socket name one character short

John Dennis jdennis at redhat.com
Thu Oct 23 00:00:56 CEST 2008


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 at redhat.com>




More information about the Freeradius-Users mailing list