We generally use utmpx instead of utmp (both are actually identical on
Linux, but utmpx is POSIX, while utmp is not). Let's fix one left-over
case.
UT_NAMESIZE does not exist in utmpx world, it has no direct counterpart,
hence let's just sizeof_field() to determine the size of the actual
field. (which comes to the same result of course: 32).
#include <sys/file.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <utmp.h>
+#include <utmpx.h>
#include "sd-messages.h"
return false;
if (l > NAME_MAX) /* must fit in a filename: 255 */
return false;
- if (l > UT_NAMESIZE - 1) /* must fit in utmp: 31 */
+ if (l > sizeof_field(struct utmpx, ut_user) - 1) /* must fit in utmp: 31 */
return false;
}