Loading source3/nsswitch/wb_common.c +44 −11 Original line number Diff line number Diff line Loading @@ -410,10 +410,41 @@ int write_sock(void *buffer, int count) static int read_sock(void *buffer, int count) { int result = 0, nread = 0; int total_time = 0, selret; /* Read data from socket */ while(nread < count) { struct timeval tv; fd_set r_fds; /* Catch pipe close on other end by checking if a read() call would not block by calling select(). */ FD_ZERO(&r_fds); FD_SET(winbindd_fd, &r_fds); ZERO_STRUCT(tv); /* Wait for 5 seconds for a reply. May need to parameterise this... */ tv.tv_sec = 5; if ((selret = select(winbindd_fd + 1, &r_fds, NULL, NULL, &tv)) == -1) { close_sock(); return -1; /* Select error */ } if (selret == 0) { /* Not ready for read yet... */ if (total_time >= 30) { /* Timeout */ close_sock(); return -1; } total_time += 5; continue; } if (FD_ISSET(winbindd_fd, &r_fds)) { /* Do the Read */ result = read(winbindd_fd, (char *)buffer + nread, count - nread); Loading @@ -429,6 +460,8 @@ static int read_sock(void *buffer, int count) } nread += result; } } return result; Loading source3/smbd/trans2.c +8 −2 Original line number Diff line number Diff line Loading @@ -3506,12 +3506,17 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n", srvstr_pull(inbuf, link_target, pdata, sizeof(link_target), -1, STR_TERMINATE); /* !widelinks forces the target path to be within the share. */ /* This means we can interpret the target as a pathname. */ if (!lp_widelinks(SNUM(conn))) { pstring rel_name; char *last_dirp = NULL; unix_format(link_target); srvstr_get_path(inbuf, link_target, pdata, sizeof(link_target), -1, STR_TERMINATE, &status); if (!NT_STATUS_IS_OK(status)) { return ERROR_NT(status); } unix_convert(link_target,conn,0,&bad_path,&sbuf); pstrcpy(rel_name, newname); last_dirp = strrchr_m(rel_name, '/'); if (last_dirp) { Loading @@ -3520,6 +3525,7 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n", pstrcpy(rel_name, "./"); } pstrcat(rel_name, link_target); if (ensure_link_is_safe(conn, rel_name) != 0) { return(UNIXERROR(ERRDOS,ERRnoaccess)); } Loading Loading
source3/nsswitch/wb_common.c +44 −11 Original line number Diff line number Diff line Loading @@ -410,10 +410,41 @@ int write_sock(void *buffer, int count) static int read_sock(void *buffer, int count) { int result = 0, nread = 0; int total_time = 0, selret; /* Read data from socket */ while(nread < count) { struct timeval tv; fd_set r_fds; /* Catch pipe close on other end by checking if a read() call would not block by calling select(). */ FD_ZERO(&r_fds); FD_SET(winbindd_fd, &r_fds); ZERO_STRUCT(tv); /* Wait for 5 seconds for a reply. May need to parameterise this... */ tv.tv_sec = 5; if ((selret = select(winbindd_fd + 1, &r_fds, NULL, NULL, &tv)) == -1) { close_sock(); return -1; /* Select error */ } if (selret == 0) { /* Not ready for read yet... */ if (total_time >= 30) { /* Timeout */ close_sock(); return -1; } total_time += 5; continue; } if (FD_ISSET(winbindd_fd, &r_fds)) { /* Do the Read */ result = read(winbindd_fd, (char *)buffer + nread, count - nread); Loading @@ -429,6 +460,8 @@ static int read_sock(void *buffer, int count) } nread += result; } } return result; Loading
source3/smbd/trans2.c +8 −2 Original line number Diff line number Diff line Loading @@ -3506,12 +3506,17 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n", srvstr_pull(inbuf, link_target, pdata, sizeof(link_target), -1, STR_TERMINATE); /* !widelinks forces the target path to be within the share. */ /* This means we can interpret the target as a pathname. */ if (!lp_widelinks(SNUM(conn))) { pstring rel_name; char *last_dirp = NULL; unix_format(link_target); srvstr_get_path(inbuf, link_target, pdata, sizeof(link_target), -1, STR_TERMINATE, &status); if (!NT_STATUS_IS_OK(status)) { return ERROR_NT(status); } unix_convert(link_target,conn,0,&bad_path,&sbuf); pstrcpy(rel_name, newname); last_dirp = strrchr_m(rel_name, '/'); if (last_dirp) { Loading @@ -3520,6 +3525,7 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n", pstrcpy(rel_name, "./"); } pstrcat(rel_name, link_target); if (ensure_link_is_safe(conn, rel_name) != 0) { return(UNIXERROR(ERRDOS,ERRnoaccess)); } Loading