this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Unexpand vchroot paths returned by get{sock,peer}name

+48
+3
src/kernel/emulation/linux/network/bind.c
··· 7 7 #include "duct.h" 8 8 9 9 extern void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n); 10 + extern __SIZE_TYPE__ strlen(const char* src); 11 + extern char* strcpy(char* dest, const char* src); 12 + extern char *strncpy(char *dest, const char *src, __SIZE_TYPE__ n); 10 13 11 14 #include "../vchroot_expand.h" 12 15 #include "../bsdthread/per_thread_wd.h"
+3
src/kernel/emulation/linux/network/connect.c
··· 8 8 #include "../bsdthread/cancelable.h" 9 9 10 10 extern void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n); 11 + extern __SIZE_TYPE__ strlen(const char* src); 12 + extern char* strcpy(char* dest, const char* src); 13 + extern char *strncpy(char *dest, const char *src, __SIZE_TYPE__ n); 11 14 12 15 #include "../vchroot_expand.h" 13 16 #include "../bsdthread/per_thread_wd.h"
+21
src/kernel/emulation/linux/network/getpeername.c
··· 2 2 #include "../base.h" 3 3 #include "../errno.h" 4 4 #include <linux-syscalls/linux.h> 5 + #include <sys/socket.h> 5 6 #include "duct.h" 7 + 8 + #include "../vchroot_expand.h" 9 + 10 + extern __SIZE_TYPE__ strlen(const char* src); 11 + extern char* strcpy(char* dest, const char* src); 12 + extern char *strncpy(char *dest, const char *src, __SIZE_TYPE__ n); 6 13 7 14 long sys_getpeername(int fd, void* asa, int* socklen) 8 15 { ··· 22 29 { 23 30 fixed = (struct sockaddr_fixup*) asa; 24 31 fixed->bsd_family = sfamily_linux_to_bsd(fixed->linux_family); 32 + 33 + if (fixed->bsd_family == PF_LOCAL) { 34 + struct vchroot_unexpand_args vc; 35 + strcpy(vc.path, fixed->sun_path); 36 + 37 + ret = vchroot_unexpand(&vc); 38 + if (ret < 0) 39 + return errno_linux_to_bsd(ret); 40 + 41 + strncpy(fixed->sun_path, vc.path, sizeof(fixed->sun_path) - 1); 42 + fixed->sun_path[sizeof(fixed->sun_path) - 1] = '\0'; 43 + *socklen = sizeof(*fixed) - sizeof(fixed->sun_path) + strlen(fixed->sun_path) + 1; 44 + } 45 + 25 46 fixed->bsd_length = *socklen; 26 47 } 27 48
+21
src/kernel/emulation/linux/network/getsockname.c
··· 2 2 #include "../base.h" 3 3 #include "../errno.h" 4 4 #include <linux-syscalls/linux.h> 5 + #include <sys/socket.h> 5 6 #include "duct.h" 7 + 8 + #include "../vchroot_expand.h" 9 + 10 + extern __SIZE_TYPE__ strlen(const char* src); 11 + extern char* strcpy(char* dest, const char* src); 12 + extern char *strncpy(char *dest, const char *src, __SIZE_TYPE__ n); 6 13 7 14 long sys_getsockname(int fd, void* asa, int* socklen) 8 15 { ··· 22 29 { 23 30 fixed = (struct sockaddr_fixup*) asa; 24 31 fixed->bsd_family = sfamily_linux_to_bsd(fixed->linux_family); 32 + 33 + if (fixed->bsd_family == PF_LOCAL) { 34 + struct vchroot_unexpand_args vc; 35 + strcpy(vc.path, fixed->sun_path); 36 + 37 + ret = vchroot_unexpand(&vc); 38 + if (ret < 0) 39 + return errno_linux_to_bsd(ret); 40 + 41 + strncpy(fixed->sun_path, vc.path, sizeof(fixed->sun_path) - 1); 42 + fixed->sun_path[sizeof(fixed->sun_path) - 1] = '\0'; 43 + *socklen = sizeof(*fixed) - sizeof(fixed->sun_path) + strlen(fixed->sun_path) + 1; 44 + } 45 + 25 46 fixed->bsd_length = *socklen; 26 47 } 27 48