gnome-control-center/panels
Michael Catanzaro 09b94a9b53 user-accounts: Fix definition of MAXNAMELEN
Currently we get MAXNAMELEN from glibc's LOGIN_NAME_MAX, if available,
and sysconf otherwise. But the maximum username length supported by
glibc and the kernel is actually way larger than the maximum length that
actually works in practice. On Linux, anything larger than 32 characters
is not going to fit into utmp, and will therefore be rejected by
useradd. Then gnome-control-center will spit out a confusing error
message dialog.

Let's spare our users from that.

useradd (in shadow-utils) gets its max name size from the following
magic:

 /* Maximum length of usernames */
 #ifdef HAVE_UTMPX_H
 # include <utmpx.h>
 # define USER_NAME_MAX_LENGTH (sizeof (((struct utmpx *)NULL)->ut_user))
 #else
 # include <utmp.h>
 # ifdef HAVE_STRUCT_UTMP_UT_USER
 #  define USER_NAME_MAX_LENGTH (sizeof (((struct utmp *)NULL)->ut_user))
 # else
 #  ifdef HAVE_STRUCT_UTMP_UT_NAME
 #   define USER_NAME_MAX_LENGTH (sizeof (((struct utmp *)NULL)->ut_name))
 #  else
 #   define USER_NAME_MAX_LENGTH 32
 #  endif
 # endif
 #endif

It's more work than necessary. utmpx is standardized by POSIX (it's
actually an XSI extension), whereas utmp is not, so let's just use
utmpx. This ought to work on at least FreeBSD as well. And if any free
operating systems that care about GNOME don't have utmpx yet, no doubt
they'll send patches.

https://bugzilla.gnome.org/show_bug.cgi?id=724193
2018-02-01 09:32:58 -06:00
..
background background: Remove GdkColor deprecation warnings 2018-02-01 09:11:00 +13:00
bluetooth build: Migrate from Intltool to Gettext 2018-01-23 10:49:31 +01:00
color build: Migrate from Intltool to Gettext 2018-01-23 10:49:31 +01:00
common common: Use GdkDevices directly as HT keys on GsdDeviceManagerX11 2018-01-30 21:20:11 +01:00
datetime datetime: Allow changing the timezone if polkit says so 2018-01-26 11:07:59 -02:00
display display: Fix night light minute selection 2018-01-30 09:38:11 -02:00
info build: Migrate from Intltool to Gettext 2018-01-23 10:49:31 +01:00
keyboard build: Migrate from Intltool to Gettext 2018-01-23 10:49:31 +01:00
mouse build: Migrate from Intltool to Gettext 2018-01-23 10:49:31 +01:00
network network: Replace GtkVBox with GtkBox 2018-01-26 22:25:18 -02:00
notifications build: Migrate from Intltool to Gettext 2018-01-23 10:49:31 +01:00
online-accounts build: Migrate from Intltool to Gettext 2018-01-23 10:49:31 +01:00
power power: Add 20 and 25 minutes suspend timeouts 2018-01-26 00:00:02 +01:00
printers build: Migrate from Intltool to Gettext 2018-01-23 10:49:31 +01:00
privacy privacy: Add link to Location Services privacy policy 2018-02-01 15:02:56 +01:00
region build: Migrate from Intltool to Gettext 2018-01-23 10:49:31 +01:00
search build: Migrate from Intltool to Gettext 2018-01-23 10:49:31 +01:00
sharing sharing: Move the "Remote Login" dialog Switch into the dialog 2018-01-25 23:42:02 -02:00
sound sound: Use g_auto for variables 2018-01-25 23:28:41 -02:00
universal-access universal-access: Style the Screen Reader dialog switch 2018-01-25 23:32:29 -02:00
user-accounts user-accounts: Fix definition of MAXNAMELEN 2018-02-01 09:32:58 -06:00
wacom wacom: Support the WSTYLUS_3D stylus type 2018-01-30 21:23:24 +01:00
meson.build build: Make network mandatory on every linux 2018-01-23 12:42:38 -02:00