Rediff 01_sessreg_implement_hostname_hashing.diff.

This commit is contained in:
Julien Cristau 2012-04-30 21:09:47 +02:00
parent 1d76ee9d27
commit b917b7ec8f
2 changed files with 14 additions and 13 deletions

1
debian/changelog vendored
View File

@ -12,6 +12,7 @@ x11-xserver-utils (7.6+4) UNRELEASED; urgency=low
* xhost 1.0.5. * xhost 1.0.5.
* xmodmap 1.0.7. * xmodmap 1.0.7.
* Don't use dh_testroot in debian/rules clean. * Don't use dh_testroot in debian/rules clean.
* Rediff 01_sessreg_implement_hostname_hashing.diff.
[ Moritz Muehlenhoff ] [ Moritz Muehlenhoff ]
* Enable hardened build flags (closes: #655503) * Enable hardened build flags (closes: #655503)

View File

@ -21,11 +21,11 @@ Index: x11-xserver-utils/sessreg/sessreg.c
=================================================================== ===================================================================
--- x11-xserver-utils.orig/sessreg/sessreg.c --- x11-xserver-utils.orig/sessreg/sessreg.c
+++ x11-xserver-utils/sessreg/sessreg.c +++ x11-xserver-utils/sessreg/sessreg.c
@@ -93,6 +93,18 @@ static void set_utmpx (struct utmpx *u, @@ -88,6 +88,18 @@ static void set_utmpx (struct utmpx *u,
const char *host, Time_t date, int addp); const char *host, time_t date, int addp);
#endif #endif
+#ifdef SYSV +#ifdef HAVE_STRUCT_UTMP_UT_ID
+/* used for hashing ut_id */ +/* used for hashing ut_id */
+typedef unsigned long int ub4; /* unsigned 4-byte quantities */ +typedef unsigned long int ub4; /* unsigned 4-byte quantities */
+typedef unsigned char ub1; /* unsigned 1-byte quantities */ +typedef unsigned char ub1; /* unsigned 1-byte quantities */
@ -38,11 +38,11 @@ Index: x11-xserver-utils/sessreg/sessreg.c
+#endif +#endif
+ +
static int wflag, uflag, lflag; static int wflag, uflag, lflag;
static char *wtmp_file, *utmp_file, *line; static const char *wtmp_file, *utmp_file;
#ifdef USE_UTMPX static char *line;
@@ -404,21 +416,23 @@ set_utmp (struct utmp *u, char *line, ch @@ -397,21 +409,23 @@ set_utmp (struct utmp *u, char *line, ch
bzero (u->ut_name, sizeof (u->ut_name)); memset (u->ut_name, 0, sizeof (u->ut_name));
#ifdef SYSV #ifdef HAVE_STRUCT_UTMP_UT_ID
if (line) { if (line) {
- int i; - int i;
/* /*
@ -73,15 +73,15 @@ Index: x11-xserver-utils/sessreg/sessreg.c
+ * utmp entries and and potential security holes. + * utmp entries and and potential security holes.
+ */ + */
+ /* TODO: CHECK this */ + /* TODO: CHECK this */
bzero (u->ut_id, sizeof (u->ut_id)); memset (u->ut_id, 0, sizeof (u->ut_id));
if (addp) { #endif
u->ut_pid = getppid (); #ifdef HAVE_STRUCT_UTMP_UT_PID
@@ -662,3 +676,129 @@ findslot (char *line_name, char *host_na @@ -660,3 +674,129 @@ findslot (char *line_name, char *host_na
return freeslot; return freeslot;
} }
#endif #endif
+ +
+#ifdef SYSV +#ifdef HAVE_STRUCT_UTMP_UT_ID
+/* +/*
+-------------------------------------------------------------------- +--------------------------------------------------------------------
+mix -- mix 3 32-bit values reversibly. +mix -- mix 3 32-bit values reversibly.