Subject: Re: New Identd
To: None <>
From: Christos Zoulas <>
List: tech-userlevel
Date: 01/30/2004 19:03:24
In article <>,
Peter Postma <> wrote:
>I've written a new identd for NetBSD.
>It's for 1.6ZG or newer, because it uses a new sysctl method
>for looking up uid's.
>This identd has the following new features:
>- IPv6 support.
>- user ident files (to return user specified replies).
>- returning random tokens.
>- a 'fallback' username (for when the lookup fails), which might be 
>useful on NAT gateways.
>Here it is:
>I've also done some work to add NAT forward/proxy support, but this is 
>not finished yet.
>If anyone is interested in this then please let me know and I'll send 
>you the source.

Looks nice! A few comments:

1. The current identd is public domain, yours has an advertising clause.
2. Passing char to isdigit() can lead to core-dumps; cast to unsigned char.
3. Further, use strtol() instead of atoi() so we can properly detect errors.
   Your case will treat 23foo as 23.
4. Style says while (); is nono, use while () continue;
5. You forgot to cast some functions to void [snprintf]
6. All functions in there and globals should be static.