The branch, master has been updated
       via  fba90fd s3:smbd_smb2_reauth_generic_return: make use of 
smb2req->xconn
       via  490a27b pam_winbind: check != PAM_SUCCESS and != NULL explicitly
      from  e8e9e7f vfs:shadow_copy2: fix a debug message

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fba90fd8fe5e3082a67db52b351c2d3ed2d05268
Author: Michael Adam <[email protected]>
Date:   Wed Sep 9 15:08:56 2015 +0200

    s3:smbd_smb2_reauth_generic_return: make use of smb2req->xconn
    
    More specifically move from smb2req->sconn to smb2req->xconn->client->sconn
    to avouid using smb2req->sconn directly.
    
    Signed-off-by: Michael Adam <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    
    Autobuild-User(master): Volker Lendecke <[email protected]>
    Autobuild-Date(master): Wed Jan 13 14:02:21 CET 2016 on sn-devel-144

commit 490a27b69bc2a1ca4c22dcc2e239a0acedfee637
Author: Michael Adam <[email protected]>
Date:   Tue Sep 8 18:25:02 2015 +0200

    pam_winbind: check != PAM_SUCCESS and != NULL explicitly
    
    ...instead of using "if (ret)" or similar.
    This is just a code cleanup, no changes in behaviour.
    
    Signed-off-by: Michael Adam <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>

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

Summary of changes:
 nsswitch/pam_winbind.c        | 28 ++++++++++++++--------------
 source3/smbd/smb2_sesssetup.c |  3 ++-
 2 files changed, 16 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index a2d9f3b..b83a276 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -1262,7 +1262,7 @@ static void _pam_setup_krb5_env(struct pwb_context *ctx,
        }
 
        ret = pam_putenv(ctx->pamh, var);
-       if (ret) {
+       if (ret != PAM_SUCCESS) {
                _pam_log(ctx, LOG_ERR,
                         "failed to set KRB5CCNAME to %s: %s",
                         var, pam_strerror(ctx->pamh, ret));
@@ -1328,7 +1328,7 @@ static void _pam_set_data_string(struct pwb_context *ctx,
 
        ret = pam_set_data(ctx->pamh, data_name, talloc_strdup(NULL, value),
                           _pam_winbind_cleanup_func);
-       if (ret) {
+       if (ret != PAM_SUCCESS) {
                _pam_log_debug(ctx, LOG_DEBUG,
                               "Could not set data %s: %s\n",
                               data_name, pam_strerror(ctx->pamh, ret));
@@ -1656,7 +1656,7 @@ static int _pam_mkhomedir(struct pwb_context *ctx)
                }
 
                ret = _pam_create_homedir(ctx, create_dir, mode);
-               if (ret) {
+               if (ret != PAM_SUCCESS) {
                        return ret;
                }
        }
@@ -2369,7 +2369,7 @@ static const char *get_member_from_config(struct 
pwb_context *ctx)
        const char *ret = NULL;
        ret = get_conf_item_string(ctx, "require_membership_of",
                                   WINBIND_REQUIRED_MEMBERSHIP);
-       if (ret) {
+       if (ret != NULL) {
                return ret;
        }
        return get_conf_item_string(ctx, "require-membership-of",
@@ -2488,7 +2488,7 @@ static int _pam_delete_cred(pam_handle_t *pamh, int flags,
        ZERO_STRUCT(logoff);
 
        retval = _pam_winbind_init_context(pamh, flags, argc, argv, type, &ctx);
-       if (retval) {
+       if (retval != PAM_SUCCESS) {
                return retval;
        }
 
@@ -2503,7 +2503,7 @@ static int _pam_delete_cred(pam_handle_t *pamh, int flags,
                struct passwd *pwd = NULL;
 
                retval = pam_get_user(pamh, &user, _("Username: "));
-               if (retval) {
+               if (retval != PAM_SUCCESS) {
                        _pam_log(ctx, LOG_ERR,
                                 "could not identify user");
                        goto out;
@@ -2624,7 +2624,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
 
        retval = _pam_winbind_init_context(pamh, flags, argc, argv,
                                           PAM_WINBIND_AUTHENTICATE, &ctx);
-       if (retval) {
+       if (retval != PAM_SUCCESS) {
                return retval;
        }
 
@@ -2776,7 +2776,7 @@ int pam_sm_setcred(pam_handle_t *pamh, int flags,
 
        ret = _pam_winbind_init_context(pamh, flags, argc, argv,
                                        PAM_WINBIND_SETCRED, &ctx);
-       if (ret) {
+       if (ret != PAM_SUCCESS) {
                return ret;
        }
 
@@ -2830,7 +2830,7 @@ int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags,
 
        ret = _pam_winbind_init_context(pamh, flags, argc, argv,
                                        PAM_WINBIND_ACCT_MGMT, &ctx);
-       if (ret) {
+       if (ret != PAM_SUCCESS) {
                return ret;
        }
 
@@ -2926,7 +2926,7 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags,
 
        ret = _pam_winbind_init_context(pamh, flags, argc, argv,
                                        PAM_WINBIND_OPEN_SESSION, &ctx);
-       if (ret) {
+       if (ret != PAM_SUCCESS) {
                return ret;
        }
 
@@ -2953,7 +2953,7 @@ int pam_sm_close_session(pam_handle_t *pamh, int flags,
 
        ret = _pam_winbind_init_context(pamh, flags, argc, argv,
                                        PAM_WINBIND_CLOSE_SESSION, &ctx);
-       if (ret) {
+       if (ret != PAM_SUCCESS) {
                return ret;
        }
 
@@ -3039,7 +3039,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
 
        ret = _pam_winbind_init_context(pamh, flags, argc, argv,
                                        PAM_WINBIND_CHAUTHTOK, &ctx);
-       if (ret) {
+       if (ret != PAM_SUCCESS) {
                return ret;
        }
 
@@ -3054,7 +3054,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
         * First get the name of a user
         */
        ret = pam_get_user(pamh, &user, _("Username: "));
-       if (ret) {
+       if (ret != PAM_SUCCESS) {
                _pam_log(ctx, LOG_ERR,
                         "password - could not identify user");
                goto out;
@@ -3215,7 +3215,7 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
 
                ret = winbind_chauthtok_request(ctx, user, pass_old,
                                                pass_new, pwdlastset_update);
-               if (ret) {
+               if (ret != PAM_SUCCESS) {
                        pass_old = pass_new = NULL;
                        goto out;
                }
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 14249df..30e2d7f 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -493,6 +493,7 @@ static NTSTATUS smbd_smb2_reauth_generic_return(struct 
smbXsrv_session *session,
        NTSTATUS status;
        struct smbXsrv_session *x = session;
        struct smbXsrv_session_auth0 *auth = *_auth;
+       struct smbXsrv_connection *xconn = smb2req->xconn;
        size_t i;
 
        *_auth = NULL;
@@ -540,7 +541,7 @@ static NTSTATUS smbd_smb2_reauth_generic_return(struct 
smbXsrv_session *session,
                return NT_STATUS_LOGON_FAILURE;
        }
 
-       conn_clear_vuid_caches(smb2req->sconn, session->compat->vuid);
+       conn_clear_vuid_caches(xconn->client->sconn, session->compat->vuid);
 
        if (security_session_user_level(session_info, NULL) >= SECURITY_USER) {
                smb2req->do_signing = true;


-- 
Samba Shared Repository

Reply via email to