added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,40 @@
From 7c370576b4fb7c7d3b6dbf33125136a4ae70a330 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Wed, 31 Aug 2022 21:52:16 -0700
Subject: [PATCH] Initialize msghdr struct in a portable way
Initializing the structure assuming glibc layout results in
compile errors on musl, therefore do partial intialization and then
assigning the members individually.
Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/4/]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/lxcom.c | 9 +++++++--
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/lxcom.c b/src/lxcom.c
index 397d1b5..517c775 100644
--- a/src/lxcom.c
+++ b/src/lxcom.c
@@ -117,10 +117,15 @@ static gboolean lxcom_dispatch (GSource *source,GSourceFunc callback,gpointer us
char ctrl[/*CMSG_SPACE(sizeof(LXDM_CRED))*/1024];
struct sockaddr_un peer;
struct iovec v={buf,sizeof(buf)};
- struct msghdr h={&peer,sizeof(peer),&v,1,ctrl,sizeof(ctrl),0};
+ struct msghdr h={0};
struct cmsghdr *cmptr;
int ret;
-
+ h.msg_name = &peer;
+ h.msg_namelen = sizeof(peer);
+ h.msg_iov = &v;
+ h.msg_iovlen = 1;
+ h.msg_control = ctrl;
+ h.msg_controllen = sizeof(ctrl);
while(1)
{
peer.sun_family=0;
--
2.37.3

View File

@@ -0,0 +1,33 @@
From f6b8e141e00c4837239f5b69af4e7bee1204abba Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Thu, 17 Dec 2020 10:18:58 +0800
Subject: [PATCH 1/8] greeter: set visible when switch to input user
It switches back to input user entry if press Esc key when input the
password. At this time, the user name input is shown as '*' rather than
plain text. Set the visibility to fix this issue. And clean the text as
well.
Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/1/]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
src/greeter.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/greeter.c b/src/greeter.c
index 2c6e5be..f100c72 100644
--- a/src/greeter.c
+++ b/src/greeter.c
@@ -139,6 +139,8 @@ static void switch_to_input_user(void)
pass=NULL;
}
gtk_label_set_text( GTK_LABEL(prompt), _("User:"));
+ gtk_entry_set_text(GTK_ENTRY(login_entry), "");
+ gtk_entry_set_visibility(GTK_ENTRY(login_entry), TRUE);
gtk_widget_show(prompt);
if(user_list)
{
--
2.25.1

View File

@@ -0,0 +1,29 @@
From 5038c49c0b61e057dec44c932f02c4bf99cee96e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Mon, 3 Sep 2012 10:02:51 +0200
Subject: [PATCH] lxdm.conf.in: blacklist root for release images
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
data/lxdm.conf.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/data/lxdm.conf.in b/data/lxdm.conf.in
index defc082..759e6e5 100644
--- a/data/lxdm.conf.in
+++ b/data/lxdm.conf.in
@@ -58,5 +58,5 @@ disable=0
white=
## blacklist user
-black=
+black=root
--
1.7.4.4

View File

@@ -0,0 +1,38 @@
From f662906c52f264e4c139e402932103f47269aa1b Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Mon, 24 Jan 2022 17:16:15 +0800
Subject: [PATCH] systemd/lxdm.service: remove plymouth-quit conflicts
When use plymouth[1] with lxdm, the plymouth boot splash screen
will hang there as lxdm.service conflicts with plymouth-quit.service
and plymouth-quit will fail to start if plymouth-quit.service and
lxdm.service start at the same time and it will result in the boot
screen hang forever.
Consider there is also After setting for these two services, so
remove the conflicts setting to make the service start as expected.
[1] https://gitlab.freedesktop.org/plymouth/plymouth/-/tree/main
Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/3]
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
systemd/lxdm.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/systemd/lxdm.service b/systemd/lxdm.service
index bf4a0a8..90d8cdb 100644
--- a/systemd/lxdm.service
+++ b/systemd/lxdm.service
@@ -1,6 +1,6 @@
[Unit]
Description=LXDE Display Manager
-Conflicts=getty@tty1.service plymouth-quit.service
+Conflicts=getty@tty1.service
After=systemd-user-sessions.service getty@tty1.service plymouth-quit.service
[Service]
--
2.17.1

View File

@@ -0,0 +1,28 @@
From 3a3c5c644c9790cb3f88f3ce3757c2803cff90c5 Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Thu, 17 Dec 2020 14:32:40 +0800
Subject: [PATCH 2/8] greeter-gdk.c: fix typo
Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/1/]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
src/greeter-gdk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/greeter-gdk.c b/src/greeter-gdk.c
index 1b27d2e..5aa3e7f 100644
--- a/src/greeter-gdk.c
+++ b/src/greeter-gdk.c
@@ -299,7 +299,7 @@ void ui_prepare(void)
attr.wclass = GDK_INPUT_OUTPUT;
win = gdk_window_new(root, &attr, mask);
gdk_window_set_decorations(win,0);
- gdk_window_set_title(win,"lxdm-greter-gdk");
+ gdk_window_set_title(win,"lxdm-greeter-gdk");
scr=gdk_screen_get_default();
g_signal_connect(scr, "size-changed", G_CALLBACK(on_screen_size_changed), win);
--
2.25.1

View File

@@ -0,0 +1,33 @@
From 0ea0329f2c19a43acdc8444fa89e233ba617973d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Mon, 6 Oct 2014 13:06:24 +0200
Subject: [PATCH] let autotools create lxdm.conf
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
in out of tree builds lxdm.conf is empty
Upstream-Status: Submitted [http://sourceforge.net/p/lxde/mailman/message/32901417/]
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
data/lxdm.conf.in | 2 +-
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/data/lxdm.conf.in b/data/lxdm.conf.in
index d93f280..6206262 100644
--- a/data/lxdm.conf.in
+++ b/data/lxdm.conf.in
@@ -19,7 +19,7 @@
# skip_password=1
## greeter used to welcome the user
-greeter=@FULL_LIBEXECDIR@/lxdm-greeter-gtk
+greeter=@libexecdir@/lxdm-greeter-gtk
[server]
## arg used to start xserver, not fully function
--
1.8.3.1

View File

@@ -0,0 +1,36 @@
From 1d2425febf2020e38db70188df582acc9f37b136 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 30 Mar 2017 13:01:33 -0700
Subject: [PATCH] check for libexecinfo providing backtrace() APIs
on musl it depends on external library to provide backtrace APIs
unlike glibc where it is bundled in
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
configure.ac | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure.ac b/configure.ac
index aa3291c..b15f65d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,6 +15,7 @@ AM_PROG_CC_C_O
# Checks for libraries.
AC_CHECK_LIB([crypt], [crypt])
+AC_CHECK_LIB([execinfo], [backtrace])
# Check for PAM support
AC_ARG_WITH(pam, AC_HELP_STRING([--with-pam],[Use PAM for authentication]),
@@ -33,6 +34,7 @@ AM_CONDITIONAL(HAVE_PAM, [test -n "$USE_PAM" -a "x$USE_PAM" != xno ])
# Checks for header files.
AC_PATH_X
AC_CHECK_HEADERS([shadow.h stdlib.h string.h unistd.h utmpx.h])
+AC_CHECK_HEADERS([execinfo.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T
--
2.12.1

View File

@@ -0,0 +1,46 @@
From 497e0fc7010969759c8247f7013a89589c44234a Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Thu, 17 Dec 2020 18:12:29 +0800
Subject: [PATCH 3/8] check whether password expired with pam
Introduce a new enum AuthResult type AUTH_PASSWD_EXPIRE. When user's
password is expired, return it. Only work with pam.
Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/1/]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
src/lxdm.h | 1 +
src/pam.c | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/src/lxdm.h b/src/lxdm.h
index 568573f..1c2f837 100644
--- a/src/lxdm.h
+++ b/src/lxdm.h
@@ -41,6 +41,7 @@ enum AuthResult
AUTH_SUCCESS,
AUTH_BAD_USER,
AUTH_FAIL,
+ AUTH_PASSWD_EXPIRE,
AUTH_PRIV,
AUTH_ERROR
};
diff --git a/src/pam.c b/src/pam.c
index 43bd687..16a36f0 100644
--- a/src/pam.c
+++ b/src/pam.c
@@ -257,6 +257,10 @@ int lxdm_auth_user_authenticate(LXDM_AUTH *a,const char *user,const char *pass,i
return AUTH_FAIL;
}
ret=pam_acct_mgmt(a->handle,PAM_SILENT);
+ if (ret == PAM_NEW_AUTHTOK_REQD) {
+ g_debug("user %s account has expired\n", user);
+ return AUTH_PASSWD_EXPIRE;
+ }
if(ret!=PAM_SUCCESS)
{
g_debug("user %s acct mgmt fail with %d\n",user,ret);
--
2.25.1

View File

@@ -0,0 +1,25 @@
From 72812894cfd9454d70e4b0753531e46580416771 Mon Sep 17 00:00:00 2001
From: dgod <dgod.osa@gmail.com>
Date: Mon, 21 Mar 2016 19:25:25 +0800
Subject: [PATCH] fix css under gtk 3.20
Upstream-Status: Backport [https://git.lxde.org/gitweb/?p=lxde/lxdm.git;a=patch;h=72812894cfd9454d70e4b0753531e46580416771]
---
data/themes/Industrial/gtk.css | 1 +
1 file changed, 1 insertion(+)
diff --git a/data/themes/Industrial/gtk.css b/data/themes/Industrial/gtk.css
index 179f0d6..f8e6432 100644
--- a/data/themes/Industrial/gtk.css
+++ b/data/themes/Industrial/gtk.css
@@ -17,6 +17,7 @@
color: #000000;
}
+#bottom_pane label,
#bottom_pane GtkLabel {
font: Sans 12;
color: #9E9D9B;
--
2.14.4

View File

@@ -0,0 +1,124 @@
From d4de5497bd89c408377194b9fa9026ba8e68b634 Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Mon, 11 Jan 2021 14:11:05 +0800
Subject: [PATCH 4/8] lxdm.c: add function to change password with pam
Add function to change user's password when pam is enabled. It is useful
to change user's password when the password is expired.
Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/1/]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
src/lxdm.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/lxdm.h | 1 +
2 files changed, 69 insertions(+)
diff --git a/src/lxdm.c b/src/lxdm.c
index 638c30f..fe17a71 100644
--- a/src/lxdm.c
+++ b/src/lxdm.c
@@ -104,6 +104,10 @@ static int old_tty=1,def_tty = 7,nr_tty=0;
static int def_display=0;
static GSList *session_list;
+#if HAVE_LIBPAM
+static const char *new_passwd = NULL;
+#endif
+
static void lxdm_startx(LXSession *s);
static int get_active_vt(void)
@@ -759,6 +763,69 @@ int lxdm_auth_user(int type,char *user, char *pass, struct passwd **ppw)
return ret;
}
+
+#if HAVE_LIBPAM
+
+static int do_conv(int num, const struct pam_message **msg,struct pam_response **resp, void *arg)
+{
+ int result = PAM_SUCCESS;
+ int i;
+
+ *resp = (struct pam_response *) calloc(num, sizeof(struct pam_response));
+ for(i = 0; i < num; i++)
+ {
+ switch (msg[i]->msg_style) {
+ case PAM_PROMPT_ECHO_ON:
+ break;
+ case PAM_PROMPT_ECHO_OFF:
+ resp[i]->resp = strdup(new_passwd);
+ break;
+ case PAM_ERROR_MSG:
+ case PAM_TEXT_INFO:
+ break;
+ default:
+ break;
+ }
+ }
+ return result;
+}
+
+static int lxdm_change_passwd_pam(const char *service, const char *user, const char *pass)
+{
+ pam_handle_t *pamh = NULL;
+ static struct pam_conv conv = {
+ do_conv,
+ NULL
+ };
+
+ int ret = pam_start("lxdm", user, &conv, &pamh);
+ if (PAM_SUCCESS != ret) {
+ g_warning("pam_start failed.");
+ return 1;
+ }
+
+ new_passwd = pass;
+ ret = pam_chauthtok(pamh, 0);
+ if (PAM_SUCCESS != ret) {
+ g_warning("pam_chauthtok failed: %s", pam_strerror(pamh, ret));
+ return 1;
+ }
+
+ (void)pam_end(pamh, PAM_SUCCESS);
+
+ return 0;
+}
+#endif
+
+int lxdm_change_passwd(const char *user, const char *pass)
+{
+#if HAVE_LIBPAM
+ return lxdm_change_passwd_pam("lxdm", user, pass);
+#else
+ return 0;
+#endif
+}
+
static void close_left_fds(void)
{
struct dirent **list;
@@ -1446,6 +1513,7 @@ int lxdm_do_auto_login(void)
lxdm_do_login(pw,session,lang,option);
success=1;
}
+
g_free(user);g_free(session);g_free(lang);
}
g_free(last_lang);
diff --git a/src/lxdm.h b/src/lxdm.h
index 1c2f837..be3c81f 100644
--- a/src/lxdm.h
+++ b/src/lxdm.h
@@ -30,6 +30,7 @@ G_BEGIN_DECLS
extern GKeyFile *config;
int lxdm_auth_user(int type,char *user,char *pass,struct passwd **ppw);
+int lxdm_change_passwd(const char *user, const char *pass);
void lxdm_do_login(struct passwd *pw,char *session,char *lang,char *option);
void lxdm_do_reboot(void);
void lxdm_do_shutdown(void);
--
2.25.1

View File

@@ -0,0 +1,53 @@
From 54b2ed18ca52fa682ade2fe84e1b0d19d1b78cc4 Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Mon, 11 Jan 2021 16:48:26 +0800
Subject: [PATCH 5/8] ui.c: handle password-expire and update-new-password
Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/1/]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
src/ui.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/ui.c b/src/ui.c
index f233589..3ddb484 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -161,6 +161,9 @@ static gboolean on_greeter_input(GIOChannel *source, GIOCondition condition, gpo
ui_drop();
lxdm_do_login(pw, session, lang,NULL);
}
+ else if (AUTH_PASSWD_EXPIRE == ret) {
+ xwrite(greeter_pipe[0], "password-expire\n", 16);
+ }
else
{
if(pass!=NULL)
@@ -205,6 +208,23 @@ static gboolean on_greeter_input(GIOChannel *source, GIOCondition condition, gpo
g_free(session);
g_free(lang);
}
+ else if (!strncmp(str, "update-new-password", 19)) {
+ xwrite(greeter_pipe[0], "update-new-password\n", 20);
+ char *user = greeter_param(str, "user");
+ char *pass = greeter_param(str, "newpass");
+ char *session = greeter_param(str, "session");
+ char *lang = greeter_param(str, "lang");
+
+ int ret = lxdm_change_passwd(user, pass);
+ if (ret) {
+ xwrite(greeter_pipe[0], "invalid-new-password\n", 21);
+ } else {
+ struct passwd *pw;
+ ret = lxdm_auth_user(AUTH_TYPE_NORMAL, user, pass, &pw);
+ ui_drop();
+ lxdm_do_login(pw, session, lang, NULL);
+ }
+ }
g_free(str);
return TRUE;
}
--
2.25.1

View File

@@ -0,0 +1,124 @@
From 8414d63343cc7909bc7a972941c678509d5d5be6 Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Mon, 11 Jan 2021 10:15:45 +0800
Subject: [PATCH 6/8] themes/Industrial: add info label in ui
Adjust the layout and add a new label "info" under the labe "prompt" in
themes/Industrial to tell user some useful information such as
"Authentication failed" or "Invalid password".
Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/1/]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
data/themes/Industrial/greeter-gtk3.ui | 27 +++++++++++++++++++++++++-
data/themes/Industrial/greeter.ui | 27 +++++++++++++++++++++++++-
data/themes/Industrial/gtk.css | 5 +++++
3 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/data/themes/Industrial/greeter-gtk3.ui b/data/themes/Industrial/greeter-gtk3.ui
index 2f4e631..e59eee3 100644
--- a/data/themes/Industrial/greeter-gtk3.ui
+++ b/data/themes/Industrial/greeter-gtk3.ui
@@ -45,7 +45,12 @@
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
- <object class="GtkHBox" id="hbox3">
+ <object class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
@@ -91,6 +96,26 @@
</packing>
</child>
</object>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="info">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="yalign">0.2</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
</child>
</object>
<packing>
diff --git a/data/themes/Industrial/greeter.ui b/data/themes/Industrial/greeter.ui
index 3413922..6a02d8d 100644
--- a/data/themes/Industrial/greeter.ui
+++ b/data/themes/Industrial/greeter.ui
@@ -47,7 +47,12 @@
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
- <object class="GtkHBox" id="hbox3">
+ <object class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="spacing">12</property>
<child>
@@ -93,6 +98,26 @@
</packing>
</child>
</object>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="info">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"></property>
+ <property name="yalign">0.2</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
</child>
</object>
<packing>
diff --git a/data/themes/Industrial/gtk.css b/data/themes/Industrial/gtk.css
index 7621345..be15f43 100644
--- a/data/themes/Industrial/gtk.css
+++ b/data/themes/Industrial/gtk.css
@@ -22,3 +22,8 @@
font: Sans 12;
color: #9E9D9B;
}
+
+#info {
+ font: Sans 14;
+ font-style: italic;
+}
--
2.25.1

View File

@@ -0,0 +1,180 @@
From bae6a2b3a2232abd16a8d8558dda542d4970f1bb Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Tue, 12 Jan 2021 09:23:05 +0800
Subject: [PATCH 7/8] greeter.c: support to update expired password
Update greeter to work with ui to handle expired password. It checks
whether password is expired after input user and password. If expired,
force user to update password immediately. It allows 3 times to try. If
exceeds, reset to input user.
Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/1/]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
src/greeter.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 81 insertions(+), 2 deletions(-)
diff --git a/src/greeter.c b/src/greeter.c
index f100c72..804fca0 100644
--- a/src/greeter.c
+++ b/src/greeter.c
@@ -77,6 +77,8 @@ static GtkWidget *lang_menu;
static char* user = NULL;
static char* pass = NULL;
+static char* new_pass = NULL;
+static gboolean pass_expired = FALSE;
static char* ui_file = NULL;
static char *ui_nobody = NULL;
@@ -167,10 +169,19 @@ static void switch_to_input_passwd(void)
else
gtk_widget_hide(user_list);
}
- gtk_label_set_text( GTK_LABEL(prompt), _("Password:") );
+ if (pass_expired) {
+ if (!new_pass) {
+ gtk_label_set_text(GTK_LABEL(prompt), _("New password:"));
+ } else {
+ gtk_label_set_text(GTK_LABEL(prompt), _("Retype new password:"));
+ }
+ } else {
+ gtk_label_set_text( GTK_LABEL(prompt), _("Password:") );
+ }
gtk_entry_set_text(GTK_ENTRY(login_entry), "");
gtk_entry_set_visibility(GTK_ENTRY(login_entry), FALSE);
gtk_widget_show(login_entry);
+ gtk_widget_show(prompt);
gtk_widget_grab_focus(login_entry);
}
@@ -189,6 +200,8 @@ static void try_login_user(const char *user)
static void on_entry_activate(GtkEntry* entry)
{
+ static int count = 0;
+
char* tmp;
if( !user )
{
@@ -217,6 +230,46 @@ static void on_entry_activate(GtkEntry* entry)
}
else
{
+ if (pass_expired) {
+ if (!new_pass) {
+ new_pass = g_strdup(gtk_entry_get_text(entry));
+ switch_to_input_passwd();
+ } else {
+ tmp = g_strdup(gtk_entry_get_text(entry));
+ if (strcmp(new_pass, tmp)) {
+ g_free(new_pass);
+ new_pass = NULL;
+ // if new passwords not match, retry for 3 times at most
+ if (++count < 3) {
+ switch_to_input_passwd();
+ } else {
+ count = 0;
+ pass_expired = FALSE;
+ switch_to_input_user();
+ }
+ } else if (!strcmp(pass, g_base64_encode((guchar*)new_pass, strlen(new_pass) + 1))) {
+ // if new password is same as old one
+ g_free(new_pass);
+ new_pass = NULL;
+ if (++count < 3) {
+ switch_to_input_passwd();
+ } else {
+ count = 0;
+ pass_expired = FALSE;
+ switch_to_input_user();
+ }
+ } else {
+ char *session_exec=get_session_exec();
+ char *session_lang=get_session_lang();
+
+ printf("update-new-password user=%s newpass=%s session=%s lang=%s\n",
+ user, new_pass, session_exec, session_lang);
+ }
+ }
+
+ return ;
+ }
+
char *session_exec=get_session_exec();
char *session_lang=get_session_lang();
@@ -227,6 +280,7 @@ static void on_entry_activate(GtkEntry* entry)
printf("login user=%s pass=%s session=%s lang=%s\n",
user, pass, session_exec, session_lang);
+#if 0
/* password check failed */
g_free(user);
user = NULL;
@@ -241,6 +295,7 @@ static void on_entry_activate(GtkEntry* entry)
gtk_label_set_text( GTK_LABEL(prompt), _("User:") );
gtk_entry_set_text(GTK_ENTRY(entry), "");
gtk_entry_set_visibility(GTK_ENTRY(entry), TRUE);
+#endif
}
}
@@ -1091,8 +1146,12 @@ static void on_screen_size_changed(GdkScreen *screen,GtkWidget *win)
static gint login_entry_on_key_press (GtkWidget *widget,GdkEventKey *event)
{
- if(event->keyval == GDK_Escape)
+ if(event->keyval == GDK_Escape) {
+ g_free(new_pass);
+ new_pass = NULL;
+ pass_expired = FALSE;
switch_to_input_user();
+ }
return FALSE;
}
@@ -1285,8 +1344,10 @@ static void create_win()
static gboolean on_lxdm_command(GIOChannel *source, GIOCondition condition, gpointer data)
{
+
GIOStatus ret;
char *str;
+ static int count = 0;
if( !(G_IO_IN & condition) )
return FALSE;
@@ -1300,10 +1361,28 @@ static gboolean on_lxdm_command(GIOChannel *source, GIOCondition condition, gpoi
{
switch_to_input_user();
}
+ else if (!strncmp(str, "password-expire", 15))
+ {
+ pass_expired = TRUE;
+ switch_to_input_passwd();
+ }
else if( !strncmp(str, "password", 8))
{
switch_to_input_passwd();
}
+ else if (!strncmp(str, "invalid-new-password", 20))
+ {
+ g_free(new_pass);
+ new_pass = NULL;
+
+ if (count++ < 3) {
+ switch_to_input_passwd();
+ } else {
+ count = 0;
+ pass_expired = FALSE;
+ switch_to_input_user();
+ }
+ }
g_free(str);
return TRUE;
}
--
2.25.1

View File

@@ -0,0 +1,99 @@
From bb4ff4b134383bfdadf7cb5353d3553a8a72d47e Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Wed, 13 Jan 2021 10:45:48 +0800
Subject: [PATCH 8/8] greeter.c: show information on gtk label 'info'
Show information on a gtk label 'info' which is added under label
'prompt' in the .glade or .ui files.
Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/1/]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
src/greeter.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/greeter.c b/src/greeter.c
index 804fca0..a4a2336 100644
--- a/src/greeter.c
+++ b/src/greeter.c
@@ -64,6 +64,7 @@ static GtkWidget* win;
static GtkWidget* alignment2;
static GtkWidget* prompt;
static GtkWidget* login_entry;
+static GtkWidget* info;
static GtkWidget* user_list_scrolled;
static GtkWidget* user_list;
@@ -241,10 +242,12 @@ static void on_entry_activate(GtkEntry* entry)
new_pass = NULL;
// if new passwords not match, retry for 3 times at most
if (++count < 3) {
+ gtk_label_set_text((GtkLabel *)info, _("Passwords do not match, please retry."));
switch_to_input_passwd();
} else {
count = 0;
pass_expired = FALSE;
+ gtk_label_set_text((GtkLabel *)info, _("Maximum number of failed update password attempts exceeded."));
switch_to_input_user();
}
} else if (!strcmp(pass, g_base64_encode((guchar*)new_pass, strlen(new_pass) + 1))) {
@@ -252,6 +255,7 @@ static void on_entry_activate(GtkEntry* entry)
g_free(new_pass);
new_pass = NULL;
if (++count < 3) {
+ gtk_label_set_text((GtkLabel *)info, _("New password is same as old one, password unchanged."));
switch_to_input_passwd();
} else {
count = 0;
@@ -1146,6 +1150,9 @@ static void on_screen_size_changed(GdkScreen *screen,GtkWidget *win)
static gint login_entry_on_key_press (GtkWidget *widget,GdkEventKey *event)
{
+
+ gtk_label_set_text(GTK_LABEL(info), "");
+
if(event->keyval == GDK_Escape) {
g_free(new_pass);
new_pass = NULL;
@@ -1211,11 +1218,14 @@ static void create_win()
login_entry = (GtkWidget*)gtk_builder_get_object(builder, "login_entry");
if(login_entry!=NULL)
{
- g_signal_connect_after(login_entry,"key-press-event",G_CALLBACK(login_entry_on_key_press),NULL);
+ g_signal_connect(login_entry,"key-press-event",G_CALLBACK(login_entry_on_key_press),NULL);
}
g_signal_connect(login_entry, "activate", G_CALLBACK(on_entry_activate), NULL);
+ info = (GtkWidget *)gtk_builder_get_object(builder, "info");
+ gtk_label_set_text(GTK_LABEL(info), "");
+
if( g_key_file_get_integer(config, "display", "bottom_pane", 0)==1)
{
/* hacks to let GtkEventBox paintable with gtk pixmap engine. */
@@ -1359,11 +1369,13 @@ static gboolean on_lxdm_command(GIOChannel *source, GIOCondition condition, gpoi
gtk_main_quit();
else if( !strncmp(str, "reset", 5) )
{
+ gtk_label_set_text(GTK_LABEL(info), _("Authentication failed."));
switch_to_input_user();
}
else if (!strncmp(str, "password-expire", 15))
{
pass_expired = TRUE;
+ gtk_label_set_text(GTK_LABEL(info), _("You are required to change your password immediately."));
switch_to_input_passwd();
}
else if( !strncmp(str, "password", 8))
@@ -1376,6 +1388,7 @@ static gboolean on_lxdm_command(GIOChannel *source, GIOCondition condition, gpoi
new_pass = NULL;
if (count++ < 3) {
+ gtk_label_set_text(GTK_LABEL(info), _("Invalid new password. Please input new password again."));
switch_to_input_passwd();
} else {
count = 0;
--
2.25.1

View File

@@ -0,0 +1,53 @@
From af1c347a31ae243d29c6087da8ffb423b23c74f2 Mon Sep 17 00:00:00 2001
From: Kai Kang <kai.kang@windriver.com>
Date: Mon, 1 Feb 2021 09:54:48 +0800
Subject: [PATCH] greeter.c: 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.
Upstream-Status: Submitted [https://sourceforge.net/p/lxdm/code/merge-requests/2/]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
src/greeter.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/greeter.c b/src/greeter.c
index 7e4a168..c0e6b64 100644
--- a/src/greeter.c
+++ b/src/greeter.c
@@ -220,7 +220,6 @@ static void on_entry_activate(GtkEntry* entry)
}
if(g_key_file_get_integer(config,"base","skip_password",NULL)!=0)
{
- gtk_label_set_text( GTK_LABEL(prompt), "");
try_login_user(user);
}
else
@@ -235,6 +239,10 @@ static void on_entry_activate(GtkEntry* entry)
if (pass_expired) {
if (!new_pass) {
new_pass = g_strdup(gtk_entry_get_text(entry));
+ if (strlen(new_pass) == 0) {
+ new_pass = NULL;
+ gtk_label_set_text((GtkLabel *)info, _("Empty password is not allowed."));
+ }
switch_to_input_passwd();
} else {
tmp = g_strdup(gtk_entry_get_text(entry));
@@ -251,7 +259,7 @@ static void on_entry_activate(GtkEntry* entry)
gtk_label_set_text((GtkLabel *)info, _("Maximum number of failed update password attempts exceeded."));
switch_to_input_user();
}
- } else if (!strcmp(pass, g_base64_encode((guchar*)new_pass, strlen(new_pass) + 1))) {
+ } else if (pass && !strcmp(pass, g_base64_encode((guchar*)new_pass, strlen(new_pass) + 1))) {
// if new password is same as old one
g_free(new_pass);
new_pass = NULL;
--
2.25.1

View File

@@ -0,0 +1,13 @@
#%PAM-1.0
# taken from http://aur.archlinux.org/packages/lx/lxdm-git/lxdm-git.tar.gz
# further info https://wiki.archlinux.org/index.php/LXDM
auth requisite pam_nologin.so
auth required pam_env.so
auth required pam_unix.so
# To allow passwordless login comment previous line and uncomment next line
#auth required pam_unix.so nullok
account required pam_unix.so
session required pam_limits.so
session required pam_unix.so
password required pam_unix.so
-session optional pam_systemd.so

View File

@@ -0,0 +1,13 @@
#%PAM-1.0
# taken from http://aur.archlinux.org/packages/lx/lxdm-git/lxdm-git.tar.gz
# further info https://wiki.archlinux.org/index.php/LXDM
auth requisite pam_nologin.so
auth required pam_env.so
#auth required pam_unix.so
# To deny passwordless login comment next line and uncomment previous line
auth required pam_unix.so nullok
account required pam_unix.so
session required pam_limits.so
session required pam_unix.so
password required pam_unix.so
-session optional pam_systemd.so

View File

@@ -0,0 +1,4 @@
[base]
last_session=
last_lang=
last_langs=

View File

@@ -0,0 +1,92 @@
SUMMARY = "LXDM is the lightweight display manager"
HOMEPAGE = "http://blog.lxde.org/?p=531"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}%20${PV}/${BPN}-${PV}.tar.xz \
file://lxdm.conf \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'file://lxdm-pam file://lxdm-pam-debug', '', d)} \
${@bb.utils.contains("DISTRO_TYPE", "debug", "", "file://0001-lxdm.conf.in-blacklist-root-for-release-images.patch",d)} \
file://0002-let-autotools-create-lxdm.conf.patch \
file://0003-check-for-libexecinfo-providing-backtrace-APIs.patch \
file://0004-fix-css-under-gtk-3.20.patch \
file://0001-greeter-set-visible-when-switch-to-input-user.patch \
file://0002-greeter-gdk.c-fix-typo.patch \
file://0003-check-whether-password-expired-with-pam.patch \
file://0004-lxdm.c-add-function-to-change-password-with-pam.patch \
file://0005-ui.c-handle-password-expire-and-update-new-password.patch \
file://0006-themes-Industrial-add-info-label-in-ui.patch \
file://0007-greeter.c-support-to-update-expired-password.patch \
file://0008-greeter.c-show-information-on-gtk-label-info.patch \
file://0009-greeter.c-disallow-empty-new-password.patch \
file://0001-systemd-lxdm.service-remove-plymouth-quit-conflicts.patch \
file://0001-Initialize-msghdr-struct-in-a-portable-way.patch \
"
SRC_URI[md5sum] = "061caae432634e6db38bbdc84bc6ffa0"
SRC_URI[sha256sum] = "4891efee81c72a400cc6703e40aa76f3f3853833d048b72ec805da0f93567f2f"
PE = "1"
DEPENDS = "virtual/libintl intltool-native cairo dbus gdk-pixbuf glib-2.0 gtk+3 virtual/libx11 libxcb pango iso-codes"
DEPENDS += "${@bb.utils.contains("DISTRO_FEATURES", "systemd", "", "consolekit", d)}"
DEPENDS:append:libc-musl = " libexecinfo"
# combine oe-core way with angstrom DISTRO_TYPE
DISTRO_TYPE ?= "${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", "debug", "",d)}"
inherit autotools pkgconfig gettext systemd features_check
# depends on virtual/libx11
REQUIRED_DISTRO_FEATURES = "x11"
CFLAGS:append = " -fno-builtin-fork -fno-builtin-memset -fno-builtin-strstr "
LDFLAGS:append:libc-musl = " -lexecinfo"
EXTRA_OECONF += "--enable-gtk3=yes --enable-password=yes --with-x -with-xconn=xcb \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/ --disable-consolekit', '--without-systemdsystemunitdir', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
"
do_configure:prepend() {
cp ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/
}
do_compile:append() {
# default background configured not available / no password field available / no default screensaver
sed -i -e 's,bg=,# bg=,g' \
-e 's,# skip_password=,skip_password=,g' \
-e 's,# arg=.*,arg=${bindir}/X -s 0,g' \
${S}/data/lxdm.conf.in
# add default configuration
oe_runmake -C ${B}/data lxdm.conf
}
do_install:append() {
install -d ${D}${localstatedir}/lib/lxdm
install -m 644 ${WORKDIR}/lxdm.conf ${D}${localstatedir}/lib/lxdm
if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
# ArchLinux version of pam config has the following advantages:
# * simple setup of passwordless login
# * in XFCE powerdown/restart enabled in logoff dialog
install -m 644 ${WORKDIR}/${@bb.utils.contains("DISTRO_TYPE", "debug", "lxdm-pam-debug", "lxdm-pam",d)} ${D}${sysconfdir}/pam.d/lxdm
fi
}
# make installed languages choosable
pkg_postinst:${PN} () {
langs=""
for lang in `find $D${libdir}/locale -maxdepth 1 | grep _ | sort`; do
lang=`basename $lang`
if [ "x$langs" = "x" ]; then
langs="$lang"
else
langs="$langs $lang"
fi
done
sed -i "s:last_langs=.*$:last_langs=$langs:g" $D${localstatedir}/lib/lxdm/lxdm.conf
}
RDEPENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-loginuid', '', d)} setxkbmap bash librsvg-gtk"
RPROVIDES:${PN} += "${PN}-systemd"
RREPLACES:${PN} += "${PN}-systemd"
RCONFLICTS:${PN} += "${PN}-systemd"
SYSTEMD_SERVICE:${PN} = "lxdm.service"