Commit graph

33 commits

Author SHA1 Message Date
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
Michael Catanzaro
0344f663dc user-accounts: Do not suggest usernames that are too long
We assume that we only generate valid usernames, so make sure they're
short enough to be used, else we'll display a dialog with a meaningless
error message when useradd fails.

Note that this commit doesn't completely fix the bug, as our definition
of MAXNAMELEN is different from useradd's.

https://bugzilla.gnome.org/show_bug.cgi?id=766401
2018-01-31 14:18:37 -06:00
Felipe Borges
ffb2aaabe7 user-accounts: Drop the user photo selector arrow
https://bugzilla.gnome.org/show_bug.cgi?id=778458
2017-02-13 11:55:32 +01:00
Piotr Drąg
1e1509240e user-accounts: use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772199
2016-10-03 15:21:21 +02:00
Felipe Borges
6d24ed5ae9 user-accounts: update strings to new design
https://wiki.gnome.org/Design/SystemSettings/UserAccounts

https://bugzilla.gnome.org/show_bug.cgi?id=767065
2016-06-01 11:43:08 +02:00
Zeeshan Ali (Khattak)
afebec5d9a common: Move get_smart_date() to common utils
And rename it to cc_util_get_smart_date().

In a following patch, we'll need to use it from privacy panel.

https://bugzilla.gnome.org/show_bug.cgi?id=761245
2016-03-03 16:07:58 +00:00
Ondrej Holy
006b5970a6 user-accounts: render user's icons as surface with scale
This patch is needed for future hidpi support.

https://bugzilla.gnome.org/show_bug.cgi?id=742395
2015-01-20 17:08:11 +01:00
Rui Matos
a880013b3e user-account: Don't stroke the down arrow with the border color
Besides using deprecated gtk+ API this color is actually fully
transparent in the current GNOME theme, meaning that the arrow ended
up looking smaller than intended.

https://bugzilla.gnome.org/show_bug.cgi?id=740986
2014-12-05 16:13:29 +01:00
Ondrej Holy
a53905f030 user-accounts: don't append period at the end of sentence
The period is appended at the end of sentences after there are
translated. However some languages might not use periods at the
end of sentences. This patch changes the texts directly.
2014-04-25 13:05:56 +02:00
Ryan Lortie
8bf4f51d1a user-accounts: missing semicolon 2014-02-12 13:27:06 -05:00
Ryan Lortie
07d24bbdab user-accounts: use POSIX for max login name length
Use the POSIX-specified way of determining the maximum length of a valid
username on this system.

https://bugzilla.gnome.org/show_bug.cgi?id=724193
2014-02-12 13:15:29 -05:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Ondrej Holy
a3d0840bdd user-accounts: Add password generation back to the password dialog
https://bugzilla.gnome.org/show_bug.cgi?id=706067
2013-08-16 23:08:28 +02:00
Ondrej Holy
aaf25450ee user-accounts: add positive confirmation to the password dialog
Add checkmarks, remove exclam icons, remove tooltips, change
password hints and decrese timeout (by design).

https://bugzilla.gnome.org/show_bug.cgi?id=702476
2013-08-16 21:56:28 +02:00
Jiro Matsuzawa
aa3af40114 user-accounts: Mark some strings as translatable
https://bugzilla.gnome.org/show_bug.cgi?id=695230
2013-08-13 21:15:26 +09:00
Yosef Or Boczko
0ca9771079 user-accounts: drop GtkStock
https://bugzilla.gnome.org/show_bug.cgi?id=704178
2013-07-19 16:02:31 +03:00
Joshua Lock
fa89c66aa6 user-accounts: fix counting of administrators in num_admin_accounts ()
Don't count inactive administrator accounts when trying to prevent the
user from disabling or deleting the only administrator account.

https://bugzilla.gnome.org/show_bug.cgi?id=690246
2013-06-19 13:03:16 +02:00
Ondrej Holy
86e45a5c74 user-accounts: Add user account dialog redesign
https://bugzilla.gnome.org/show_bug.cgi?id=689344
2013-06-05 16:43:12 +01:00
Thomas Wood
3af1b72691 user-accounts: prevent the only admin from being deleted or disabled
https://bugzilla.gnome.org/show_bug.cgi?id=690246
2013-06-05 16:43:12 +01:00
Michael Wood
654f4bb2ec um-utils: Don't allow duplicates of the same suggestion
Fix the initial value for the suggested login name can be added twice if
there is only one word.

https://bugzilla.gnome.org/show_bug.cgi?id=698234
2013-05-20 10:13:22 +01:00
Chris Cummins
11382d241a user-accounts: Disallow whitespace-only names
This prevents users from creating an account with a full name consisting
solely of whitespace, e.g., space and tab characters. Having "invisible"
real names can cause confusion on the login screen.

https://bugzilla.gnome.org/show_bug.cgi?id=699940
2013-05-17 16:34:13 +02:00
Ángel Guzmán Maeso
68dd98ba60 user-accounts: Fix deprecated function in um-utils.c
From gtk_icon_info_free() to g_object_unref()

https://bugzilla.gnome.org/show_bug.cgi?id=694362
2013-02-21 17:08:25 +01:00
Ryan Lortie
d46a23a5a2 user-accounts: port to libaccountsservice
This removes a bunch of duplicated code, and also drops
a direct dependency on libsystemd-login.

https://bugzilla.gnome.org/show_bug.cgi?id=671858
2013-01-03 11:39:58 -05:00
Ondrej Holy
691a258232 user-accounts: Add last login field
https://bugzilla.gnome.org/show_bug.cgi?id=681772
2012-12-03 14:55:23 +01:00
Matthias Clasen
a955ec4152 Switch files created by me to GPLv2+
This matches the rest of the control-center code base.
https://bugzilla.gnome.org/show_bug.cgi?id=683420
2012-09-06 19:07:09 -04:00
Stef Walter
43cf067cf2 user-accounts: Use the symbolic error icon in entries
Use the symbolic error icon when entries as indication when
entries don't validate.

https://bugzilla.gnome.org/show_bug.cgi?id=678178
2012-06-15 23:05:25 +02:00
Robert Roth
2714908bf7 Improved new username format message (bug #647851)
Added 'only' to the new username sentence ("The username must consist of")
to have "The username must only consist of", based on the suggestion in
bug #647851 (https://bugzilla.gnome.org/show_bug.cgi?id=647851).
2011-07-11 10:01:01 +02:00
Matthias Clasen
13a08f4994 Users: strip out periods when generating proposals
Some systems seem to disallow them in usernames, but more
importantly, the proposals look just wrong for abbreviated
middle initials with a period.

https://bugzilla.gnome.org/show_bug.cgi?id=650777
2011-05-23 09:19:19 -04:00
Matthias Clasen
aef79bbf79 Move username related utilities to um-utils.[hc]
This will make it easier to reuse them in gdm-initial-setup.
2011-05-18 21:20:39 -04:00
Cosimo Cecchi
0132e4be37 all: make GCC stop complaining about set but unused variables 2011-02-04 15:43:40 -05:00
Bastien Nocera
f925a9ea86 user-accounts: Don't use gtk_widget_size_request() 2011-01-25 18:45:02 +00:00
Matthias Clasen
f503381455 Use cairo to draw an arrow
Misusing gtk_paint_expander() turned out to not be a good
idea, now that the theme has started to draw +/- for expanders
instead of arrows.
2011-01-24 23:42:27 -05:00
William Jon McCann
bf5cb44016 Add user-accounts dialog
Copied from the accounts-dialog git module.
2010-10-30 18:04:15 -04:00