diff options
author | Kai Kang <kai.kang@windriver.com> | 2021-02-09 16:29:15 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-02-09 08:51:48 -0800 |
commit | 592101d0f3fbd2c5bbad79ed027423f9c5e779c1 (patch) | |
tree | 8090d092ed70803ff41a808eb0aa740afcddbcad /meta-oe/recipes-graphics/lxdm | |
parent | f7d22fb620dcdcec1a86880f0352aaf07eb39c8a (diff) | |
download | meta-openembedded-592101d0f3fbd2c5bbad79ed027423f9c5e779c1.tar.gz |
lxdm: disallow empty new password
Do not clear text of label 'promt' when skip_password is set. When user
is required to update password, it only shows input box without label
for about 1 second.
And disallow empty new password when user is required to update it.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-graphics/lxdm')
-rw-r--r-- | meta-oe/recipes-graphics/lxdm/lxdm/0009-greeter.c-disallow-empty-new-password.patch | 53 | ||||
-rw-r--r-- | meta-oe/recipes-graphics/lxdm/lxdm_0.5.3.bb | 1 |
2 files changed, 54 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/lxdm/lxdm/0009-greeter.c-disallow-empty-new-password.patch b/meta-oe/recipes-graphics/lxdm/lxdm/0009-greeter.c-disallow-empty-new-password.patch new file mode 100644 index 000000000..3b12defb0 --- /dev/null +++ b/meta-oe/recipes-graphics/lxdm/lxdm/0009-greeter.c-disallow-empty-new-password.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From af1c347a31ae243d29c6087da8ffb423b23c74f2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Kai Kang <kai.kang@windriver.com> | ||
3 | Date: Mon, 1 Feb 2021 09:54:48 +0800 | ||
4 | Subject: [PATCH] greeter.c: disallow empty new password | ||
5 | |||
6 | Do not clear text of label 'promt' when skip_password is set. When user | ||
7 | is required to update password, it only shows input box without label | ||
8 | for about 1 second. | ||
9 | |||
10 | And disallow empty new password when user is required to update it. | ||
11 | |||
12 | Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/2/] | ||
13 | |||
14 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
15 | --- | ||
16 | src/greeter.c | 7 +++++-- | ||
17 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/src/greeter.c b/src/greeter.c | ||
20 | index 7e4a168..c0e6b64 100644 | ||
21 | --- a/src/greeter.c | ||
22 | +++ b/src/greeter.c | ||
23 | @@ -220,7 +220,6 @@ static void on_entry_activate(GtkEntry* entry) | ||
24 | } | ||
25 | if(g_key_file_get_integer(config,"base","skip_password",NULL)!=0) | ||
26 | { | ||
27 | - gtk_label_set_text( GTK_LABEL(prompt), ""); | ||
28 | try_login_user(user); | ||
29 | } | ||
30 | else | ||
31 | @@ -235,6 +239,10 @@ static void on_entry_activate(GtkEntry* entry) | ||
32 | if (pass_expired) { | ||
33 | if (!new_pass) { | ||
34 | new_pass = g_strdup(gtk_entry_get_text(entry)); | ||
35 | + if (strlen(new_pass) == 0) { | ||
36 | + new_pass = NULL; | ||
37 | + gtk_label_set_text((GtkLabel *)info, _("Empty password is not allowed.")); | ||
38 | + } | ||
39 | switch_to_input_passwd(); | ||
40 | } else { | ||
41 | tmp = g_strdup(gtk_entry_get_text(entry)); | ||
42 | @@ -251,7 +259,7 @@ static void on_entry_activate(GtkEntry* entry) | ||
43 | gtk_label_set_text((GtkLabel *)info, _("Maximum number of failed update password attempts exceeded.")); | ||
44 | switch_to_input_user(); | ||
45 | } | ||
46 | - } else if (!strcmp(pass, g_base64_encode((guchar*)new_pass, strlen(new_pass) + 1))) { | ||
47 | + } else if (pass && !strcmp(pass, g_base64_encode((guchar*)new_pass, strlen(new_pass) + 1))) { | ||
48 | // if new password is same as old one | ||
49 | g_free(new_pass); | ||
50 | new_pass = NULL; | ||
51 | -- | ||
52 | 2.25.1 | ||
53 | |||
diff --git a/meta-oe/recipes-graphics/lxdm/lxdm_0.5.3.bb b/meta-oe/recipes-graphics/lxdm/lxdm_0.5.3.bb index dcfd9e169..216bbb624 100644 --- a/meta-oe/recipes-graphics/lxdm/lxdm_0.5.3.bb +++ b/meta-oe/recipes-graphics/lxdm/lxdm_0.5.3.bb | |||
@@ -17,6 +17,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}%20${PV}/${BPN}-${PV}.tar. | |||
17 | file://0006-themes-Industrial-add-info-label-in-ui.patch \ | 17 | file://0006-themes-Industrial-add-info-label-in-ui.patch \ |
18 | file://0007-greeter.c-support-to-update-expired-password.patch \ | 18 | file://0007-greeter.c-support-to-update-expired-password.patch \ |
19 | file://0008-greeter.c-show-information-on-gtk-label-info.patch \ | 19 | file://0008-greeter.c-show-information-on-gtk-label-info.patch \ |
20 | file://0009-greeter.c-disallow-empty-new-password.patch \ | ||
20 | " | 21 | " |
21 | SRC_URI[md5sum] = "061caae432634e6db38bbdc84bc6ffa0" | 22 | SRC_URI[md5sum] = "061caae432634e6db38bbdc84bc6ffa0" |
22 | SRC_URI[sha256sum] = "4891efee81c72a400cc6703e40aa76f3f3853833d048b72ec805da0f93567f2f" | 23 | SRC_URI[sha256sum] = "4891efee81c72a400cc6703e40aa76f3f3853833d048b72ec805da0f93567f2f" |