Author: branden Date: 2003-08-19 04:31:59 -0500 (Tue, 19 Aug 2003) New Revision: 401
Modified: trunk/debian/changelog trunk/debian/patches/002_xdm_fixes.diff Log: debian/patches/002_xdm_fixes.diff: in auth.c:openFiles(), check the return value of fopen() so that we don't SEGV when setting up an X authority file in /tmp because we couldn't write one in $HOME (based on a patch by Neil Brown -- thanks!) (Closes: #206141) Modified: trunk/debian/changelog =================================================================== --- trunk/debian/changelog 2003-08-19 09:19:12 UTC (rev 400) +++ trunk/debian/changelog 2003-08-19 09:31:59 UTC (rev 401) @@ -253,8 +253,13 @@ * debian/po/*: update templates.pot and *.po files to reflect changes to debconf templates - -- Branden Robinson <[EMAIL PROTECTED]> Tue, 19 Aug 2003 04:16:14 -0500 + * debian/patches/002_xdm_fixes.diff: in auth.c:openFiles(), check the return + value of fopen() so that we don't SEGV when setting up an X authority file + in /tmp because we couldn't write one in $HOME (based on a patch by Neil + Brown -- thanks!) (Closes: #206141) + -- Branden Robinson <[EMAIL PROTECTED]> Tue, 19 Aug 2003 04:21:59 -0500 + xfree86 (4.2.1-9) unstable; urgency=high * urgency due to xterm security fixes; see below Modified: trunk/debian/patches/002_xdm_fixes.diff =================================================================== --- trunk/debian/patches/002_xdm_fixes.diff 2003-08-19 09:19:12 UTC (rev 400) +++ trunk/debian/patches/002_xdm_fixes.diff 2003-08-19 09:31:59 UTC (rev 401) @@ -26,7 +26,7 @@ would fail. Well, tough titties." Since "-n" files are cleaned shortly after they are created, the existence of any such file would be an anomaly (the result of an xdm or xinit process getting killed - at an inopportune moment.) This doesn't seem like an important + at an inopportune moment). This doesn't seem like an important concession. - Also note that xdm is only susceptible to the aforementioned race-condition-based symlink attacks if: @@ -116,8 +116,8 @@ server.c.) diff -urN xc/programs/xdm~/auth.c xc/programs/xdm/auth.c ---- xc/programs/xdm~/auth.c 2003-02-23 17:03:35.000000000 -0500 -+++ xc/programs/xdm/auth.c 2003-02-23 17:15:37.000000000 -0500 +--- xc/programs/xdm~/auth.c 2003-08-19 01:01:30.000000000 -0500 ++++ xc/programs/xdm/auth.c 2003-08-19 01:04:55.000000000 -0500 @@ -46,6 +46,7 @@ #include "dm_error.h" @@ -206,7 +206,7 @@ fclose (auth_file); } return ret; -@@ -458,19 +475,34 @@ +@@ -458,19 +475,36 @@ openFiles (char *name, char *new_name, FILE **oldp, FILE **newp) { int mask; @@ -235,19 +235,21 @@ + { + Debug ("can't open new file %s\n", new_name); + return 0; - } -- *oldp = fopen (name, "r"); -- Debug ("opens succeeded %s %s\n", name, new_name); ++ } + else + Debug ("open succeeded: %s\n", new_name); + if (oldp) ++ { + *oldp = fopen (name, "r"); -+ if (*oldp) -+ Debug ("open succeeded %s\n", name); ++ if (*oldp) ++ Debug ("open succeeded: %s\n", name); + } +- *oldp = fopen (name, "r"); +- Debug ("opens succeeded %s %s\n", name, new_name); return 1; } -@@ -804,10 +836,11 @@ +@@ -804,10 +838,11 @@ struct in_ifaddr ifaddr; struct strioctl str; unsigned char *addr; @@ -261,7 +263,7 @@ /* Indicate that we want to start at the begining */ ifnet.ib_next = (struct ipb *) 1; -@@ -821,8 +854,9 @@ +@@ -821,8 +856,9 @@ if (ioctl (ipfd, (int) I_STR, (char *) &str) < 0) { @@ -272,7 +274,7 @@ } ifaddr.ia_next = (struct in_ifaddr *) ifnet.if_addrlist; -@@ -833,8 +867,9 @@ +@@ -833,8 +869,9 @@ if (ioctl (ipfd, (int) I_STR, (char *) &str) < 0) { @@ -283,7 +285,7 @@ } /* -@@ -874,11 +909,11 @@ +@@ -874,11 +911,11 @@ char *addr; int family; register struct ifreq *ifr; @@ -297,7 +299,7 @@ #ifdef ISC #define IFC_IFC_REQ (struct ifreq *) ifc.ifc_buf -@@ -1096,28 +1131,47 @@ +@@ -1096,28 +1133,47 @@ Debug ("openFiles failed\n"); XauUnlockAuth (home_name); lockStatus = LOCK_ERROR; @@ -349,7 +351,7 @@ home_name, backup_name); return; } -@@ -1186,8 +1240,9 @@ +@@ -1186,8 +1242,9 @@ Debug ("unlink %s failed\n", name); envname = name; if (link (new_name, name) == -1) { @@ -360,7 +362,7 @@ setenv = 1; envname = new_name; } else { -@@ -1263,12 +1318,14 @@ +@@ -1263,12 +1320,14 @@ if (unlink (name) == -1) Debug ("unlink %s failed\n", name); if (link (new_name, name) == -1) {