]> git.pld-linux.org Git - packages/XFree86.git/commitdiff
- XFree patches. XFree86-3_3_3_1-22 XFree86_3_3_6-1
authorkloczek <kloczek@pld-linux.org>
Fri, 26 Mar 1999 08:43:00 +0000 (08:43 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    XFree86-HasZlib.patch -> 1.1
    XFree86-alpha-sockets.patch -> 1.1
    XFree86-fsstnd.patch -> 1.1
    XFree86-joy.patch -> 1.1
    XFree86-ncurses.patch -> 1.1
    XFree86-pam.patch -> 1.1
    XFree86-ru_SU.patch -> 1.1
    XFree86-xfsredhat.patch -> 1.1

XFree86-HasZlib.patch [new file with mode: 0644]
XFree86-alpha-sockets.patch [new file with mode: 0644]
XFree86-fsstnd.patch [new file with mode: 0644]
XFree86-joy.patch [new file with mode: 0644]
XFree86-ncurses.patch [new file with mode: 0644]
XFree86-pam.patch [new file with mode: 0644]
XFree86-ru_SU.patch [new file with mode: 0644]
XFree86-xfsredhat.patch [new file with mode: 0644]

diff --git a/XFree86-HasZlib.patch b/XFree86-HasZlib.patch
new file mode 100644 (file)
index 0000000..827c011
--- /dev/null
@@ -0,0 +1,10 @@
+--- XFree86-3.3.2.3/xc/config/cf/linux.cf~     Sun Aug 30 15:23:40 1998
++++ XFree86-3.3.2.3/xc/config/cf/linux.cf      Sun Aug 30 15:25:09 1998
+@@ -309,3 +309,7 @@
+ #ifndef XtermWithI18N
+ #define XtermWithI18N YES
+ #endif
++
++#ifndef HasZlib
++#define HasZlib               YES
++#endif
diff --git a/XFree86-alpha-sockets.patch b/XFree86-alpha-sockets.patch
new file mode 100644 (file)
index 0000000..b0d62d9
--- /dev/null
@@ -0,0 +1,720 @@
+--- XFree86-3.3.3.1/xc/include/Xpoll.h.alpha-sockets   Mon Jan 11 12:28:21 1999
++++ XFree86-3.3.3.1/xc/include/Xpoll.h Mon Jan 11 12:30:05 1999
+@@ -40,7 +40,7 @@
+ #include <X11/Xos.h>
+ #if !defined(DGUX)
+-#if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE)
++#if (defined(SVR4) || defined(CRAY) || defined(AIXV3) || defined(linux)) && !defined(FD_SETSIZE)
+ #include <sys/select.h>
+ #ifdef luna
+ #include <sysent.h>
+--- XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/common/compiler.h.alpha-sockets     Mon Oct 19 16:39:32 1998
++++ XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/common/compiler.h   Mon Jan 11 12:28:22 1999
+@@ -161,53 +161,93 @@
+  * from linux/include/asm-alpha/unaligned.h
+  */
+-static __inline__ unsigned long ldq_u(unsigned long * r11)
+-{
++/*
++ * This is a silly but good way to make sure that
++ * the get/put functions are indeed always optimized,
++ * and that we use the correct sizes.
++ */
++extern void bad_unaligned_access_length(void);
++
++/*
++ * EGCS 1.1 knows about arbitrary unaligned loads.  Define some
++ * packed structures to talk about such things with.
++ */
++
++struct __una_u64 { unsigned long  x __attribute__((packed)); };
++struct __una_u32 { unsigned int   x __attribute__((packed)); };
++struct __una_u16 { unsigned short x __attribute__((packed)); };
++
++/*
++ * Elemental unaligned loads 
++ */
++
++extern __inline__ unsigned long ldq_u(const unsigned long * r11)
++{
++#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
++      const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
++      return ptr->x;
++#else
+       unsigned long r1,r2;
+       __asm__("ldq_u %0,%3\n\t"
+               "ldq_u %1,%4\n\t"
+               "extql %0,%2,%0\n\t"
+-              "extqh %1,%2,%1\n\t"
+-              "bis %1,%0,%0"
++              "extqh %1,%2,%1"
+               :"=&r" (r1), "=&r" (r2)
+               :"r" (r11),
+                "m" (*r11),
+-               "m" (*(unsigned long *)(7+(char *) r11)));
+-      return r1;
++               "m" (*(const unsigned long *)(7+(char *) r11)));
++      return r1 | r2;
++#endif
+ }
+-static __inline__ unsigned long ldl_u(unsigned int * r11)
++extern __inline__ unsigned long ldl_u(const unsigned int * r11)
+ {
++#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
++      const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
++      return ptr->x;
++#else
+       unsigned long r1,r2;
+       __asm__("ldq_u %0,%3\n\t"
+               "ldq_u %1,%4\n\t"
+               "extll %0,%2,%0\n\t"
+-              "extlh %1,%2,%1\n\t"
+-              "bis %1,%0,%0"
++              "extlh %1,%2,%1"
+               :"=&r" (r1), "=&r" (r2)
+               :"r" (r11),
+                "m" (*r11),
+-               "m" (*(unsigned long *)(3+(char *) r11)));
+-      return r1;
++               "m" (*(const unsigned long *)(3+(char *) r11)));
++      return r1 | r2;
++#endif
+ }
+-static __inline__ unsigned long ldw_u(unsigned short * r11)
++extern __inline__ unsigned long ldw_u(const unsigned short * r11)
+ {
++#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
++      const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
++      return ptr->x;
++#else
+       unsigned long r1,r2;
+       __asm__("ldq_u %0,%3\n\t"
+               "ldq_u %1,%4\n\t"
+               "extwl %0,%2,%0\n\t"
+-              "extwh %1,%2,%1\n\t"
+-              "bis %1,%0,%0"
++              "extwh %1,%2,%1"
+               :"=&r" (r1), "=&r" (r2)
+               :"r" (r11),
+                "m" (*r11),
+-               "m" (*(unsigned long *)(1+(char *) r11)));
+-      return r1;
++               "m" (*(const unsigned long *)(1+(char *) r11)));
++      return r1 | r2;
++#endif
+ }
+-static __inline__ void stq_u(unsigned long r5, unsigned long * r11)
+-{
++/*
++ * Elemental unaligned stores 
++ */
++
++extern __inline__ void stq_u(unsigned long r5, unsigned long * r11)
++{
++#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
++      struct __una_u64 *ptr = (struct __una_u64 *) r11;
++      ptr->x = r5;
++#else
+       unsigned long r1,r2,r3,r4;
+       __asm__("ldq_u %3,%1\n\t"
+@@ -224,10 +264,15 @@
+                "=m" (*(unsigned long *)(7+(char *) r11)),
+                "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+               :"r" (r5), "r" (r11));
++#endif
+ }
+-static __inline__ void stl_u(unsigned long r5, unsigned int * r11)
++extern __inline__ void stl_u(unsigned long r5, unsigned int * r11)
+ {
++#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
++      struct __una_u32 *ptr = (struct __una_u32 *) r11;
++      ptr->x = r5;
++#else
+       unsigned long r1,r2,r3,r4;
+       __asm__("ldq_u %3,%1\n\t"
+@@ -244,10 +289,15 @@
+                "=m" (*(unsigned long *)(3+(char *) r11)),
+                "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+               :"r" (r5), "r" (r11));
++#endif
+ }
+-static __inline__ void stw_u(unsigned long r5, unsigned short * r11)
++extern __inline__ void stw_u(unsigned long r5, unsigned short * r11)
+ {
++#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
++      struct __una_u16 *ptr = (struct __una_u16 *) r11;
++      ptr->x = r5;
++#else
+       unsigned long r1,r2,r3,r4;
+       __asm__("ldq_u %3,%1\n\t"
+@@ -264,6 +314,7 @@
+                "=m" (*(unsigned long *)(1+(char *) r11)),
+                "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+               :"r" (r5), "r" (r11));
++#endif
+ }
+ #define mem_barrier()        __asm__ __volatile__("mb"  : : : "memory")
+--- XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/common/xf86Summa.c.alpha-sockets    Mon Jan 11 12:28:16 1999
++++ XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/common/xf86Summa.c  Mon Jan 11 12:28:22 1999
+@@ -600,7 +600,7 @@
+       timeout.tv_sec = 0;
+       timeout.tv_usec = 200000;
+-      SYSCALL(err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout));
++      SYSCALL(err = select(fd+1, &readfds, NULL, NULL, &timeout));
+       if (err == -1) {
+           Error("SummaSketch select");
+           return NULL;
+--- XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/common/xf86Wacom.c.alpha-sockets    Mon Jan 11 12:28:16 1999
++++ XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/common/xf86Wacom.c  Mon Jan 11 12:28:23 1999
+@@ -692,7 +692,7 @@
+     
+     timeout.tv_sec = 1;
+     timeout.tv_usec = 0;
+-    SYSCALL(err = select(FD_SETSIZE, &readfds, NULL, NULL, &timeout));
++    SYSCALL(err = select(fd+1, &readfds, NULL, NULL, &timeout));
+     return err;
+ }
+--- XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/common/xf86_Mouse.c.alpha-sockets   Mon Jan 11 12:28:16 1999
++++ XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/common/xf86_Mouse.c Mon Jan 11 12:28:23 1999
+@@ -437,7 +437,7 @@
+             write(mouse->mseFd, s, 1);
+           FD_ZERO(&fds);
+           FD_SET(mouse->mseFd, &fds);
+-          if (select(FD_SETSIZE, &fds, NULL, NULL, NULL) <= 0)
++          if (select(mouse->mseFd+1, &fds, NULL, NULL, NULL) <= 0)
+             break;
+             read(mouse->mseFd, &c, 1);
+             if (c != *s)
+--- XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/common/xf86_PnPMouse.c.alpha-sockets        Mon Mar  2 05:23:21 1998
++++ XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/common/xf86_PnPMouse.c      Mon Jan 11 12:28:23 1999
+@@ -235,7 +235,7 @@
+     FD_SET(mouse->mseFd, &fds);
+     timeout.tv_sec = 0;
+     timeout.tv_usec = 200000;
+-    if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0) {
++    if (select(mouse->mseFd+1, &fds, NULL, NULL, &timeout) <= 0) {
+       /* port setup, 2nd phase (2.1.5) */
+         i = TIOCM_DTR | TIOCM_RTS;    /* DTR = 0, RTS = 0 */
+@@ -252,7 +252,7 @@
+         FD_SET(mouse->mseFd, &fds);
+         timeout.tv_sec = 0;
+         timeout.tv_usec = 200000;
+-        if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0)
++        if (select(mouse->mseFd+1, &fds, NULL, NULL, &timeout) <= 0)
+           goto connect_idle;
+     }
+ #else
+@@ -277,7 +277,7 @@
+     FD_SET(mouse->mseFd, &fds);
+     timeout.tv_sec = 0;
+     timeout.tv_usec = 200000;
+-    if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0)
++    if (select(mouse->mseFd+1, &fds, NULL, NULL, &timeout) <= 0)
+         goto connect_idle;
+ #endif
+@@ -302,7 +302,7 @@
+         FD_SET(mouse->mseFd, &fds);
+         timeout.tv_sec = 0;
+         timeout.tv_usec = 200000;
+-        if (select(FD_SETSIZE, &fds, NULL, NULL, &timeout) <= 0)
++        if (select(mouse->mseFd+1, &fds, NULL, NULL, &timeout) <= 0)
+           break;
+       read(mouse->mseFd, &buf[i], 1);
+--- XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/vga256/drivers/mga/mga_driver.c.alpha-sockets       Mon Jan 11 12:28:17 1999
++++ XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/vga256/drivers/mga/mga_driver.c     Mon Jan 11 12:28:23 1999
+@@ -1256,6 +1256,16 @@
+ MGASave(save)
+ vgaHWPtr save;
+ {
++#if NeedFunctionPrototypes
++      extern void *MGA3026Save(void*);
++      extern void *MGA1064Save(void*);
++      extern void *MGA200Save(void*);
++#else
++      extern void *MGA3026Save();
++      extern void *MGA1064Save();
++      extern void *MGA200Save();
++#endif
++
+       switch (MGAchipset)
+       {
+       case PCI_CHIP_MGA2064:
+--- XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/xaa/xf86bench.c.alpha-sockets       Mon Jan 11 12:28:19 1999
++++ XFree86-3.3.3.1/xc/programs/Xserver/hw/xfree86/xaa/xf86bench.c     Mon Jan 11 12:28:23 1999
+@@ -96,7 +96,7 @@
+     unsigned char *end;
+ #ifdef __alpha__
+     unsigned long data64;
+-    data64 = data | (data << 32);
++    data64 = (unsigned long)data | ((unsigned long)data << 32);
+ #endif
+     end = dest + nbytes;
+     while (dest <= end - 128) {
+--- XFree86-3.3.3.1/xc/programs/Xserver/include/os.h.alpha-sockets     Thu Jan 22 05:47:13 1998
++++ XFree86-3.3.3.1/xc/programs/Xserver/include/os.h   Mon Jan 11 12:28:23 1999
+@@ -773,4 +773,20 @@
+ /* stuff for FlushCallback */
+ extern CallbackListPtr FlushCallback;
++#ifdef LONG64
++
++/* Systems with 64-bit 'long' have their own quirks, like
++   select()'s fd_mask components are 64-bit long, but the
++   ffs() function works only on 'int', which at least at
++   an Alpha are 32-bit wide... */
++
++# define ffs mffs
++
++extern int mffs (
++#if NeedFunctionPrototypes
++               unsigned long
++#endif
++);
++#endif /* LONG64 */
++
+ #endif /* OS_H */
+--- XFree86-3.3.3.1/xc/programs/Xserver/os/WaitFor.c.alpha-sockets     Sat Oct 24 03:56:28 1998
++++ XFree86-3.3.3.1/xc/programs/Xserver/os/WaitFor.c   Mon Jan 11 12:28:23 1999
+@@ -83,9 +83,10 @@
+ #include "dixstruct.h"
+ #include "opaque.h"
+-/* modifications by raphael */
+-#define ffs mffs
+-int mffs(fd_mask mask) {
++/* modifications by raphael, and [mea];
++   system uses this if LONG64 is defined.
++   See at the end of the "os.h" */
++int mffs(unsigned long mask) {
+     register i;
+     if ( ! mask ) return 0;
+     i = 1;
+@@ -423,17 +424,18 @@
+     if (XFD_ANYSET (&clientsReadable))
+     {
+ #ifndef WIN32
+-      for (i=0; i<howmany(XFD_SETSIZE, NFDBITS); i++)
++      for (i=0;
++           i < (sizeof(clientsReadable)/sizeof(clientsReadable.fds_bits[0]));
++           i++)
+       {
+           int highest_priority;
+           while (clientsReadable.fds_bits[i])
+           {
+               int client_priority, client_index;
+-
+               curclient = ffs (clientsReadable.fds_bits[i]) - 1;
+-              client_index = /* raphael: modified */
+-                      ConnectionTranslation[curclient + (i * (sizeof(fd_mask) * 8))];
++              curclient += i * (8 * sizeof(fd_mask));
++              client_index = ConnectionTranslation[curclient];
+ #else
+       int highest_priority;
+       fd_set savedClientsReadable;
+@@ -476,11 +478,10 @@
+               {
+                   pClientsReady[nready++] = client_index;
+               }
++
++              FD_CLR(curclient, &clientsReadable);
+ #ifndef WIN32
+-              clientsReadable.fds_bits[i] &= ~(((fd_mask)1) << curclient);
+           }
+-#else
+-          FD_CLR(curclient, &clientsReadable);
+ #endif
+       }
+     }
+@@ -541,12 +542,13 @@
+           COPYBITS(ClientsWithInput, clientsReadable);
+           dbprintf(("WaitFor: "));
+           nready = 0;
+-          for (i=0; i < mskcnt; i++) {
++          for (i=0; i < mskcnt;i++) {
+               while (clientsReadable[i]) {
+                   int client_priority, curclient, client_index;
+                   curclient = ffs (clientsReadable[i]) - 1;
+-                  client_index = ConnectionTranslation[curclient + (i << 5)];
++                  curclient += i * (8 * sizeof(clientsReadable[i]));
++                  client_index = ConnectionTranslation[curclient];
+                   dbprintf(("%d has input\n", curclient));
+ #ifdef XSYNC
+                   client_priority = clients[client_index]->priority;
+@@ -794,7 +796,7 @@
+ {
+     OsTimerPtr timer;
+-    while (timer = timers)
++    while ((timer = timers))
+     {
+       timers = timer->next;
+       xfree(timer);
+--- XFree86-3.3.3.1/xc/programs/Xserver/os/connection.c.alpha-sockets  Mon Jan 11 12:28:20 1999
++++ XFree86-3.3.3.1/xc/programs/Xserver/os/connection.c        Mon Jan 11 12:28:23 1999
+@@ -178,10 +178,6 @@
+ #include <netdnet/dn.h>
+ #endif /* DNETCONN */
+-/* added by raphael */
+-#define ffs mffs
+-extern int mffs(long);
+-
+ extern char *display;         /* The display number */
+ int lastfdesc;                        /* maximum file descriptor */
+@@ -785,6 +781,8 @@
+ {
+ #ifndef WIN32
+     fd_mask readyconnections;     /* mask of listeners that are ready */
++    /* In UNIX environments we assume that all listeners fit into
++       the first 32 file descriptor ids. */
+ #else
+     fd_set  readyconnections;     /* set of listeners that are ready */
+ #endif
+@@ -981,9 +979,6 @@
+ void
+ CheckConnections()
+ {
+-#ifndef WIN32
+-    fd_mask           mask;
+-#endif
+     fd_set            tmask; 
+     register int      curclient, curoff;
+     int                       i;
+@@ -994,23 +989,24 @@
+ #endif
+ #ifndef AMOEBA
+-    notime.tv_sec = 0;
+-    notime.tv_usec = 0;
+-
+ #ifndef WIN32
+-    for (i=0; i<howmany(XFD_SETSIZE, NFDBITS); i++)
++    for (i=0; i < (sizeof(AllClients)/sizeof(fd_mask)); i++)
+     {
+-      mask = AllClients.fds_bits[i];
++      fd_mask mask = AllClients.fds_bits[i];
+         while (mask)
+       {
+           curoff = ffs (mask) - 1;
+-          curclient = curoff + (i << 5);
++          curclient = curoff + (i * 8 * sizeof(mask));
+             FD_ZERO(&tmask);
+             FD_SET(curclient, &tmask);
++          /* there are operating systems which *do* alter the timeout
++             variables -- it is good practice to initialize them always */
++          notime.tv_sec = 0;
++          notime.tv_usec = 0;
+             r = Select (curclient + 1, &tmask, NULL, NULL, &notime);
+             if (r < 0)
+               CloseDownClient(clients[ConnectionTranslation[curclient]]);
+-          mask &= ~(1 << curoff);
++          mask &= ~(((fd_mask)1) << curoff);
+       }
+     } 
+ #else
+--- XFree86-3.3.3.1/xc/programs/Xserver/os/io.c.alpha-sockets  Sat Oct 24 03:56:29 1998
++++ XFree86-3.3.3.1/xc/programs/Xserver/os/io.c        Mon Jan 11 12:28:23 1999
+@@ -85,10 +85,6 @@
+ #include "lbxserve.h"
+ #endif
+-/* added by raphael */
+-#define ffs mffs
+-extern int mffs(long);
+-
+ CallbackListPtr       ReplyCallback;
+ CallbackListPtr       FlushCallback;
+@@ -995,7 +991,7 @@
+     NewOutputPending = FALSE;
+ #ifndef WIN32
+-    for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++)
++    for (base = 0; base < (sizeof(OutputPending)/sizeof(fd_mask)); base++)
+     {
+       mask = OutputPending.fds_bits[ base ];
+       OutputPending.fds_bits[ base ] = 0;
+@@ -1003,7 +999,8 @@
+       {
+           index = ffs(mask) - 1;
+           mask &= ~lowbit(mask);
+-          if ((index = ConnectionTranslation[(base << 5) + index]) == 0)
++          index = ConnectionTranslation[ base * (8 * sizeof(mask)) + index ];
++          if (index == 0)
+               continue;
+           client = clients[index];
+           if (client->clientGone)
+--- XFree86-3.3.3.1/xc/programs/lbxproxy/include/os.h.alpha-sockets    Sat Dec 21 23:16:36 1996
++++ XFree86-3.3.3.1/xc/programs/lbxproxy/include/os.h  Mon Jan 11 12:28:23 1999
+@@ -243,4 +243,20 @@
+ #endif
+ );
++#ifdef LONG64
++
++/* Systems with 64-bit 'long' have their own quirks, like
++   select()'s fd_mask components are 64-bit long, but the
++   ffs() function works only on 'int', which at least at
++   an Alpha are 32-bit wide... */
++
++# define ffs mffs
++
++extern int mffs (
++#if NeedFunctionPrototypes
++               unsigned long
++#endif
++);
++#endif /* LONG64 */
++
+ #endif
+--- XFree86-3.3.3.1/xc/programs/lbxproxy/os/WaitFor.c.alpha-sockets    Sat Dec 21 23:16:30 1996
++++ XFree86-3.3.3.1/xc/programs/lbxproxy/os/WaitFor.c  Mon Jan 11 12:28:23 1999
+@@ -71,6 +71,20 @@
+ #include "osdep.h"
+ #include "os.h"
++/* modifications by raphael, and [mea];
++   system uses this if LONG64 is defined.
++   See at the end of the "os.h" */
++int mffs(unsigned long mask) {
++    register i;
++    if ( ! mask ) return 0;
++    i = 1;
++    while (! (mask & 1)) {
++              i++;
++              mask = mask >> 1;
++    }
++    return i;
++}
++
+ extern fd_set AllSockets;
+ extern fd_set AllClients;
+ extern fd_set LastSelectMask;
+@@ -192,17 +206,18 @@
+     nready = 0;
+     if (XFD_ANYSET(&clientsReadable))
+     {
+-      for (i=0; i<howmany(XFD_SETSIZE, NFDBITS); i++)
++      for (i=0; i < (sizeof(clientsReadable)/sizeof(fd_mask)); i++)
+       {
+           while (clientsReadable.fds_bits[i])
+           {
+                 int   client_index; 
+               curclient = ffs (clientsReadable.fds_bits[i]) - 1;
+-              client_index = ConnectionTranslation[curclient + (i << 5)];
+-              {
+-                  pClientsReady[nready++] = client_index;
+-              }
++              curclient += i * (8 * sizeof(fd_mask));
++              client_index = ConnectionTranslation[curclient];
++
++              pClientsReady[nready++] = client_index;
++
+               clientsReadable.fds_bits[i] &= ~(((fd_mask)1) << curclient);
+           }
+       }       
+--- XFree86-3.3.3.1/xc/programs/lbxproxy/os/connection.c.alpha-sockets Thu Nov  5 14:27:57 1998
++++ XFree86-3.3.3.1/xc/programs/lbxproxy/os/connection.c       Mon Jan 11 12:28:23 1999
+@@ -1746,7 +1746,7 @@
+     while (readyconnections) 
+     {
+       curconn = ffs (readyconnections) - 1;
+-      readyconnections &= ~(1 << curconn);
++      readyconnections &= ~(((fd_mask)1) << curconn);
+       if ((newconn = accept (curconn,
+                             (struct sockaddr *) NULL, 
+                             (int *)NULL)) < 0) 
+@@ -1905,19 +1905,19 @@
+     notime.tv_sec = 0;
+     notime.tv_usec = 0;
+-    for (i=0; i<howmany(XFD_SETSIZE, NFDBITS); i++)
++    for (i=0; i < (sizeof(AllClients)/sizeof(fd_mask)); i++)
+     {
+       mask = AllClients.fds_bits[i];
+         while (mask)
+       {
+           curoff = ffs (mask) - 1;
+-          curclient = curoff + (i << 5);
++          curclient = curoff + i * (8 * sizeof(mask));
+             FD_ZERO(&tmask);
+             FD_SET(curclient, &tmask);
+             r = Select (curclient + 1, &tmask, NULL, NULL, &notime);
+             if (r < 0)
+               CloseDownClient(clients[ConnectionTranslation[curclient]]);
+-          mask &= ~(1 << curoff);
++          mask &= ~(((fd_mask)1) << curoff);
+       }
+     } 
+ }
+--- XFree86-3.3.3.1/xc/programs/lbxproxy/os/io.c.alpha-sockets Wed Jan  1 22:02:48 1997
++++ XFree86-3.3.3.1/xc/programs/lbxproxy/os/io.c       Mon Jan 11 12:28:23 1999
+@@ -913,7 +913,8 @@
+ void
+ FlushAllOutput()
+ {
+-    register int index, base, mask;
++    register int index, base;
++    register fd_mask mask;
+     OsCommPtr oc;
+     register ClientPtr client;
+@@ -927,7 +928,7 @@
+      */
+     NewOutputPending = FALSE;
+-    for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++)
++    for (base = 0; base < (sizeof(OutputPending)/sizeof(mask)); base++)
+     {
+       mask = OutputPending.fds_bits[ base ];
+       OutputPending.fds_bits[ base ] = 0;
+@@ -935,7 +936,9 @@
+       {
+           index = ffs(mask) - 1;
+           mask &= ~lowbit(mask);
+-          if ((index = ConnectionOutputTranslation[(base << 5) + index]) == 0)
++          index += base * (8 * sizeof(mask));
++          index = ConnectionOutputTranslation[index];
++          if (index == 0)
+               continue;
+           client = clients[index];
+           if (client->clientGone)
+--- XFree86-3.3.3.1/xc/programs/xfs/include/os.h.alpha-sockets Fri Jan  5 08:21:30 1996
++++ XFree86-3.3.3.1/xc/programs/xfs/include/os.h       Mon Jan 11 12:28:23 1999
+@@ -94,4 +94,19 @@
+ extern int  ListCatalogues();
+ extern int  ListAlternateServers();
++#ifdef LONG64
++
++/* Systems with 64-bit 'long' have their own quirks, like
++   select()'s fd_mask components are 64-bit long, but the
++   ffs() function works only on 'int', which at least at
++   an Alpha are 32-bit wide... */
++
++# define ffs mffs
++
++extern int mffs (
++#if NeedFunctionPrototypes
++               unsigned long
++#endif
++);
++#endif /* LONG64 */
+ #endif                                /* _OS_H_ */
+--- XFree86-3.3.3.1/xc/programs/xfs/os/connection.c.alpha-sockets      Thu Nov  5 14:28:31 1998
++++ XFree86-3.3.3.1/xc/programs/xfs/os/connection.c    Mon Jan 11 12:28:23 1999
+@@ -325,6 +325,9 @@
+ /*
+  * accepts new connections
++ *
++ * This assumes that all sockets in *listen* mode are numbered
++ * something below 32!  (likely true..)
+  */
+ void
+ MakeNewConnections()
+@@ -495,15 +498,15 @@
+     struct timeval notime;
+     int         r;
+-    notime.tv_sec = 0;
+-    notime.tv_usec = 0;
+-
+     XFD_COPYSET(&AllClients, &mask);
+     for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) {
+       while (mask.fds_bits[i]) {
+-          curclient = ffs(mask.fds_bits[i]) - 1 + (i << 5);
++          curclient = ffs(mask.fds_bits[i]) - 1;
++          curclient += i * (8 * sizeof(mask.fds_bits[i]));
+           FD_ZERO(&tmask);
+           FD_SET(curclient, &tmask);
++          notime.tv_sec = 0;
++          notime.tv_usec = 0;
+           r = Select(curclient + 1, &tmask, NULL, NULL, &notime);
+           if (r < 0)
+               CloseDownClient(clients[ConnectionTranslation[curclient]]);
+--- XFree86-3.3.3.1/xc/programs/xfs/os/io.c.alpha-sockets      Thu May 29 10:01:08 1997
++++ XFree86-3.3.3.1/xc/programs/xfs/os/io.c    Mon Jan 11 12:28:23 1999
+@@ -69,6 +69,7 @@
+ #include      "X11/Xpoll.h"
+ #include      "osdep.h"
+ #include      "globals.h"
++#include      "os.h"
+ #ifdef X_NOT_STDC_ENV
+ extern int errno;
+@@ -530,13 +531,14 @@
+     NewOutputPending = FALSE;
+-    for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++) {
++    for (base = 0; base < (sizeof(OutputPending)/sizeof(mask)); base++) {
+       mask = OutputPending.fds_bits[base];
+       OutputPending.fds_bits[base] = 0;
+       while (mask) {
+           index = ffs(mask) - 1;
+           mask &= ~lowbit(mask);
+-          if ((index = ConnectionTranslation[(base << 5) + index]) == 0)
++          index += base * (8 * sizeof(mask));
++          if ((index = ConnectionTranslation[index]) == 0)
+               continue;
+           client = clients[index];
+           if (client->clientGone == CLIENT_GONE)
+--- XFree86-3.3.3.1/xc/programs/xfs/os/waitfor.c.alpha-sockets Sat Jan 18 02:02:48 1997
++++ XFree86-3.3.3.1/xc/programs/xfs/os/waitfor.c       Mon Jan 11 12:28:23 1999
+@@ -65,6 +65,21 @@
+ #include      "globals.h"
+ #include      "X11/Xpoll.h"
+ #include      "osdep.h"
++#include      "os.h"
++
++/* modifications by raphael, and [mea];
++   system uses this if LONG64 is defined.
++   See at the end of the "os.h" */
++int mffs(unsigned long mask) {
++    register i;
++    if ( ! mask ) return 0;
++    i = 1;
++    while (! (mask & 1)) {
++              i++;
++              mask = mask >> 1;
++    }
++    return i;
++}
+ #ifdef MINIX
+ #include <sys/nbio.h>
+@@ -208,10 +223,11 @@
+       if (current_time)       /* may not have been set */
+           current_time = GetTimeInMillis();
+-      for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) {
++      for (i = 0; i < (sizeof(clientsReadable)/sizeof(fd_mask)); i++) {
+           while (clientsReadable.fds_bits[i]) {
+               curclient = ffs(clientsReadable.fds_bits[i]) - 1;
+-              conn = ConnectionTranslation[curclient + (i << 5)];
++              curclient += i * (8 * sizeof(fd_mask));
++              conn = ConnectionTranslation[curclient];
+               FD_CLR (curclient, &clientsReadable);
+               client = clients[conn];
+               if (!client)
diff --git a/XFree86-fsstnd.patch b/XFree86-fsstnd.patch
new file mode 100644 (file)
index 0000000..a4c155d
--- /dev/null
@@ -0,0 +1,91 @@
+--- XFree86-3.3.2/xc/programs/Xserver/hw/xfree86/XF86Setup/phase5.tcl.fsstnd   Mon Mar 30 10:46:28 1998
++++ XFree86-3.3.2/xc/programs/Xserver/hw/xfree86/XF86Setup/phase5.tcl  Mon Mar 30 10:46:49 1998
+@@ -38,7 +38,7 @@
+       set devid [lindex $DeviceIDs $idx]
+         global Device_$devid
+         set server [set Device_${devid}(Server)]
+-      set linkname $Xwinhome/bin/X
++      set linkname /etc/X11/X
+       set lastlink $linkname
+       for {set nlinks 0} \
+               {[file exists $linkname] && [file type $linkname]=="link" \
+@@ -72,7 +72,7 @@
+           cd $linkdir
+           catch "unlink X" ret
+           if !$pc98 {
+-              if [catch "link $Xwinhome/bin/XF86_$server X" ret] {
++              if [catch "link ../../usr/X11R6/bin/XF86_$server X" ret] {
+                   mesg "Link creation failed!\n\
+                           You'll have to do it yourself" okay
+               } else {
+--- XFree86-3.3.2/xc/programs/Xserver/hw/xfree86/XF86Setup/Imakefile.fsstnd    Mon Mar 30 10:46:28 1998
++++ XFree86-3.3.2/xc/programs/Xserver/hw/xfree86/XF86Setup/Imakefile   Mon Mar 30 10:46:49 1998
+@@ -78,7 +78,7 @@
+  XCONFIG_DEFINES = $(EXT_DEFINES) -DXF86SETUP \
+                  '-DPROJECTROOT="$(PROJECTROOT)"' \
+-                 '-DSERVER_CONFIG_FILE="$(LIBDIR)/$(XCONFIGFILE)"'
++                 '-DSERVER_CONFIG_FILE="/etc/X11/$(XCONFIGFILE)"'
+  XF86SETUPLIBDIR = $(LIBDIR)/XF86Setup
+          DEFINES = -DCARD_DATABASE_FILE='"$(CARDDBFILE)"' \
+--- XFree86-3.3.2/xc/programs/Xserver/hw/xfree86/xf86config/xf86config.c.fsstnd        Mon Mar 30 10:46:36 1998
++++ XFree86-3.3.2/xc/programs/Xserver/hw/xfree86/xf86config/xf86config.c       Mon Mar 30 10:46:49 1998
+@@ -104,7 +104,7 @@
+ #endif
+ /*
+- * Define this to have /etc/XF86Config prompted for as the default
++ * Define this to have /etc/X11/XF86Config prompted for as the default
+  * location to write the XF86Config file to.
+  */
+ #define PREFER_XF86CONFIG_IN_ETC
+@@ -210,7 +210,7 @@
+ "This program will create a basic " CONFIGNAME " file, based on menu selections you\n"
+ "make.\n"
+ "\n"
+-"The " CONFIGNAME " file usually resides in " TREEROOTLX " or /etc. A sample\n"
++"The " CONFIGNAME " file usually resides in " TREEROOTLX " or /etc/X11. A sample\n"
+ CONFIGNAME " file is supplied with XFree86; it is configured for a standard\n"
+ "VGA card and monitor with 640x480 resolution. This program will ask for a\n"
+ "pathname when it is ready to write the file.\n"
+@@ -2827,11 +2827,11 @@
+ #ifndef __EMX__
+       if (getuid() == 0) {
+ #ifdef PREFER_XF86CONFIG_IN_ETC
+-              printf("Shall I write it to /etc/XF86Config? ");
++              printf("Shall I write it to /etc/X11/XF86Config? ");
+               getstring(s);
+               printf("\n");
+               if (answerisyes(s))
+-                      return "/etc/XF86Config";
++                      return "/etc/X11/XF86Config";
+ #endif
+               printf("Please answer the following question with either 'y' or 'n'.\n");
+@@ -2842,11 +2842,11 @@
+                       return "/usr/X11R6/lib/X11/XF86Config";
+ #ifndef PREFER_XF86CONFIG_IN_ETC
+-              printf("Shall I write it to /etc/XF86Config? ");
++              printf("Shall I write it to /etc/X11/XF86Config? ");
+               getstring(s);
+               printf("\n");
+               if (answerisyes(s))
+-                      return "/etc/XF86Config";
++                      return "/etc/X11/XF86Config";
+ #endif
+ #else /* __EMX__ */
+       {
+--- XFree86-3.3.2/xc/programs/Xserver/os/wrapper.c.fsstnd      Mon Mar 30 10:59:11 1998
++++ XFree86-3.3.2/xc/programs/Xserver/os/wrapper.c     Mon Mar 30 10:59:57 1998
+@@ -42,6 +42,9 @@
+ #define XSERVER_PATH  "/usr/X11R6/bin/X"
+ #endif
++#undef XSERVER_PATH
++#define XSERVER_PATH "/etc/X11/X"
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
diff --git a/XFree86-joy.patch b/XFree86-joy.patch
new file mode 100644 (file)
index 0000000..2b82491
--- /dev/null
@@ -0,0 +1,11 @@
+--- XFree86-3.3.3/xc/config/cf/xfree86.cf.joy  Mon Dec  7 15:50:14 1998
++++ XFree86-3.3.3/xc/config/cf/xfree86.cf      Mon Dec  7 15:50:36 1998
+@@ -684,7 +684,7 @@
+ #endif
+ #endif
+ #ifndef JoystickSupport
+-#define JoystickSupport               NO
++#define JoystickSupport               YES
+ #endif
+ /*
diff --git a/XFree86-ncurses.patch b/XFree86-ncurses.patch
new file mode 100644 (file)
index 0000000..d79c40f
--- /dev/null
@@ -0,0 +1,36 @@
+diff -u --recursive --new-file XFree86-3.3.2.3.macro/xc/config/cf/linux.cf XFree86-3.3.2.3/xc/config/cf/linux.cf
+--- XFree86-3.3.2.3.macro/xc/config/cf/linux.cf        Mon Mar  2 11:55:22 1998
++++ XFree86-3.3.2.3/xc/config/cf/linux.cf      Thu Aug 27 12:12:50 1998
+@@ -163,7 +163,7 @@
+ #define AsmDefines            -D__ELF__
+ #define CplusplusCmd          c++
+ #if UseStaticTermcapLib
+-#define TermcapLibrary                StaticLibrary(/usr/lib/termcap,termcap)
++#define TermcapLibrary                StaticLibrary(/usr/lib,ncurses)
+ #endif
+ #else
+ #ifdef AlphaArchitecture
+diff -u --recursive --new-file XFree86-3.3.2.3.macro/xc/config/cf/xf86site.def XFree86-3.3.2.3/xc/config/cf/xf86site.def
+--- XFree86-3.3.2.3.macro/xc/config/cf/xf86site.def    Mon Mar  2 11:55:22 1998
++++ XFree86-3.3.2.3/xc/config/cf/xf86site.def  Thu Aug 27 12:14:33 1998
+@@ -93,8 +93,8 @@
+  * Some Linux releases don't have a libtermcap.  In this case you may need
+  * to uncomment the following
+  *
+-#define TermcapLibrary                -lncurses
+  */
++#define TermcapLibrary                -lncurses
+ /*
+  * If you have Tk (which is required to build XF86Setup), uncomment this
+--- XFree86-3.3.3.1.new/xc/programs/xterm/Imakefile    Tue Mar 23 14:01:57 1999
++++ XFree86-3.3.3.1/xc/programs/xterm/Imakefile        Sat Oct 24 09:58:19 1998
+@@ -73,7 +73,7 @@
+                 -DOSMINORVERSION=$(OSMINORVERSION)
+    MISC_DEFINES = /* -DALLOWLOGGING -DALLOWLOGFILEEXEC */ 
+     XKB_DEFINES = XkbClientDefines
+-        DEFINES = -I. $(XKB_DEFINES) $(TERMCAPDEFINES) $(FEATURE_DEFINES) $(SCROLLBAR_RIGHT)
++        DEFINES = -I. -I/usr/include/ncurses $(XKB_DEFINES) $(TERMCAPDEFINES) $(FEATURE_DEFINES) $(SCROLLBAR_RIGHT)
+ #ifdef OS2Architecture
+           MAINSRC = os2main.c
diff --git a/XFree86-pam.patch b/XFree86-pam.patch
new file mode 100644 (file)
index 0000000..ff8106f
--- /dev/null
@@ -0,0 +1,170 @@
+--- XFree86-3.3.2/xc/programs/xdm/greeter/verify.c.nopam       Tue May 27 02:22:28 1997
++++ XFree86-3.3.2/xc/programs/xdm/greeter/verify.c     Tue Mar  3 17:15:17 1998
+@@ -41,6 +41,9 @@
+ # include     "dm.h"
+ # include     <pwd.h>
++#ifdef USE_PAM
++# include     <security/pam_appl.h>
++#else /* ! USE_PAM */
+ #ifdef USESHADOW
+ # include     <shadow.h>
+ #if defined(SHADOWSUITE) && defined(linux)
+@@ -51,6 +54,7 @@
+ extern int errno;
+ #endif
+ #endif
++#endif /* USE_PAM */
+ # include     "greet.h"
+@@ -104,6 +108,49 @@
+     return env;
+ }
++#ifdef USE_PAM
++static char *PAM_password;
++
++static int PAM_conv (int num_msg,
++                   const struct pam_message **msg,
++                   struct pam_response **resp,
++                   void *appdata_ptr) {
++      int replies = 0;
++      struct pam_response *reply = NULL;
++
++      reply = malloc(sizeof(struct pam_response));
++      if (!reply) return PAM_CONV_ERR;
++      #define COPY_STRING(s) (s) ? strdup(s) : NULL
++
++      for (replies = 0; replies < num_msg; replies++) {
++              switch (msg[replies]->msg_style) {
++              case PAM_PROMPT_ECHO_OFF:
++                      /* wants password */
++                      reply[replies].resp_retcode = PAM_SUCCESS;
++                      reply[replies].resp = COPY_STRING(PAM_password);
++                      break;
++              case PAM_TEXT_INFO:
++                      /* ignore the informational mesage */
++                      break;
++              case PAM_PROMPT_ECHO_ON:
++                      /* user name given to PAM already */
++                      /* fall through */
++              default:
++                      /* unknown or PAM_ERROR_MSG */
++                      free (reply);
++                      return PAM_CONV_ERR;
++              }
++      }
++      *resp = reply;
++      return PAM_SUCCESS;
++}
++
++static struct pam_conv PAM_conversation = {
++      &PAM_conv,
++      NULL
++};
++#endif
++
+ int
+ Verify (d, greet, verify)
+ struct display                *d;
+@@ -121,6 +168,10 @@
+ #endif
+       char            *shell, *home;
+       char            **argv;
++#ifdef USE_PAM
++      pam_handle_t *pamh;
++      int pam_error;
++#endif
+       Debug ("Verify %s ...\n", greet->name);
+       p = getpwnam (greet->name);
+@@ -131,6 +182,7 @@
+       } else {
+           user_pass = p->pw_passwd;
+       }
++#ifndef USE_PAM
+ #ifdef USESHADOW
+       errno = 0;
+       sp = getspnam(greet->name);
+@@ -153,6 +205,28 @@
+                       return 0;
+               } /* else: null passwd okay */
+       }
++#else /* USE_PAM */
++      #define PAM_BAIL if (pam_error != PAM_SUCCESS) { \
++         pam_end(pamh, 0); return 0; \
++       }
++      PAM_password = greet->password;
++      pam_error = pam_start("xdm", p->pw_name, &PAM_conversation, &pamh);
++      PAM_BAIL;
++      pam_error = pam_set_item(pamh, PAM_TTY, d->name);
++      PAM_BAIL;
++      pam_error = pam_authenticate(pamh, 0);
++      PAM_BAIL;
++      pam_error = pam_acct_mgmt(pamh, 0);
++      /* really should do password changing, but it doesn't fit well */
++      PAM_BAIL;
++      pam_error = pam_setcred(pamh, 0);
++      PAM_BAIL;
++      /* unfortunately, it's not clear at the moment how to do session
++       * management; it's possible, since xdm hangs around, but I don't
++       * see yet how to tear the sessions down.
++       */
++      pam_end(pamh, PAM_SUCCESS);
++#endif /* USE_PAM */
+       Debug ("verify succeeded\n");
+       bzero(user_pass, strlen(user_pass)); /* in case shadow password */
+       /* The password is passed to StartClient() for use by user-based
+--- XFree86-3.3.2/xc/programs/xdm/Imakefile.nopam      Tue Mar  3 17:15:13 1998
++++ XFree86-3.3.2/xc/programs/xdm/Imakefile    Wed Mar  4 10:14:36 1998
+@@ -18,6 +18,8 @@
+  * but not all NetBSD/Alpha systems have shared libraries, and
+  * it can't be shared on those which do not.
+  */
++
++/* Don't use this with PAM 
+ #ifndef SharedLibXdmGreet
+ #define SharedLibXdmGreet                                             \
+     ((defined(AlphaArchitecture) &&                                   \
+@@ -29,11 +31,23 @@
+ #ifndef BuildBoth
+ #define BuildBoth (defined(LinuxArchitecture) && !SharedLibXdmGreet && !UseElfFormat)
+ #endif
++*/
++
++/* this is a hack */
+ #ifndef LinuxShadowSuite
+ #define LinuxShadowSuite NO
+ #endif
++#ifdef BuildBoth
++#undef BuildBoth
++#define BuildBoth 0
++#endif
++
++#ifdef SharedLibXdmGreet
++#undef SharedLibXdmGreet
++#endif
++
+ #if HasXdmAuth
+ XDMAUTH_DEFINES = -DHASXDMAUTH
+ XDMAUTHOBJS = xdmauth.o
+@@ -133,7 +147,7 @@
+ INCLUDES = $(KRB5_INCLUDE)
+ DEPLIBS = $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) $(DEPXAUTHLIB) $(DEPXDMCPLIB)
+-LOCAL_LIBRARIES = $(XMULIB) $(XTOOLLIB) $(XLIB) $(XAUTHLIB) $(XDMCPLIB) $(RPCLIB) $(DLLIBRARY) $(CRYPT_LIBRARIES)
++LOCAL_LIBRARIES = $(XMULIB) $(XTOOLLIB) $(XLIB) $(XAUTHLIB) $(XDMCPLIB) $(RPCLIB) -lpam -ldl $(CRYPT_LIBRARIES)
+           SRCS1 = auth.c daemon.c server.c dpylist.c dm.c error.c file.c \
+                 netaddr.c reset.c resource.c protodpy.c policy.c \
+@@ -182,6 +196,7 @@
+  OSMAJORVERSION = OSMajorVersion
+  OSMINORVERSION = OSMinorVersion
+    CONN_DEFINES = $(CONNECTION_FLAGS)
++  EXTRA_DEFINES = -DUSE_PAM
+         DEFINES = -DBINDIR=\"$(BINDIR)\" -DXDMDIR=\"$(XDMDIR)\" \
+               $(SIGNAL_DEFINES) \
+               $(XDMAUTH_DEFINES) $(RPC_DEFINES) $(KRB5_DEFINES) \
diff --git a/XFree86-ru_SU.patch b/XFree86-ru_SU.patch
new file mode 100644 (file)
index 0000000..af05616
--- /dev/null
@@ -0,0 +1,14 @@
+--- XFree86-3.3.3.1/xc/nls/locale.alias.ru_SU  Tue Jan 26 15:58:06 1999
++++ XFree86-3.3.3.1/xc/nls/locale.alias        Tue Jan 26 16:00:01 1999
+@@ -214,9 +214,9 @@
+ ru                                            ru_RU.ISO8859-5
+ ru_RU                                         ru_RU.ISO8859-5
+ ru_RU.iso88595                                        ru_RU.ISO8859-5
+-ru_SU                                         ru_RU.ISO8859-5
++ru_SU                                         ru_RU.KOI8-R
++ru_SU.KOI8-R                                  ru_RU.KOI8-R
+ ru_SU.ISO8859-5                                       ru_RU.ISO8859-5
+-ru_SU.KOI8-R                                  ru_RU.KOI8-R
+ sh                                            sh_YU.ISO8859-2
+ sh_HR.iso88592                                        sh_HR.ISO8859-2
+ sh_YU                                         sh_YU.ISO8859-2
diff --git a/XFree86-xfsredhat.patch b/XFree86-xfsredhat.patch
new file mode 100644 (file)
index 0000000..2b3efaa
--- /dev/null
@@ -0,0 +1,157 @@
+--- XFree86-3.3.3.1/xc/programs/xfs/difs/fonts.c.xfsredhat     Fri Jan  5 08:21:27 1996
++++ XFree86-3.3.3.1/xc/programs/xfs/difs/fonts.c       Wed Feb 17 12:03:19 1999
+@@ -118,6 +118,113 @@
+ }
+ /*
++ * xf86GetPathElem --
++ *      Extract a single element from the font path string starting at
++ *      pnt.  The font path element will be returned, and pnt will be
++ *      updated to point to the start of the next element, or set to
++ *      NULL if there are no more.
++ */
++char *
++xf86GetPathElem(pnt)
++     char **pnt;
++{
++  char *p1;
++ 
++  p1 = *pnt;
++  *pnt = index(*pnt, ',');
++  if (*pnt != NULL) {
++    **pnt = '\0';
++    *pnt += 1;
++  }
++  return(p1);
++}
++
++/*
++ * xf86ValidateFontPath --
++ *      Validates the user-specified font path.  Each element that
++ *      begins with a '/' is checked to make sure the directory exists.
++ *      If the directory exists, the existence of a file named 'fonts.dir'
++ *      is checked.  If either check fails, an error is printed and the
++ *      element is removed from the font path.
++ */
++#define DIR_FILE "/fonts.dir"
++#define CHECK_TYPE(mode, type) ((S_IFMT & (mode)) == (type))
++static char *
++xf86ValidateFontPath(path)
++     char *path;
++{
++  char *tmp_path, *out_pnt, *path_elem, *next, *p1, *dir_elem;
++  struct stat stat_buf;
++  int flag;
++  int dirlen;
++ 
++  tmp_path = (char *)calloc(1,strlen(path)+1);
++  out_pnt = tmp_path;
++  path_elem = NULL;
++  next = path;
++  while (next != NULL) {
++    path_elem = xf86GetPathElem(&next);
++#ifndef __EMX__
++    if (*path_elem == '/') {
++      dir_elem = (char *)calloc(1, strlen(path_elem) + 1);
++      if ((p1 = strchr(path_elem, ':')) != 0)
++#else
++    /* OS/2 must prepend X11ROOT */
++    if (*path_elem == '/') {
++      path_elem = (char*)__XOS2RedirRoot(path_elem);
++      dir_elem = (char*)calloc(1, strlen(path_elem) + 1);
++      if (p1 = strchr(path_elem+2, ':'))
++#endif
++        dirlen = p1 - path_elem;
++      else
++        dirlen = strlen(path_elem);
++      strncpy(dir_elem, path_elem, dirlen);
++      dir_elem[dirlen] = '\0';
++      flag = stat(dir_elem, &stat_buf);
++      if (flag == 0)
++        if (!CHECK_TYPE(stat_buf.st_mode, S_IFDIR))
++          flag = -1;
++      if (flag != 0) {
++      printf("warning!\n");
++      ErrorF("Warning: The directory \"%s\" does not exist.\n", dir_elem);
++      ErrorF("         Entry deleted from font path.\n");
++        continue;
++      }
++      else {
++        p1 = (char *)malloc(strlen(dir_elem)+strlen(DIR_FILE)+1);
++        strcpy(p1, dir_elem);
++        strcat(p1, DIR_FILE);
++        flag = stat(p1, &stat_buf);
++        if (flag == 0)
++          if (!CHECK_TYPE(stat_buf.st_mode, S_IFREG))
++            flag = -1;
++#ifndef __EMX__
++        free(p1);
++#endif
++        if (flag != 0) {
++        ErrorF("Warning: 'fonts.dir' not found (or not valid) in \"%s\".\n",
++                 dir_elem);
++          ErrorF("          Entry deleted from font path.\n");
++          ErrorF("          (Run 'mkfontdir' on \"%s\").\n", dir_elem);
++          continue;
++        }
++      }
++      free(dir_elem);
++    }
++ 
++    /*
++     * Either an OK directory, or a font server name.  So add it to
++     * the path.
++     */
++    if (out_pnt != tmp_path)
++      *out_pnt++ = ',';
++    strcat(out_pnt, path_elem);
++    out_pnt += strlen(path_elem);
++  }
++  return(tmp_path);
++}
++
++/*
+  * note that the font wakeup queue is not refcounted.  this is because
+  * an fpe needs to be added when it's inited, and removed when it's finally
+  * freed, in order to handle any data that isn't requested, like FS events.
+@@ -753,8 +860,12 @@
+                *end,
+                *p;
+     int         err;
++    char       *fixedpath;
++
++    fixedpath = xf86ValidateFontPath(str);
+-    len = strlen(str) + 1;
++    len = strlen(fixedpath) + 1;
++    str = fixedpath;
+     paths = p = (char *) ALLOCATE_LOCAL(len);
+     npaths = 0;
+@@ -774,6 +885,7 @@
+     err = set_font_path_elements(npaths, paths, badpath);
++    free(fixedpath);
+     DEALLOCATE_LOCAL(paths);
+     return err;
+--- XFree86-3.3.3.1/xc/programs/xfs/difs/main.c.xfsredhat      Thu Nov  5 14:28:29 1998
++++ XFree86-3.3.3.1/xc/programs/xfs/difs/main.c        Wed Feb 17 17:08:27 1999
+@@ -58,6 +58,7 @@
+ #include      "servermd.h"
+ #include      "cache.h"
+ #include      "site.h"
++#include <unistd.h>
+ char       *ConnectionInfo;
+ int         ConnInfoLen;
+@@ -107,6 +108,8 @@
+       ErrorF("fatal: couldn't read config file\n");
+       exit(1);
+     }
++
++    daemon(0, 0);
+     while (1) {
+       serverGeneration++;
This page took 0.101261 seconds and 4 git commands to generate.