[SCM] Samba Website Repository - branch master updated
The branch, master has been updated via 945e36b Add my details from 3716929 Fix another occurrence of the affected version in the CVE-2018-1050 advisory https://git.samba.org/?p=samba-web.git;a=shortlog;h=master - Log - commit 945e36b53778450b3b2612edb6d93cc06f4305bc Author: Gary LockyerDate: Thu Feb 8 09:28:45 2018 +1300 Add my details Signed-off-by: Gary Lockyer --- Summary of changes: team/index.html | 1 + 1 file changed, 1 insertion(+) Changeset truncated at 500 lines: diff --git a/team/index.html b/team/index.html index 07d6a59..748f47e 100755 --- a/team/index.html +++ b/team/index.html @@ -72,6 +72,7 @@ mailing list and start contributing to the development of Samba. mailto:v...@samba.org;>Volker Lendecke(http://www.sernet.de/en/;>SerNet) mailto:h...@samba.org;>Herb Lewis mailto:derr...@samba.org;>Derrell Lipman +Gary Lockyer(http://catalyst.net.nz/what-we-offer/enterprise-solutions/samba;>Catalyst) -- Samba Website Repository
[SCM] pam wrapper repository - branch master updated
The branch, master has been updated via 38bc72a pwrap: remove pdir handling from p_copy() via 52e852b pwrap: Fix overflow checking via 19a77f8 pwrap: Avoid strncpy in pwrap_init() from a15c28e pwrap: Add missing config.h includes https://git.samba.org/?p=pam_wrapper.git;a=shortlog;h=master - Log - commit 38bc72aca34574a53ce9704dbc53891224a36487 Author: Ralph BoehmeDate: Mon Mar 26 18:03:08 2018 +0200 pwrap: remove pdir handling from p_copy() Signed-off-by: Ralph Boehme Reviewed-by: Andreas Schneider commit 52e852bfdba6ea3e270c6900803696c18bb3d75e Author: Ralph Boehme Date: Mon Mar 26 16:42:00 2018 +0200 pwrap: Fix overflow checking Signed-off-by: Ralph Boehme Reviewed-by: Andreas Schneider commit 19a77f8ab6978d48ecfe560ac2221b581628f699 Author: Andreas Schneider Date: Mon Mar 26 15:45:43 2018 +0200 pwrap: Avoid strncpy in pwrap_init() CID 47508 Signed-off-by: Andreas Schneider Reviewed-by: Ralph Boehme --- Summary of changes: src/pam_wrapper.c | 126 -- 1 file changed, 103 insertions(+), 23 deletions(-) Changeset truncated at 500 lines: diff --git a/src/pam_wrapper.c b/src/pam_wrapper.c index 482b388..8064954 100644 --- a/src/pam_wrapper.c +++ b/src/pam_wrapper.c @@ -531,7 +531,7 @@ static void libpam_pam_vsyslog(const pam_handle_t *pamh, #define BUFFER_SIZE 32768 /* copy file from src to dst, overwrites dst */ -static int p_copy(const char *src, const char *dst, const char *pdir, mode_t mode) +static int p_copy(const char *src, const char *dst, mode_t mode) { int srcfd = -1; int dstfd = -1; @@ -567,7 +567,6 @@ static int p_copy(const char *src, const char *dst, const char *pdir, mode_t mod } for (;;) { - char *p; bread = read(srcfd, buf, BUFFER_SIZE); if (bread == 0) { /* done */ @@ -578,21 +577,6 @@ static int p_copy(const char *src, const char *dst, const char *pdir, mode_t mod goto out; } - /* EXTRA UGLY HACK */ - if (pdir != NULL) { - p = buf; - - while (p < buf + BUFFER_SIZE) { - if (*p == '/') { - cmp = memcmp(p, "/etc/pam.d", 10); - if (cmp == 0) { - memcpy(p, pdir, 10); - } - } - p++; - } - } - bwritten = write(dstfd, buf, bread); if (bwritten < 0) { errno = EIO; @@ -668,7 +652,7 @@ static int copy_ftw(const char *fpath, } PWRAP_LOG(PWRAP_LOG_TRACE, "Copying %s", fpath); - rc = p_copy(fpath, buf, NULL, sb->st_mode); + rc = p_copy(fpath, buf, sb->st_mode); if (rc != 0) { return FTW_STOP; } @@ -756,6 +740,100 @@ static void pwrap_clean_stale_dirs(const char *dir) return; } +static int pso_copy(const char *src, const char *dst, const char *pdir, mode_t mode) +{ + int srcfd = -1; + int dstfd = -1; + int rc = -1; + ssize_t bread, bwritten; + struct stat sb; + char buf[10]; + int cmp; + size_t to_read; + bool found_slash; + + cmp = strcmp(src, dst); + if (cmp == 0) { + return -1; + } + + srcfd = open(src, O_RDONLY, 0); + if (srcfd < 0) { + return -1; + } + + if (mode == 0) { + rc = fstat(srcfd, ); + if (rc != 0) { + rc = -1; + goto out; + } + mode = sb.st_mode; + } + + dstfd = open(dst, O_CREAT|O_WRONLY|O_TRUNC, mode); + if (dstfd < 0) { + rc = -1; + goto out; + } + + found_slash = false; + to_read = 1; + + for (;;) { + bread = read(srcfd, buf, to_read); + if (bread == 0) { + /* done */ + break; + } else if (bread < 0) { + errno = EIO; + rc = -1; + goto out; + } + + to_read = 1; + if (!found_slash && buf[0] == '/') { + found_slash = true; + to_read = 9; + } + + if (found_slash &&
[SCM] Socket Wrapper Repository - branch master updated
The branch, master has been updated via 142024a tests: Remove extra test by moving getsockname() to another from 33da03f cmake: Fix configure check for fall-through attribute https://git.samba.org/?p=socket_wrapper.git;a=shortlog;h=master - Log - commit 142024a641ca43f842584499b5694d26853dd3d9 Author: Anoop C SDate: Fri Mar 23 17:12:49 2018 +0530 tests: Remove extra test by moving getsockname() to another test_echo_tcp_socket currently tests socket() and getsockname() network calls. The test name was misleading as it does not require echo server to be setup. Moreover it failed to create socket_wrapper directory which is the pre-requisite for testing with libsocket_wrapper. Therefore it is better to integrate getsockname() test into existing test_tcp_listen test and remove useless test_echo_tcp_socket Signed-off-by: Anoop C S Reviewed-by: Andreas Schneider Reviewed-by: Andrew Bartlet --- Summary of changes: tests/CMakeLists.txt | 1 - tests/test_echo_tcp_socket.c | 69 tests/test_tcp_listen.c | 2 ++ 3 files changed, 2 insertions(+), 70 deletions(-) delete mode 100644 tests/test_echo_tcp_socket.c Changeset truncated at 500 lines: diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b86cc84..836a5e2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,7 +24,6 @@ set(SWRAP_TESTS test_tcp_listen test_tcp_dup2 test_fcntl -test_echo_tcp_socket test_echo_tcp_connect test_echo_tcp_bind test_echo_tcp_socket_options diff --git a/tests/test_echo_tcp_socket.c b/tests/test_echo_tcp_socket.c deleted file mode 100644 index 57b92de..000 --- a/tests/test_echo_tcp_socket.c +++ /dev/null @@ -1,69 +0,0 @@ -#include -#include -#include -#include - -#include "config.h" -#include "torture.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -static void test_socket_getsockname(void **state) -{ - struct torture_address addr = { - .sa_socklen = sizeof(struct sockaddr_in), - }; - int rc; - int s; - - (void) state; /* unused */ - - s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - assert_int_not_equal(s, -1); - - rc = getsockname(s, , _socklen); - assert_return_code(rc, errno); - assert_int_equal(addr.sa.in.sin_family, AF_INET); -} - -#ifdef HAVE_IPV6 -static void test_socket_getsockname6(void **state) -{ - struct torture_address addr = { - .sa_socklen = sizeof(struct sockaddr_in), - }; - int rc; - int s; - - (void) state; /* unused */ - - s = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); - assert_int_not_equal(s, -1); - - rc = getsockname(s, , _socklen); - assert_return_code(rc, errno); - assert_int_equal(addr.sa.in6.sin6_family, AF_INET6); -} -#endif - -int main(void) { - int rc; - - const struct CMUnitTest getsockname_tests[] = { - cmocka_unit_test(test_socket_getsockname), -#ifdef HAVE_IPV6 - cmocka_unit_test(test_socket_getsockname6), -#endif - }; - - rc = cmocka_run_group_tests(getsockname_tests, NULL, NULL); - - return rc; -} diff --git a/tests/test_tcp_listen.c b/tests/test_tcp_listen.c index 5641c47..746620d 100644 --- a/tests/test_tcp_listen.c +++ b/tests/test_tcp_listen.c @@ -52,6 +52,7 @@ static void test_listen_unbound_ipv4(void **state) rc = getsockname(s1, , _socklen); assert_return_code(rc, errno); + assert_int_equal(addr.sa.in.sin_family, AF_INET); assert_int_equal(addr.sa_socklen, sizeof(struct sockaddr_in)); assert_in_range(ntohs(addr.sa.in.sin_port), 1024, 65535); @@ -85,6 +86,7 @@ static void test_listen_unbound_ipv6(void **state) rc = getsockname(s1, , _socklen); assert_return_code(rc, errno); + assert_int_equal(addr.sa.in6.sin6_family, AF_INET6); assert_int_equal(addr.sa_socklen, sizeof(struct sockaddr_in6)); assert_in_range(ntohs(addr.sa.in6.sin6_port), 1024, 65535); -- Socket Wrapper Repository