[redhat-lspp] Patch - CUPS local unix sockets

Matt Anderson mra at hp.com
Tue Oct 18 15:52:03 UTC 2005


Steve Grubb wrote:
> In cups/scheduler/conf.c
> 
> +strlcpy(temp->address.sun_path, value, 108);
> 
> I think it would be better to base the size off of the sun_path instead of 
> 108. BTW, in all the places you have 108, wouldn't it be better to have 
> UNIX_PATH_MAX?

This was something that bothered me when I was writing it.  <sys/un.h>
only has 108 in the sockaddr_un data structure and I thought a #defined
constant would be better.  Now that you mention UNIX_PATH_MAX I see
there is a <linux/un.h> which has that #define and essentially the same
data structure.  I'll add some logic to the runtime version to use that
if available.

> +temp->address.sun_family = AF_LOCAL;
> 
> In other places, you use AF_UNIX. Shouldn't this be consistent?

Yes, good catch, thanks.

-matt




More information about the redhat-lspp mailing list