Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 May 2016 20:10:26 +0200
From:      Ed Schouten <ed@nuxi.nl>
To:        Don Lewis <truckman@freebsd.org>
Cc:        freebsd-arch@freebsd.org
Subject:   Re: is ut_user[] in struct utmpx NUL terminated?
Message-ID:  <CABh_MKn20ABaQ=N2s44jscsDUZ6n2s8nWX5DdYa4jGNfUqAf=g@mail.gmail.com>
In-Reply-To: <201605152307.u4FN7Gtg069070@gw.catspoiler.org>
References:  <201605152307.u4FN7Gtg069070@gw.catspoiler.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Don,

2016-05-16 1:07 GMT+02:00 Don Lewis <truckman@freebsd.org>:
> There is a lot of code that expects ut_user[] to be NUL terminated.

Our implementation of utmpx should be pretty friendly to use:

- You can call pututxline() with strings that are not null terminated.
- The getutx*() functions return entries in which all strings are null
terminated.

Keep in mind that ut_id is not a string, but a binary identifier,
meaning it is not null terminated.

Best regards,
-- 
Ed Schouten <ed@nuxi.nl>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CABh_MKn20ABaQ=N2s44jscsDUZ6n2s8nWX5DdYa4jGNfUqAf=g>