apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: [PATCH] avoid crashing when given invalid user/group ids on win32
Date Mon, 30 Jan 2006 21:08:58 GMT
On Mon, Jan 30, 2006 at 11:36:14AM -0600, William Rowe wrote:
> Joe Orton wrote:
> >Making the apr_{uid,gid}_name_get() test for an arbitrary apr_uid_t 
> >value ifndef WIN32 seems reasonable if it's not possible to obtain such 
> >values legitimately on Win32.
> >
> >It is possible to obtain such values legitimately on Unix (e.g. random 
> >file owner UIDs which show up on an NFS mount); so the test is valid 
> >there.
> 
> My point was, no, it's not possible; where did you get said random UID?
> Perhaps you called apr_file_stat() and it returned a uid to some non
> existant user?

Yes, that's exactly what can happen on Unix.  And these functions all 
crashed on some Unix platforms with legitimate input, because the error 
handling was broken.  So the tests need to be kept for Unix platforms.

If the tests are not appropriate on Win32 then #ifndef WIN32 them, as I 
said already.  There is absolutely nothing wrong with having test cases 
in the test suite which are designed to exercise only particular code 
paths on particular platforms, and it's just silly to argue otherwise.

joe

Mime
View raw message