summaryrefslogtreecommitdiff
path: root/user/physlock/utmps.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/physlock/utmps.patch')
-rw-r--r--user/physlock/utmps.patch30
1 files changed, 11 insertions, 19 deletions
diff --git a/user/physlock/utmps.patch b/user/physlock/utmps.patch
index efae166a9..f3ba5e575 100644
--- a/user/physlock/utmps.patch
+++ b/user/physlock/utmps.patch
@@ -1,31 +1,23 @@
---- physlock-11/auth.c 2017-07-13 07:23:52.000000000 +0000
-+++ physlock-11/auth.c 2018-09-21 21:21:36.240024566 +0000
-@@ -16,13 +16,14 @@
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-+#define _GNU_SOURCE
- #include <paths.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
+--- physlock-13/session.c 2019-01-28 18:46:20.000000000 +0000
++++ physlock-13/session.c 2019-04-18 07:11:54.749911535 +0000
+@@ -6,7 +7,7 @@
#include <pwd.h>
#include <unistd.h>
+ #include <errno.h>
-#include <utmp.h>
+#include <utmpx.h>
- #include <errno.h>
- #include <security/pam_misc.h>
-
-@@ -41,12 +42,12 @@ static void get_pam(userinfo_t *uinfo) {
- void get_user(userinfo_t *uinfo, int vt, uid_t owner) {
+ #if HAVE_SYSTEMD
+ #include <systemd/sd-login.h>
+@@ -50,11 +51,11 @@
+ int get_user_utmp(userinfo_t *uinfo, int vt) {
+ int ret = -1;
FILE *uf;
- struct utmp r;
+ struct utmpx r;
- struct passwd *pw;
- char tty[16], name[UT_NAMESIZE+1];
+ char tty[UT_LINESIZE+1], name[UT_NAMESIZE+1];
- uinfo->name = NULL;
+ name[0] = '\0';
- while ((uf = fopen(_PATH_UTMP, "r")) == NULL && errno == EINTR);
+ while ((uf = fopen(UTMPX_FILE, "r")) == NULL && errno == EINTR);