patches: Refreshed.

This commit is contained in:
Timo Aaltonen 2020-02-28 22:21:45 +02:00
parent 48de9f41ad
commit 67a695fd48
2 changed files with 6 additions and 15 deletions

1
debian/changelog vendored
View File

@ -7,6 +7,7 @@ x11-xserver-utils (7.7+9) UNRELEASED; urgency=medium
* xrdb 1.2.0. * xrdb 1.2.0.
* xstdcmap 1.0.4. * xstdcmap 1.0.4.
* Use debhelper 12. * Use debhelper 12.
* patches: Refreshed.
-- Timo Aaltonen <tjaalton@debian.org> Fri, 31 Jan 2020 13:58:50 +0200 -- Timo Aaltonen <tjaalton@debian.org> Fri, 31 Jan 2020 13:58:50 +0200

View File

@ -19,9 +19,7 @@ Not submitted to XFree86.
--- a/sessreg/sessreg.c --- a/sessreg/sessreg.c
+++ b/sessreg/sessreg.c +++ b/sessreg/sessreg.c
@@ -87,10 +87,22 @@ static void set_utmp (struct utmp *u, ch @@ -89,6 +89,18 @@ static void set_utmpx (struct utmpx *u,
#ifdef USE_UTMPX
static void set_utmpx (struct utmpx *u, const char *line, const char *user,
const char *host, time_t date, int addp); const char *host, time_t date, int addp);
#endif #endif
@ -40,11 +38,7 @@ Not submitted to XFree86.
static int wflag, uflag, lflag; static int wflag, uflag, lflag;
static const char *wtmp_file, *utmp_file; static const char *wtmp_file, *utmp_file;
#ifdef USE_UTMPX #ifdef USE_UTMPX
#ifdef HAVE_UPDWTMPX @@ -452,21 +464,23 @@ set_utmp (struct utmp *u, char *line, ch
static const char *wtmpx_file = NULL;
@@ -436,25 +448,27 @@ set_utmp (struct utmp *u, char *line, ch
(void) strncpy (u->ut_name, user, sizeof (u->ut_name));
else
memset (u->ut_name, 0, sizeof (u->ut_name)); memset (u->ut_name, 0, sizeof (u->ut_name));
#ifdef HAVE_STRUCT_UTMP_UT_ID #ifdef HAVE_STRUCT_UTMP_UT_ID
if (line) { if (line) {
@ -64,7 +58,7 @@ Not submitted to XFree86.
- i -= sizeof (u->ut_id); - i -= sizeof (u->ut_id);
- else - else
- i = 0; - i = 0;
- (void) strncpy (u->ut_id, line + i, sizeof (u->ut_id)); - safe_strncpy (u->ut_id, line + i, sizeof (u->ut_id));
+ ub4 h; + ub4 h;
+ u->ut_id[0]=':'; + u->ut_id[0]=':';
+ h = hash(line, strlen(line),0x9e3779b9); + h = hash(line, strlen(line),0x9e3779b9);
@ -76,15 +70,11 @@ Not submitted to XFree86.
+ * Clearing ut_id may result in race conditions leading to corrupted + * Clearing ut_id may result in race conditions leading to corrupted
+ * utmp entries and and potential security holes. + * utmp entries and and potential security holes.
+ */ + */
+ /* TODO: CHECK this */ + /* TODO: CHECK this */
memset (u->ut_id, 0, sizeof (u->ut_id)); memset (u->ut_id, 0, sizeof (u->ut_id));
#endif #endif
#ifdef HAVE_STRUCT_UTMP_UT_PID #ifdef HAVE_STRUCT_UTMP_UT_PID
if (addp) @@ -716,3 +730,129 @@ findslot (char *line_name, char *host_na
u->ut_pid = getppid ();
@@ -700,5 +714,131 @@ findslot (char *line_name, char *host_na
return slot; /* first slot past current entries */
else
return freeslot; return freeslot;
} }
#endif #endif