FreeBSD Port: sysutils/userinfo

Ben Kibbey bjk at luxsci.net
Mon Jan 10 00:51:18 UTC 2011


On Mon, Jan 10, 2011 at 01:20:24AM +0300, Eygene Ryabinkin wrote:
> I believe that the attached patch will fix the utility.  The need of
> login.{h,c} hunks is obvious, the need for the configure one should
> be explained, I think.  At my machine when I had compiled the code
> the number of the active sessions was 0; so getutxent() will return NULL.
> I think that the test should really be using UTXDB_LOG that has all
> entries for utmpx.  And that check was implemented.

That makes sense. I've fixed the utmp[x] checking to only check for
headers and not mess with non-POSIX functions but still conditionally
support setutxdb() and getutxuser(). Could you test the new attached
patch?  I'm trying to us getutxuser() and from what I've read from the
manual page it seems like it should work. If not, then I'll use the one
you wrote.

> Two more nits:
>  - I wasn't able to invoke 'ui -O login.so -la -- `users`', it were
>    giving me the main help until I had killed the chaining test
>    just after option parsing;

Could you tell me the command line you used?

>  - at least login.c uses unsafe constructions like
> {{{
> for (i = 0; i < cnt; i++) {
> 	...
> 	strncat(line, buf, sizeof(line));
> 	...
> }
> }}}
>    It won't protect you from overrunning 'line', because the last
>    argument of that strncat specifies how many bytes from _buf_
>    we want to copy at most.  You will likely want to read the

Thanks for the input. I'll fix those soon!

 
-- 
Ben Kibbey
[XMPP: bjk AT thiessen DOT org] - [IRC: (bjk) FreeNode/OFTC]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 8628 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20110110/9adc3660/patch.bin


More information about the freebsd-ports mailing list