The branch, master has been updated via f13d07e s3/winbindd: use == -1 instead of < 0 for error checking uid_t from 8b7d92b librpc: add decode_netlogon_samlogon_response_packet for mailslot debugging.
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit f13d07e459261ba0881ee725e94edd988c57479f Author: Aurelien Aptel <aap...@suse.com> Date: Wed Mar 9 13:43:09 2016 +0100 s3/winbindd: use == -1 instead of < 0 for error checking uid_t The sign of the uid_t type is left unspecified by POSIX. It's defined as an unsigned 32b int on Linux, therefore the < 0 check is always false. For unsigned version of uid_t, "uid == -1" will implicitely cast -1 to unsigned making it a valid test for both signed and unsigned version of uid_t. This commit makes the cast to (uid_t) explicit anyway. Signed-off-by: Aurelien Aptel <aap...@suse.com> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Michael Adam <ob...@samba.org> Autobuild-User(master): Michael Adam <ob...@samba.org> Autobuild-Date(master): Fri Jul 1 05:22:36 CEST 2016 on sn-devel-144 ----------------------------------------------------------------------- Summary of changes: source3/winbindd/winbindd_cred_cache.c | 2 +- source3/winbindd/winbindd_pam.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/winbindd/winbindd_cred_cache.c b/source3/winbindd/winbindd_cred_cache.c index e113f99..20b4d55 100644 --- a/source3/winbindd/winbindd_cred_cache.c +++ b/source3/winbindd/winbindd_cred_cache.c @@ -503,7 +503,7 @@ NTSTATUS add_ccache_to_list(const char *princ_name, NTSTATUS ntret; if ((username == NULL && princ_name == NULL) || - ccname == NULL || uid < 0) { + ccname == NULL || uid == (uid_t)-1) { return NT_STATUS_INVALID_PARAMETER; } diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c index 2cfd88a..8ec4fe4 100644 --- a/source3/winbindd/winbindd_pam.c +++ b/source3/winbindd/winbindd_pam.c @@ -555,7 +555,7 @@ uid_t get_uid_from_request(struct winbindd_request *request) uid = request->data.auth.uid; - if (uid < 0) { + if (uid == (uid_t)-1) { DEBUG(1,("invalid uid: '%u'\n", (unsigned int)uid)); return -1; } @@ -2311,7 +2311,7 @@ enum winbindd_result winbindd_dual_pam_logoff(struct winbindd_domain *domain, #ifdef HAVE_KRB5 - if (state->request->data.logoff.uid < 0) { + if (state->request->data.logoff.uid == (uid_t)-1) { DEBUG(0,("winbindd_pam_logoff: invalid uid\n")); goto process_result; } -- Samba Shared Repository