Bug 10202 - Unsigned type
Summary: Unsigned type
Status: RESOLVED INVALID
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 4.0.10
Hardware: All All
: P5 trivial (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on: 6426
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-14 17:30 UTC by rs
Modified: 2014-07-24 08:04 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rs 2013-10-14 17:30:44 UTC
winbindd_cred_cache.c:

if ((username == NULL && princ_name == NULL) ||
	    ccname == NULL || uid < 0) {
		return NT_STATUS_INVALID_PARAMETER;
	}

uid < 0 always false.

i think need:

if ((username == NULL && princ_name == NULL) ||
	    ccname == NULL) {
		return NT_STATUS_INVALID_PARAMETER;
	}

found in PVS-studio 5.10
Comment 1 Volker Lendecke 2013-10-14 19:10:09 UTC
Well, the problem is that we did not find anywhere that uid_t is *always* unsigned. Can you get us a reference to some official docs that Posix mandates uid_t to be unsigned?

Thanks
Comment 2 Björn Jacke 2014-07-24 08:04:05 UTC
HP-UX is one case where uid numbers can be negative. uid signesness is not defined, so the check is generally valid.