passdb/pass_check.c

James Sutherland jas88 at cam.ac.uk
Fri Mar 10 17:39:47 GMT 2000


On Fri, 10 Mar 2000, David Collier-Brown wrote:

> James Sutherland wrote:
> > Agreed. Essentially, at present crypt() CAN return NULL to us under some
> > circumstances, so we MUST handle this gracefully. Either that, or provide
> > our own crypt() which does not return NULL under any circumstances?
> 
> 	The spec actually says "Otherwise it  returns a null pointer
> 	and sets errno to indicate the error", and the errno
> 	that's expected is ENOSYS, for  "I don't have crypt".
> 	As long as an implementor uses a different errno for different
> 	failures, we'll survive it.

OK, so we DO need to deal with being given NULL results, which is the
original problem - it seems we are doing a strcmp(crypt(...),...) without
checking the return value of crypt() - and strcmp(NULL,...) isn't a bright
thing to do.


James.



More information about the samba-technical mailing list