socket-util: add sockaddr_un_set_path() helper

Properly initializing sun_path from foreign data is not easy, given the
size constraints, and NUL confusion. Let's add a helper function for
this.
This commit is contained in:
Lennart Poettering
2018-10-15 19:35:00 +02:00
parent 44ed5214ad
commit 5cf91ea9c8
2 changed files with 46 additions and 0 deletions
+2
View File
@@ -188,3 +188,5 @@ struct cmsghdr* cmsg_find(struct msghdr *mh, int level, int type, socklen_t leng
})
int socket_ioctl_fd(void);
int sockaddr_un_set_path(struct sockaddr_un *ret, const char *path);