sockaddr_un.sun_path[] seem to be either 104 or 108 in following Unices: 104 - NetBSD, OpenBSD, FreeBSD, DragonFly BSD, MINIX, XNU(Apple OS X) 108 - illumos, Solaris, Linux You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/589
-- Commit Summary --
* lib/binrpc modules/ctl utils/kamcmd : set UNIX_PATH_MAX to lowest common value
-- File Changes --
M lib/binrpc/binrpc_api.c (2) M modules/ctl/init_socks.c (2) M utils/kamcmd/kamcmd.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/589.patch https://github.com/kamailio/kamailio/pull/589.diff
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/589
Why the lowest and not the highest? Is it used for buffers where the values are copied?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/589#issuecomment-215408321
UNIX_PATH_MAX is used to validate string length before memcpy() to sun_path.
https://github.com/kamailio/kamailio/blob/master/lib/binrpc/binrpc_api.c#L14... https://github.com/kamailio/kamailio/blob/master/modules/ctl/init_socks.c#L9... https://github.com/kamailio/kamailio/blob/master/utils/kamcmd/kamcmd.c#L489
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/589#issuecomment-215412173
Thanks for patch and pointers, helped to clarify.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/589#issuecomment-215550652
Merged #589.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/589#event-644844791