The branch, v4-4-test has been updated
       via  2184ae7 cleanupd: restart as needed
       via  85185e7 nss_wins: Fix the hostent setup
       via  23497a6 nss_wins: ip_pton expects the raw IP address
       via  d4dd33b libads: record session expiry for spnego sasl binds
      from  eb96e15 vfs_catia: Fix bug 11827, memleak

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-4-test


- Log -----------------------------------------------------------------
commit 2184ae79e7a8b17cd7720ccc7649ae9c02cbf1b6
Author: Ralph Boehme <[email protected]>
Date:   Tue Apr 19 12:55:19 2016 +0200

    cleanupd: restart as needed
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11855
    
    Signed-off-by: Ralph Boehme <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    
    Autobuild-User(master): Volker Lendecke <[email protected]>
    Autobuild-Date(master): Tue Apr 19 20:35:33 CEST 2016 on sn-devel-144
    
    (cherry picked from commit 052b8555510bf1f72c7ea777c44294264bbb67d4)
    
    Autobuild-User(v4-4-test): Karolin Seeger <[email protected]>
    Autobuild-Date(v4-4-test): Wed Apr 27 13:42:24 CEST 2016 on sn-devel-144

commit 85185e7d20bd2490e5776bf37fcda80772e95e85
Author: Tom Mortensen <[email protected]>
Date:   Sat Apr 16 10:57:12 2016 +0200

    nss_wins: Fix the hostent setup
    
    This can never have been tested....
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11875
    
    Signed-off-by: Tom Mortensen <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    
    (cherry picked from commit 0b1f4db325bb0ed9171619c874908ee25327bba9)

commit 23497a6bc162fea4fc3a332ff37dda82f2c1c205
Author: Tom Mortensen <[email protected]>
Date:   Sat Apr 16 10:57:12 2016 +0200

    nss_wins: ip_pton expects the raw IP address
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11875
    
    Signed-off-by: Tom Mortensen <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    
    (cherry picked from commit d3569ca2711d21ac87ff539662333ad315a2a618)

commit d4dd33bb2c9a89b965f50118ec4125f644549629
Author: Uri Simchoni <[email protected]>
Date:   Mon Apr 18 23:08:38 2016 +0300

    libads: record session expiry for spnego sasl binds
    
    With the move to gensec-based spnego, record the session expiry
    in tgs_expire, so that libads users such as winbindd can use this info
    to determine how long to keep the connection.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11852
    
    Signed-off-by: Uri Simchoni <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>
    
    Autobuild-User(master): Uri Simchoni <[email protected]>
    Autobuild-Date(master): Tue Apr 19 16:53:57 CEST 2016 on sn-devel-144
    
    (cherry picked from commit 34482eb7cc3d74c8de510309332e8ab176d0f3c0)

-----------------------------------------------------------------------

Summary of changes:
 nsswitch/wins.c       | 13 +++++++++----
 source3/libads/sasl.c |  9 +++++++++
 source3/smbd/server.c | 35 +++++++++++++++++++++++++----------
 3 files changed, 43 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/nsswitch/wins.c b/nsswitch/wins.c
index 3243ffb..fc65c03 100644
--- a/nsswitch/wins.c
+++ b/nsswitch/wins.c
@@ -47,7 +47,7 @@ NSS_STATUS _nss_wins_gethostbyname2_r(const char *name, int 
af, struct hostent *
 static char *lookup_byname_backend(const char *name)
 {
        const char *p;
-       char *ip;
+       char *ip, *ipp;
        size_t nbt_len;
        wbcErr result;
 
@@ -65,6 +65,11 @@ static char *lookup_byname_backend(const char *name)
                return NULL;
        }
 
+        ipp = strchr(ip, '\t');
+        if (ipp != NULL) {
+                *ipp = '\0';
+        }
+
        return ip;
 }
 
@@ -275,7 +280,7 @@ _nss_wins_gethostbyname_r(const char *hostname, struct 
hostent *he,
        }
 
        if ((he->h_addr_list = (char **)get_static(
-                    &buffer, &buflen, i * sizeof(char *))) == NULL) {
+                    &buffer, &buflen, 2 * sizeof(char *))) == NULL) {
                nss_status = NSS_STATUS_TRYAGAIN;
                goto out;
        }
@@ -286,9 +291,9 @@ _nss_wins_gethostbyname_r(const char *hostname, struct 
hostent *he,
                goto out;
        }
 
-       memcpy(he->h_addr_list[i], &in, INADDRSZ);
+       memcpy(he->h_addr_list[0], &in, INADDRSZ);
 
-       he->h_addr_list[0] = NULL;
+       he->h_addr_list[1] = NULL;
 
        /* Set h_addr_type and h_length */
 
diff --git a/source3/libads/sasl.c b/source3/libads/sasl.c
index 22aa9cf..b8d4527 100644
--- a/source3/libads/sasl.c
+++ b/source3/libads/sasl.c
@@ -134,6 +134,7 @@ static ADS_STATUS ads_sasl_spnego_gensec_bind(ADS_STRUCT 
*ads,
        struct auth_generic_state *auth_generic_state;
        bool use_spnego_principal = lp_client_use_spnego_principal();
        const char *sasl_list[] = { sasl, NULL };
+       NTTIME end_nt_time;
 
        nt_status = auth_generic_client_prepare(NULL, &auth_generic_state);
        if (!NT_STATUS_IS_OK(nt_status)) {
@@ -307,6 +308,14 @@ static ADS_STATUS ads_sasl_spnego_gensec_bind(ADS_STRUCT 
*ads,
                }
        }
 
+       ads->auth.tgs_expire = LONG_MAX;
+       end_nt_time = gensec_expire_time(auth_generic_state->gensec_security);
+       if (end_nt_time != GENSEC_EXPIRE_TIME_INFINITY) {
+               struct timeval tv;
+               nttime_to_timeval(&tv, end_nt_time);
+               ads->auth.tgs_expire = tv.tv_sec;
+       }
+
        if (ads->ldap.wrap_type > ADS_SASLWRAP_TYPE_PLAIN) {
                size_t max_wrapped = 
gensec_max_wrapped_size(auth_generic_state->gensec_security);
                ads->ldap.out.max_unwrapped = 
gensec_max_input_size(auth_generic_state->gensec_security);
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 42fcad6..b7948b4 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -468,6 +468,10 @@ static bool cleanupd_init(struct messaging_context *msg, 
bool interactive,
 
                DBG_DEBUG("Started cleanupd pid=%d\n", (int)pid);
 
+               if (am_parent != NULL) {
+                       add_child_pid(am_parent, pid);
+               }
+
                *ppid = pid_to_procid(pid);
                return true;
        }
@@ -557,16 +561,6 @@ static void remove_child_pid(struct smbd_parent_context 
*parent,
        struct iovec iov[2];
        NTSTATUS status;
 
-       iov[0] = (struct iovec) { .iov_base = (uint8_t *)&pid,
-                                 .iov_len = sizeof(pid) };
-       iov[1] = (struct iovec) { .iov_base = (uint8_t *)&unclean_shutdown,
-                                 .iov_len = sizeof(bool) };
-
-       status = messaging_send_iov(parent->msg_ctx, parent->cleanupd,
-                                   MSG_SMB_NOTIFY_CLEANUP,
-                                   iov, ARRAY_SIZE(iov), NULL, 0);
-       DEBUG(10, ("messaging_send_iov returned %s\n", nt_errstr(status)));
-
        for (child = parent->children; child != NULL; child = child->next) {
                if (child->pid == pid) {
                        struct smbd_child_pid *tmp = child;
@@ -583,6 +577,27 @@ static void remove_child_pid(struct smbd_parent_context 
*parent,
                return;
        }
 
+       if (child->pid == procid_to_pid(&parent->cleanupd)) {
+               bool ok;
+
+               DBG_WARNING("Restarting cleanupd\n");
+               ok = cleanupd_init(parent->msg_ctx, false, &parent->cleanupd);
+               if (!ok) {
+                       DBG_ERR("Failed to restart cleanupd\n");
+               }
+               return;
+       }
+
+       iov[0] = (struct iovec) { .iov_base = (uint8_t *)&pid,
+                                 .iov_len = sizeof(pid) };
+       iov[1] = (struct iovec) { .iov_base = (uint8_t *)&unclean_shutdown,
+                                 .iov_len = sizeof(bool) };
+
+       status = messaging_send_iov(parent->msg_ctx, parent->cleanupd,
+                                   MSG_SMB_NOTIFY_CLEANUP,
+                                   iov, ARRAY_SIZE(iov), NULL, 0);
+       DEBUG(10, ("messaging_send_iov returned %s\n", nt_errstr(status)));
+
        if (unclean_shutdown) {
                /* a child terminated uncleanly so tickle all
                   processes to see if they can grab any of the


-- 
Samba Shared Repository

Reply via email to