[Mono-list] Mono.Posix.Syscall

Loren Bandiera lorenb@mmgsecurity.com
Tue, 14 Sep 2004 18:57:34 -0400


On Tue, 2004-09-14 at 18:47 -0400, Joshua Tauberer wrote:

> Most of the functions in Syscall are named after the equivalent library 
> function.  I'd suggest changing your passwd function to "getpwnam." 
> Also, your function is accidentally private.

Yeah I noticed the private thing, that was a cut & paste error.  I could
change the name, I just picked passwd without too much thought.  

> Stylistically, I'd also change the Account field of the Passwd structure 
> to "Name," which seems more natural to me.  (Also, HomeDirectory could 
> just be "Home.")  This is a picky point, I know...

Yeah I was just using the field names from the man page.  I have no
problems changing those names too.

> Lastly, in your C implementation, rather than using getpwent_r and 
> looping through the results for the right one, it'd be more concise to 
> use getpwnam_r and getpwuid_r.  (Again, I had no idea these functions 
> even existed until just a few minutes ago. :) )
> 

Yeah using getpwent_r, in retrospect that was just dumb.  I don't know
how I missed getpwnam.  I did discover and change that (I just posted an
updated patch a few minutes ago) although I didn't use getpwnam_r.   One
more thing to update :)

Thanks for the feedback!

-- 
Loren Bandiera, CISSP <lorenb@mmgsecurity.com>
MMG Security, Inc.