home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sources / x / 429 < prev    next >
Encoding:
Text File  |  1992-07-28  |  51.7 KB  |  1,775 lines

  1. Newsgroups: comp.sources.x
  2. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!mips!msi!dcmartin
  3. From: Donna Converse <converse@expo.lcs.mit.edu>
  4. Subject: v18i060: X11R5 public fix #14, Part01/02
  5. Message-ID: <csx-18i060-X11R5-fix14@uunet.UU.NET>
  6. Originator: dcmartin@fascet
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. Date: Tue, 28 Jul 1992 21:50:27 GMT
  10. Approved: dcmartin@msi.com
  11. Lines: 1762
  12.  
  13. Submitted-by: Donna Converse <converse@expo.lcs.mit.edu>
  14. Posting-number: Volume 18, Issue 60
  15. Archive-name: X11R5-fix14/part01
  16.  
  17. Fix 14 corrects the following problems:
  18.  
  19. An enhancement to Xlib for the X Consortium's Xlib and X Protocol Test Suite:
  20. the test suite can now use the internal interface _XConnectDisplay to obtain
  21. raw connections to the X server, thus allowing maximum portable protocol test
  22. coverage.  In order to ensure this coverage, set XP_OPEN_DIS to XlibXtst.c
  23. when configuring the Xlib and X Protocol Test Suite.
  24.  
  25. Xlib: IO error during connect may dereference NULL
  26. Xlib: duplicate free() in XCloseDisplay from IO error handler
  27. Xlib: could use better _XConnectDisplay interface for test suite
  28. Xlib: XCloseDisplay does not free memory
  29. Xlib: endian definition is missing when compiling XConnDis.c for OSF1
  30. Xlib and Xt: LATIN2 keysyms are not handled correctly in ConvertCase
  31. Xlib and Xt: Latin-3 case converter
  32. Xt: XIM w/ keycode 0 (as defined by Xlib I18N) does not work with Xt
  33. Xt: XtCreateWidget errs when parent is an Object, not a Widget
  34. Xt: SetValues on TopLevelShell's iconic resource when popped_up is True
  35. Xt: set values on iconic resource should not affect initialState
  36. Xt: identifyWindows hack clobbers real information
  37. Xt: frees memory returned by Xlib with Xt interface
  38. Xt: unintentional reference inside Display structure
  39. Xt: geometry requests with SetValues 
  40. Xt: release of passive grab not recognized
  41. Xt: XtOpenDisplay ignores -name when appl_name parameter is present
  42. Xt: XtOpenDisplay should check that argv[0] isn't the empty string
  43. Xt: XtCloseDisplay frees NULL per-display keysyms
  44. Xext: XShmPutImage missing gc update
  45. fonts: missing copyright for Bitstream Courier Speedo fonts
  46.  
  47. #!/bin/sh
  48. # This is a shell archive (produced by shar 3.50)
  49. # To extract the files from this archive, save it to a file, remove
  50. # everything above the "!/bin/sh" line above, and type "sh file_name".
  51. #
  52. # made 07/28/1992 21:47 UTC by dcmartin@fascet
  53. # Source directory /n/merlin/u2/src/X11R5/fixes
  54. #
  55. # existing files will NOT be overwritten unless -c is specified
  56. #
  57. # This is part 1 of a multipart archive                                    
  58. # do not concatenate these parts, unpack them in order with /bin/sh        
  59. #
  60. # This shar contains:
  61. # length  mode       name
  62. # ------ ---------- ------------------------------------------
  63. #  66153 -rw-r--r-- fix-14
  64. #
  65. if test -r _shar_seq_.tmp; then
  66.     echo 'Must unpack archives in sequence!'
  67.     echo Please unpack part `cat _shar_seq_.tmp` next
  68.     exit 1
  69. fi
  70. # ============= fix-14 ==============
  71. if test -f 'fix-14' -a X"$1" != X"-c"; then
  72.     echo 'x - skipping fix-14 (File already exists)'
  73.     rm -f _shar_wnt_.tmp
  74. else
  75. > _shar_wnt_.tmp
  76. echo 'x - extracting fix-14 (Text)'
  77. sed 's/^X//' << 'SHAR_EOF' > 'fix-14' &&
  78. X                      Release 5 Public Patch #14
  79. X                           MIT X Consortium
  80. X
  81. To apply this patch:
  82. X
  83. cd to the top of the source tree (to the directory containing the "mit"
  84. and "contrib" subdirectories) and do:
  85. X        patch -p -s < ThisFile
  86. Patch will work silently unless an error occurs.
  87. If you want to watch patch do its thing, leave out the "-s" argument to patch.
  88. X
  89. Finally, to rebuild after applying this patch, cd to the "mit" subdirectory
  90. and do:
  91. X        make -k >& make.log
  92. X
  93. X
  94. Brief notes on what this patch fixes:
  95. X
  96. An enhancement to Xlib for the X Consortium's Xlib and X Protocol Test Suite:
  97. the test suite can now use the internal interface _XConnectDisplay to obtain
  98. raw connections to the X server, thus allowing maximum portable protocol test
  99. coverage.  In order to ensure this coverage, set XP_OPEN_DIS to XlibXtst.c
  100. when configuring the Xlib and X Protocol Test Suite.
  101. X
  102. XXlib: IO error during connect may dereference NULL
  103. XXlib: duplicate free() in XCloseDisplay from IO error handler
  104. XXlib: could use better _XConnectDisplay interface for test suite
  105. XXlib: XCloseDisplay does not free memory
  106. XXlib: endian definition is missing when compiling XConnDis.c for OSF1
  107. XXlib and Xt: LATIN2 keysyms are not handled correctly in ConvertCase
  108. XXlib and Xt: Latin-3 case converter
  109. XXt: XIM w/ keycode 0 (as defined by Xlib I18N) does not work with Xt
  110. XXt: XtCreateWidget errs when parent is an Object, not a Widget
  111. XXt: SetValues on TopLevelShell's iconic resource when popped_up is True
  112. XXt: set values on iconic resource should not affect initialState
  113. XXt: identifyWindows hack clobbers real information
  114. XXt: frees memory returned by Xlib with Xt interface
  115. XXt: unintentional reference inside Display structure
  116. XXt: geometry requests with SetValues 
  117. XXt: release of passive grab not recognized
  118. XXt: XtOpenDisplay ignores -name when appl_name parameter is present
  119. XXt: XtOpenDisplay should check that argv[0] isn't the empty string
  120. XXt: XtCloseDisplay frees NULL per-display keysyms
  121. XXext: XShmPutImage missing gc update
  122. fonts: missing copyright for Bitstream Courier Speedo fonts
  123. X
  124. X
  125. Prereq: public-patch-13
  126. X
  127. *** /tmp/da4676    Thu Jul 23 17:28:01 1992
  128. --- mit/bug-report    Thu Jul 23 17:28:00 1992
  129. ***************
  130. *** 2,8 ****
  131. X  Subject: [area]: [synopsis]   [replace with actual area and short description]
  132. X  
  133. X  VERSION:
  134. !     R5, public-patch-13
  135. X      [MIT public patches will edit this line to indicate the patch level]
  136. X  
  137. X  CLIENT MACHINE and OPERATING SYSTEM:
  138. --- 2,8 ----
  139. X  Subject: [area]: [synopsis]   [replace with actual area and short description]
  140. X  
  141. X  VERSION:
  142. !     R5, public-patch-14
  143. X      [MIT public patches will edit this line to indicate the patch level]
  144. X  
  145. X  CLIENT MACHINE and OPERATING SYSTEM:
  146. *** /tmp/,RCSt1a12623    Wed Jul 22 16:13:32 1992
  147. --- mit/lib/X/XClDisplay.c    Wed Jul 22 16:13:32 1992
  148. ***************
  149. *** 1,4 ****
  150. ! /* $XConsortium: XClDisplay.c,v 11.22 90/12/09 16:27:45 rws Exp $ */
  151. X  /*
  152. X  
  153. X  Copyright 1985, 1990 by the Massachusetts Institute of Technology
  154. --- 1,4 ----
  155. ! /* $XConsortium: XClDisplay.c,v 11.24 91/12/19 18:06:28 rws Exp $ */
  156. X  /*
  157. X  
  158. X  Copyright 1985, 1990 by the Massachusetts Institute of Technology
  159. ***************
  160. *** 19,27 ****
  161. X  
  162. X  /* 
  163. X   * XCloseDisplay - XSync the connection to the X Server, close the connection,
  164. !  * and free all associated storage.  This is the only routine that can be
  165. !  * called from or after an IOError handler, so the lower levels need to be able
  166. !  * to deal with broken connections.  Extension close procs should only free
  167. X   * memory and must be careful about the types of requests they generate.
  168. X   */
  169. X  
  170. --- 19,25 ----
  171. X  
  172. X  /* 
  173. X   * XCloseDisplay - XSync the connection to the X Server, close the connection,
  174. !  * and free all associated storage.  Extension close procs should only free
  175. X   * memory and must be careful about the types of requests they generate.
  176. X   */
  177. X  
  178. ***************
  179. *** 32,54 ****
  180. X      register int i;
  181. X      extern void _XFreeQ();
  182. X  
  183. !     dpy->flags |= XlibDisplayClosing;
  184. !     for (i = 0; i < dpy->nscreens; i++) {
  185. !         register Screen *sp = &dpy->screens[i];
  186. !         XFreeGC (dpy, sp->default_gc);
  187. X      }
  188. -     if (dpy->cursor_font != None) {
  189. -         XUnloadFont (dpy, dpy->cursor_font);
  190. -     }
  191. -     XSync(dpy, 1);  /* throw away pending input events */
  192. -     ext = dpy->ext_procs;
  193. -     while (ext) {        /* call out to any extensions interested */
  194. -         if (ext->close_display != NULL) 
  195. -             (*ext->close_display)(dpy, &ext->codes);
  196. -         ext = ext->next;
  197. -     }    
  198. -         LockDisplay(dpy);
  199. X      _XDisconnectDisplay(dpy->fd);
  200. X      _XFreeQ ();
  201. X      return;
  202. X  }
  203. --- 30,55 ----
  204. X      register int i;
  205. X      extern void _XFreeQ();
  206. X  
  207. !     if (!(dpy->flags & XlibDisplayClosing))
  208. !     {
  209. !         dpy->flags |= XlibDisplayClosing;
  210. !         for (i = 0; i < dpy->nscreens; i++) {
  211. !             register Screen *sp = &dpy->screens[i];
  212. !             XFreeGC (dpy, sp->default_gc);
  213. !         }
  214. !         if (dpy->cursor_font != None) {
  215. !         XUnloadFont (dpy, dpy->cursor_font);
  216. !         }
  217. !         ext = dpy->ext_procs;
  218. !         while (ext) {    /* call out to any extensions interested */
  219. !             if (ext->close_display != NULL) 
  220. !                 (*ext->close_display)(dpy, &ext->codes);
  221. !             ext = ext->next;
  222. !         }    
  223. !         XSync(dpy, 1);  /* throw away pending input events */
  224. X      }
  225. X      _XDisconnectDisplay(dpy->fd);
  226. +     _XFreeDisplayStructure (dpy);
  227. X      _XFreeQ ();
  228. X      return;
  229. X  }
  230. *** /tmp/,RCSt1a12630    Wed Jul 22 16:13:34 1992
  231. --- mit/lib/X/XConnDis.c    Wed Jul 22 16:13:34 1992
  232. ***************
  233. *** 1,5 ****
  234. X  /*
  235. !  * $XConsortium: XConnDis.c,v 11.86 91/09/09 18:54:35 rws Exp $
  236. X   *
  237. X   * Copyright 1989 Massachusetts Institute of Technology
  238. X   *
  239. --- 1,5 ----
  240. X  /*
  241. !  * $XConsortium: XConnDis.c,v 11.88 91/12/17 17:55:57 rws Exp $
  242. X   *
  243. X   * Copyright 1989 Massachusetts Institute of Technology
  244. X   *
  245. ***************
  246. *** 58,63 ****
  247. --- 58,64 ----
  248. X  extern int _XMakeStreamsConnection();
  249. X  #endif
  250. X  
  251. + static void GetAuthorization();
  252. X  
  253. X  static char *copystring (src, len)
  254. X      char *src;
  255. ***************
  256. *** 91,105 ****
  257. X   *     o  TCP to local host
  258. X   */
  259. X  int _XConnectDisplay (display_name, fullnamep, dpynump, screenp,
  260. !               familyp, saddrlenp, saddrp)
  261. X      char *display_name;
  262. X      char **fullnamep;            /* RETURN */
  263. X      int *dpynump;            /* RETURN */
  264. X      int *screenp;            /* RETURN */
  265. !     int *familyp;            /* RETURN */
  266. !     int *saddrlenp;            /* RETURN */
  267. !     char **saddrp;            /* RETURN, freed by caller */
  268. X  {
  269. X      char *lastp, *p;            /* char pointers */
  270. X      char *phostname = NULL;        /* start of host of display */
  271. X      char *pdpynum = NULL;        /* start of dpynum of display */
  272. --- 92,110 ----
  273. X   *     o  TCP to local host
  274. X   */
  275. X  int _XConnectDisplay (display_name, fullnamep, dpynump, screenp,
  276. !               auth_namep, auth_namelenp, auth_datap, auth_datalenp)
  277. X      char *display_name;
  278. X      char **fullnamep;            /* RETURN */
  279. X      int *dpynump;            /* RETURN */
  280. X      int *screenp;            /* RETURN */
  281. !     char **auth_namep;            /* RETURN */
  282. !     int *auth_namelenp;            /* RETURN */
  283. !     char **auth_datap;            /* RETURN */
  284. !     int *auth_datalenp;            /* RETURN */
  285. X  {
  286. +     int family;
  287. +     int saddrlen;
  288. +     char *saddr;
  289. X      char *lastp, *p;            /* char pointers */
  290. X      char *phostname = NULL;        /* start of host of display */
  291. X      char *pdpynum = NULL;        /* start of dpynum of display */
  292. ***************
  293. *** 113,120 ****
  294. X  
  295. X      p = display_name;
  296. X  
  297. !     *saddrlenp = 0;            /* set so that we can clear later */
  298. !     *saddrp = NULL;
  299. X  
  300. X      /*
  301. X       * Step 1, find the hostname.  This is delimited by the required 
  302. --- 118,125 ----
  303. X  
  304. X      p = display_name;
  305. X  
  306. !     saddrlen = 0;            /* set so that we can clear later */
  307. !     saddr = NULL;
  308. X  
  309. X      /*
  310. X       * Step 1, find the hostname.  This is delimited by the required 
  311. ***************
  312. *** 250,263 ****
  313. X      char hostnamebuf[256];
  314. X      int len = _XGetHostname (hostnamebuf, sizeof hostnamebuf);
  315. X  
  316. !     *familyp = FamilyLocal;
  317. X      if (len > 0) {
  318. !         *saddrp = Xmalloc (len + 1);
  319. !         if (*saddrp) {
  320. !         strcpy (*saddrp, hostnamebuf);
  321. !         *saddrlenp = len;
  322. X          } else {
  323. !         *saddrlenp = 0;
  324. X          }
  325. X      }
  326. X      }
  327. --- 255,268 ----
  328. X      char hostnamebuf[256];
  329. X      int len = _XGetHostname (hostnamebuf, sizeof hostnamebuf);
  330. X  
  331. !     family = FamilyLocal;
  332. X      if (len > 0) {
  333. !         saddr = Xmalloc (len + 1);
  334. !         if (saddr) {
  335. !         strcpy (saddr, hostnamebuf);
  336. !         saddrlen = len;
  337. X          } else {
  338. !         saddrlen = 0;
  339. X          }
  340. X      }
  341. X      }
  342. ***************
  343. *** 272,278 ****
  344. X       * too many times).
  345. X       */
  346. X      if ((fd = (*connfunc) (phostname, idisplay, X_CONNECTION_RETRIES,
  347. !                familyp, saddrlenp, saddrp)) < 0)
  348. X        goto bad;
  349. X      if (fd >= OPEN_MAX)
  350. X      goto bad;
  351. --- 277,283 ----
  352. X       * too many times).
  353. X       */
  354. X      if ((fd = (*connfunc) (phostname, idisplay, X_CONNECTION_RETRIES,
  355. !                &family, &saddrlen, &saddr)) < 0)
  356. X        goto bad;
  357. X      if (fd >= OPEN_MAX)
  358. X      goto bad;
  359. ***************
  360. *** 306,311 ****
  361. --- 311,319 ----
  362. X      if (phostname) Xfree (phostname);
  363. X      if (pdpynum) Xfree (pdpynum);
  364. X      if (pscrnum) Xfree (pscrnum);
  365. +     GetAuthorization(fd, family, saddr, saddrlen, idisplay,
  366. +              auth_namep, auth_namelenp, auth_datap, auth_datalenp);
  367. X      return fd;
  368. X  
  369. X  
  370. ***************
  371. *** 314,324 ****
  372. X       */
  373. X    bad:
  374. X      if (fd >= 0) (void) close (fd);
  375. !     if (*saddrp) {
  376. !     Xfree (*saddrp);
  377. !     *saddrp = NULL;
  378. !     }
  379. !     *saddrlenp = 0;
  380. X      if (phostname) Xfree (phostname);
  381. X      if (pdpynum) Xfree (pdpynum);
  382. X      if (pscrnum) Xfree (pscrnum);
  383. --- 322,328 ----
  384. X       */
  385. X    bad:
  386. X      if (fd >= 0) (void) close (fd);
  387. !     if (saddr) Xfree (saddr);
  388. X      if (phostname) Xfree (phostname);
  389. X      if (pdpynum) Xfree (pdpynum);
  390. X      if (pscrnum) Xfree (pscrnum);
  391. ***************
  392. *** 358,363 ****
  393. --- 362,370 ----
  394. X  #endif
  395. X  #endif
  396. X  #ifndef NO_TCP_H
  397. + #ifdef __OSF1__
  398. + #include <sys/param.h>
  399. + #endif
  400. X  #include <netinet/tcp.h>
  401. X  #endif
  402. X  #endif /* NEED_BSDISH */
  403. ***************
  404. *** 421,426 ****
  405. --- 428,434 ----
  406. X  #ifdef UNIXCONN
  407. X  #include <sys/un.h>
  408. X  
  409. + /*ARGSUSED*/
  410. X  static int MakeUNIXSocketConnection (phostname, idisplay, retries,
  411. X                       familyp, saddrlenp, saddrp)
  412. X      char *phostname;
  413. ***************
  414. *** 670,677 ****
  415. X  
  416. X  
  417. X  
  418. - #undef NULL
  419. - #define NULL ((char *) 0)
  420. X  /*
  421. X   * This is an OS dependent routine which:
  422. X   * 1) returns as soon as the connection can be written on....
  423. --- 678,683 ----
  424. ***************
  425. *** 693,699 ****
  426. X          BITSET(w_mask, dpy->fd);
  427. X  
  428. X      do {
  429. !         nfound = select (dpy->fd + 1, r_mask, w_mask, NULL, NULL);
  430. X          if (nfound < 0 && errno != EINTR)
  431. X          _XIOError(dpy);
  432. X      } while (nfound <= 0);
  433. --- 699,706 ----
  434. X          BITSET(w_mask, dpy->fd);
  435. X  
  436. X      do {
  437. !         nfound = select (dpy->fd + 1, r_mask, w_mask,
  438. !                  (char *)NULL, (char *)NULL);
  439. X          if (nfound < 0 && errno != EINTR)
  440. X          _XIOError(dpy);
  441. X      } while (nfound <= 0);
  442. ***************
  443. *** 746,752 ****
  444. X      CLEARBITS(r_mask);
  445. X      do {
  446. X      BITSET(r_mask, dpy->fd);
  447. !     result = select(dpy->fd + 1, r_mask, NULL, NULL, NULL);
  448. X      if (result == -1 && errno != EINTR) _XIOError(dpy);
  449. X      } while (result <= 0);
  450. X  }
  451. --- 753,760 ----
  452. X      CLEARBITS(r_mask);
  453. X      do {
  454. X      BITSET(r_mask, dpy->fd);
  455. !     result = select(dpy->fd + 1, r_mask,
  456. !             (char *)NULL, (char *)NULL, (char *)NULL);
  457. X      if (result == -1 && errno != EINTR) _XIOError(dpy);
  458. X      } while (result <= 0);
  459. X  }
  460. ***************
  461. *** 816,819 ****
  462. --- 824,1154 ----
  463. X  #endif
  464. X  #endif
  465. X      return len == 0;
  466. + }
  467. + #ifdef STREAMSCONN
  468. + #ifdef SVR4
  469. + #include <tiuser.h>
  470. + #else
  471. + #undef HASXDMAUTH
  472. + #endif
  473. + #endif
  474. + #ifdef SECURE_RPC
  475. + #include <rpc/rpc.h>
  476. + #ifdef ultrix
  477. + #include <time.h>
  478. + #include <rpc/auth_des.h>
  479. + #endif
  480. + #endif
  481. + /*
  482. +  * First, a routine for setting authorization data
  483. +  */
  484. + static int xauth_namelen = 0;
  485. + static char *xauth_name = NULL;     /* NULL means use default mechanism */
  486. + static int xauth_datalen = 0;
  487. + static char *xauth_data = NULL;     /* NULL means get default data */
  488. + /*
  489. +  * This is a list of the authorization names which Xlib currently supports.
  490. +  * Xau will choose the file entry which matches the earliest entry in this
  491. +  * array, allowing us to prioritize these in terms of the most secure first
  492. +  */
  493. + static char *default_xauth_names[] = {
  494. + #ifdef SECURE_RPC
  495. +     "SUN-DES-1",
  496. + #endif
  497. + #ifdef HASXDMAUTH
  498. +     "XDM-AUTHORIZATION-1",
  499. + #endif
  500. +     "MIT-MAGIC-COOKIE-1"
  501. + };
  502. + static int default_xauth_lengths[] = {
  503. + #ifdef SECURE_RPC
  504. +     9,        /* strlen ("SUN-DES-1") */
  505. + #endif
  506. + #ifdef HASXDMAUTH
  507. +     19,        /* strlen ("XDM-AUTHORIZATION-1") */
  508. + #endif
  509. +     18        /* strlen ("MIT-MAGIC-COOKIE-1") */
  510. + };
  511. + #define NUM_DEFAULT_AUTH    (sizeof (default_xauth_names) / sizeof (default_xauth_names[0]))
  512. +     
  513. + static char **xauth_names = default_xauth_names;
  514. + static int  *xauth_lengths = default_xauth_lengths;
  515. + static int  xauth_names_length = NUM_DEFAULT_AUTH;
  516. + void XSetAuthorization (name, namelen, data, datalen)
  517. +     int namelen, datalen;        /* lengths of name and data */
  518. +     char *name, *data;            /* NULL or arbitrary array of bytes */
  519. + {
  520. +     char *tmpname, *tmpdata;
  521. +     if (xauth_name) Xfree (xauth_name);     /* free any existing data */
  522. +     if (xauth_data) Xfree (xauth_data);
  523. +     xauth_name = xauth_data = NULL;    /* mark it no longer valid */
  524. +     xauth_namelen = xauth_datalen = 0;
  525. +     if (namelen < 0) namelen = 0;    /* check for bogus inputs */
  526. +     if (datalen < 0) datalen = 0;    /* maybe should return? */
  527. +     if (namelen > 0)  {            /* try to allocate space */
  528. +     tmpname = Xmalloc ((unsigned) namelen);
  529. +     if (!tmpname) return;
  530. +     bcopy (name, tmpname, namelen);
  531. +     } else {
  532. +     tmpname = NULL;
  533. +     }
  534. +     if (datalen > 0)  {
  535. +     tmpdata = Xmalloc ((unsigned) datalen);
  536. +     if (!tmpdata) {
  537. +         if (tmpname) (void) Xfree (tmpname);
  538. +         return;
  539. +     }
  540. +     bcopy (data, tmpdata, datalen);
  541. +     } else {
  542. +     tmpdata = NULL;
  543. +     }
  544. +     xauth_name = tmpname;        /* and store the suckers */
  545. +     xauth_namelen = namelen;
  546. +     if (tmpname)
  547. +     {
  548. +     xauth_names = &xauth_name;
  549. +     xauth_lengths = &xauth_namelen;
  550. +     xauth_names_length = 1;
  551. +     }
  552. +     else
  553. +     {
  554. +     xauth_names = default_xauth_names;
  555. +     xauth_lengths = default_xauth_lengths;
  556. +     xauth_names_length = NUM_DEFAULT_AUTH;
  557. +     }
  558. +     xauth_data = tmpdata;
  559. +     xauth_datalen = datalen;
  560. +     return;
  561. + }
  562. + #ifdef SECURE_RPC
  563. + /*
  564. +  * Create a credential that we can send to the X server.
  565. +  */
  566. + static int
  567. + auth_ezencode(servername, window, cred_out, len)
  568. +         char           *servername;
  569. +         int             window;
  570. +     char           *cred_out;
  571. +         int            *len;
  572. + {
  573. +         AUTH           *a;
  574. +         XDR             xdr;
  575. +         a = authdes_create(servername, window, NULL, NULL);
  576. +         if (a == (AUTH *)NULL) {
  577. +                 perror("auth_create");
  578. +                 return 0;
  579. +         }
  580. +         xdrmem_create(&xdr, cred_out, *len, XDR_ENCODE);
  581. +         if (AUTH_MARSHALL(a, &xdr) == FALSE) {
  582. +                 perror("auth_marshall");
  583. +                 AUTH_DESTROY(a);
  584. +                 return 0;
  585. +         }
  586. +         *len = xdr_getpos(&xdr);
  587. +         AUTH_DESTROY(a);
  588. +     return 1;
  589. + }
  590. + #endif
  591. + static void
  592. + GetAuthorization(fd, family, saddr, saddrlen, idisplay,
  593. +          auth_namep, auth_namelenp, auth_datap, auth_datalenp)
  594. +     int fd;
  595. +     int family;
  596. +     int saddrlen;
  597. +     int idisplay;
  598. +     char *saddr;
  599. +     char **auth_namep;            /* RETURN */
  600. +     int *auth_namelenp;            /* RETURN */
  601. +     char **auth_datap;            /* RETURN */
  602. +     int *auth_datalenp;            /* RETURN */
  603. + {
  604. + #ifdef SECURE_RPC
  605. +     char rpc_cred[MAX_AUTH_BYTES];
  606. + #endif
  607. + #ifdef HASXDMAUTH
  608. +     char xdmcp_data[192/8];
  609. + #endif
  610. +     char *auth_name;
  611. +     int auth_namelen;
  612. +     char *auth_data;
  613. +     int auth_datalen;
  614. +     Xauth *authptr = NULL;
  615. + /*
  616. +  * Look up the authorization protocol name and data if necessary.
  617. +  */
  618. +     if (xauth_name && xauth_data) {
  619. +     auth_namelen = xauth_namelen;
  620. +     auth_name = xauth_name;
  621. +     auth_datalen = xauth_datalen;
  622. +     auth_data = xauth_data;
  623. +     } else {
  624. +     char dpynumbuf[40];        /* big enough to hold 2^64 and more */
  625. +     (void) sprintf (dpynumbuf, "%d", idisplay);
  626. +     authptr = XauGetBestAuthByAddr ((unsigned short) family,
  627. +                     (unsigned short) saddrlen,
  628. +                     saddr,
  629. +                     (unsigned short) strlen (dpynumbuf),
  630. +                     dpynumbuf,
  631. +                     xauth_names_length,
  632. +                     xauth_names,
  633. +                     xauth_lengths);
  634. +     if (authptr) {
  635. +         auth_namelen = authptr->name_length;
  636. +         auth_name = (char *)authptr->name;
  637. +         auth_datalen = authptr->data_length;
  638. +         auth_data = (char *)authptr->data;
  639. +     } else {
  640. +         auth_namelen = 0;
  641. +         auth_name = NULL;
  642. +         auth_datalen = 0;
  643. +         auth_data = NULL;
  644. +     }
  645. +     }
  646. + #ifdef HASXDMAUTH
  647. +     /*
  648. +      * build XDM-AUTHORIZATION-1 data
  649. +      */
  650. +     if (auth_namelen == 19 && !strncmp (auth_name, "XDM-AUTHORIZATION-1", 19))
  651. +     {
  652. +     int     j;
  653. +     long    now;
  654. +     for (j = 0; j < 8; j++)
  655. +         xdmcp_data[j] = auth_data[j];
  656. + #ifdef STREAMSCONN /* && SVR4 */
  657. +     {
  658. +         int            i;
  659. +         struct netbuf    netb;
  660. +         char        addrret[1024];
  661. +         netb.maxlen = sizeof addrret;
  662. +         netb.buf = addrret;
  663. +         if (t_getname (fd, &netb, LOCALNAME) == -1)
  664. +         t_error ("t_getname");
  665. +         /*
  666. +          * XXX - assumes that the return data
  667. +          * are in a struct sockaddr_in, and that
  668. +          * the data structure is layed out in
  669. +          * the normal fashion.  This WILL NOT WORK
  670. +          * on a non 32-bit machine (same in Xstreams.c)
  671. +          */
  672. +         for (i = 4; i < 8; i++)
  673. +         xdmcp_data[j++] = netb.buf[i];
  674. +         for (i = 2; i < 4; i++)
  675. +         xdmcp_data[j++] = netb.buf[i];
  676. +     }
  677. + #else
  678. +     {
  679. +         unsigned long    addr;
  680. +         unsigned short    port;
  681. + #ifdef TCPCONN
  682. +         int        addrlen;
  683. +         struct sockaddr_in    in_addr;
  684. +         addrlen = sizeof (in_addr);
  685. +         if (getsockname (fd,
  686. +                  (struct sockaddr *) &in_addr,
  687. +                  &addrlen) != -1 &&
  688. +         addrlen >= sizeof in_addr &&
  689. +         in_addr.sin_family == AF_INET)
  690. +         {
  691. +         addr = ntohl (in_addr.sin_addr.s_addr);
  692. +         port = ntohs (in_addr.sin_port);
  693. +         }
  694. +         else
  695. + #endif
  696. +         {
  697. +         static unsigned long    unix_addr = 0xFFFFFFFF;
  698. +         addr = unix_addr--;
  699. +         port = getpid ();
  700. +         }
  701. +         xdmcp_data[j++] = (addr >> 24) & 0xFF;
  702. +         xdmcp_data[j++] = (addr >> 16) & 0xFF;
  703. +         xdmcp_data[j++] = (addr >>  8) & 0xFF;
  704. +         xdmcp_data[j++] = (addr >>  0) & 0xFF;
  705. +         xdmcp_data[j++] = (port >>  8) & 0xFF;
  706. +         xdmcp_data[j++] = (port >>  0) & 0xFF;
  707. +     }
  708. + #endif
  709. +     time (&now);
  710. +     xdmcp_data[j++] = (now >> 24) & 0xFF;
  711. +     xdmcp_data[j++] = (now >> 16) & 0xFF;
  712. +     xdmcp_data[j++] = (now >>  8) & 0xFF;
  713. +     xdmcp_data[j++] = (now >>  0) & 0xFF;
  714. +     while (j < 192 / 8)
  715. +         xdmcp_data[j++] = 0;
  716. +     XdmcpWrap (xdmcp_data, auth_data + 8,
  717. +               xdmcp_data, j);
  718. +     auth_data = xdmcp_data;
  719. +     auth_datalen = j;
  720. +     }
  721. + #endif /* HASXDMAUTH */
  722. + #ifdef SECURE_RPC
  723. +     /*
  724. +      * The SUN-DES-1 authorization protocol uses the
  725. +      * "secure RPC" mechanism in SunOS 4.0+.
  726. +      */
  727. +     if (auth_namelen == 9 && !strncmp(auth_name, "SUN-DES-1", 9)) {
  728. +     char servernetname[MAXNETNAMELEN + 1];
  729. +     /*
  730. +      * Copy over the server's netname from the authorization
  731. +      * data field filled in by XauGetAuthByAddr().
  732. +      */
  733. +     if (auth_datalen > MAXNETNAMELEN) {
  734. +         auth_datalen = 0;
  735. +         auth_data = NULL;
  736. +     } else {
  737. +         bcopy(auth_data, servernetname, auth_datalen);
  738. +         servernetname[auth_datalen] = '\0';
  739. +         auth_datalen = sizeof (rpc_cred);
  740. +         if (auth_ezencode(servernetname, 100, rpc_cred,
  741. +                   &auth_datalen))
  742. +         auth_data = rpc_cred;
  743. +         else
  744. +         auth_data = NULL;
  745. +     }
  746. +     }
  747. + #endif
  748. +     if (saddr) Xfree (saddr);
  749. +     if (*auth_namelenp = auth_namelen)
  750. +     {
  751. +     if (*auth_namep = Xmalloc(auth_namelen))
  752. +         bcopy(auth_name, *auth_namep, auth_namelen);
  753. +     else
  754. +         *auth_namelenp = 0;
  755. +     }
  756. +     else
  757. +     *auth_namep = NULL;
  758. +     if (*auth_datalenp = auth_datalen)
  759. +     {
  760. +     if (*auth_datap = Xmalloc(auth_datalen))
  761. +         bcopy(auth_data, *auth_datap, auth_datalen);
  762. +     else
  763. +         *auth_datalenp = 0;
  764. +     }
  765. +     else
  766. +     *auth_datap = NULL;
  767. +     if (authptr) XauDisposeAuth (authptr);
  768. X  }
  769. *** /tmp/,RCSt1a12637    Wed Jul 22 16:13:36 1992
  770. --- mit/lib/X/XFont.c    Wed Jul 22 16:13:36 1992
  771. ***************
  772. *** 1,4 ****
  773. ! /* $XConsortium: XFont.c,v 11.37 91/01/06 11:45:39 rws Exp $ */
  774. X  /* Copyright    Massachusetts Institute of Technology    1986    */
  775. X  
  776. X  /*
  777. --- 1,4 ----
  778. ! /* $XConsortium: XFont.c,v 11.38 91/12/19 18:14:14 rws Exp $ */
  779. X  /* Copyright    Massachusetts Institute of Technology    1986    */
  780. X  
  781. X  /*
  782. ***************
  783. *** 81,86 ****
  784. --- 81,88 ----
  785. X      ext = ext->next;
  786. X      }    
  787. X      GetResReq (CloseFont, fs->fid, req);
  788. +     UnlockDisplay(dpy);
  789. +     SyncHandle();
  790. X      _XFreeExtData(fs->ext_data);
  791. X      if (fs->per_char)
  792. X         Xfree ((char *) fs->per_char);
  793. ***************
  794. *** 87,94 ****
  795. X      if (fs->properties)
  796. X         Xfree ((char *) fs->properties);
  797. X      Xfree ((char *) fs);
  798. -     UnlockDisplay(dpy);
  799. -     SyncHandle();
  800. X  }
  801. X  
  802. X  /*
  803. --- 89,94 ----
  804. *** /tmp/,RCSt1a12644    Wed Jul 22 16:13:37 1992
  805. --- mit/lib/X/XFreeGC.c    Wed Jul 22 16:13:38 1992
  806. ***************
  807. *** 1,4 ****
  808. ! /* $XConsortium: XFreeGC.c,v 11.11 91/05/02 18:16:02 rws Exp $ */
  809. X  /* Copyright    Massachusetts Institute of Technology    1986    */
  810. X  
  811. X  /*
  812. --- 1,4 ----
  813. ! /* $XConsortium: XFreeGC.c,v 11.12 91/12/19 18:13:13 rws Exp $ */
  814. X  /* Copyright    Massachusetts Institute of Technology    1986    */
  815. X  
  816. X  /*
  817. ***************
  818. *** 22,36 ****
  819. X      register xResourceReq *req;
  820. X      register _XExtension *ext;
  821. X      LockDisplay(dpy);
  822. -     GetResReq (FreeGC, gc->gid, req);
  823. X      ext = dpy->ext_procs;
  824. X      while (ext) {        /* call out to any extensions interested */
  825. X      if (ext->free_GC != NULL) (*ext->free_GC)(dpy, gc, &ext->codes);
  826. X      ext = ext->next;
  827. X      }    
  828. !     _XFreeExtData(gc->ext_data);
  829. !     Xfree ((char *) gc);
  830. X      UnlockDisplay(dpy);
  831. X      SyncHandle();
  832. X      }
  833. X      
  834. --- 22,36 ----
  835. X      register xResourceReq *req;
  836. X      register _XExtension *ext;
  837. X      LockDisplay(dpy);
  838. X      ext = dpy->ext_procs;
  839. X      while (ext) {        /* call out to any extensions interested */
  840. X      if (ext->free_GC != NULL) (*ext->free_GC)(dpy, gc, &ext->codes);
  841. X      ext = ext->next;
  842. X      }    
  843. !     GetResReq (FreeGC, gc->gid, req);
  844. X      UnlockDisplay(dpy);
  845. X      SyncHandle();
  846. +     _XFreeExtData(gc->ext_data);
  847. +     Xfree ((char *) gc);
  848. X      }
  849. X      
  850. *** /tmp/,RCSt1a12651    Wed Jul 22 16:13:39 1992
  851. --- mit/lib/X/XOpenDis.c    Wed Jul 22 16:13:40 1992
  852. ***************
  853. *** 1,5 ****
  854. X  /*
  855. !  * $XConsortium: XOpenDis.c,v 11.120 91/09/09 14:47:58 rws Exp $
  856. X   */
  857. X  
  858. X  /* Copyright    Massachusetts Institute of Technology    1985, 1986    */
  859. --- 1,5 ----
  860. X  /*
  861. !  * $XConsortium: XOpenDis.c,v 11.123 91/12/20 16:04:29 rws Exp $
  862. X   */
  863. X  
  864. X  /* Copyright    Massachusetts Institute of Technology    1985, 1986    */
  865. ***************
  866. *** 16,50 ****
  867. X  without express or implied warranty.
  868. X  */
  869. X  
  870. - /* Converted to V11 by jg */
  871. X  #include <X11/Xlibint.h>
  872. X  #include <X11/Xos.h>
  873. - #ifdef HASXDMAUTH
  874. - #include "Xlibnet.h"
  875. - #if TCPCONN
  876. - #include <sys/socket.h>
  877. - #endif
  878. - #endif
  879. - #include <X11/Xauth.h>
  880. X  #include <X11/Xatom.h>
  881. - #ifdef STREAMSCONN
  882. - #ifdef SVR4
  883. - #include <tiuser.h>
  884. - #else
  885. - #undef HASXDMAUTH
  886. - #endif
  887. - #endif
  888. - #ifdef SECURE_RPC
  889. - #include <rpc/rpc.h>
  890. - #ifdef ultrix
  891. - #include <time.h>
  892. - #include <rpc/auth_des.h>
  893. - #endif
  894. - #endif
  895. X  #include <stdio.h>
  896. X  
  897. X  #ifdef X_NOT_STDC_ENV
  898. --- 16,24 ----
  899. ***************
  900. *** 61,193 ****
  901. X      0, 0, 0
  902. X  };
  903. X  
  904. - /*
  905. -  * First, a routine for setting authorization data
  906. -  */
  907. - static int xauth_namelen = 0;
  908. - static char *xauth_name = NULL;     /* NULL means use default mechanism */
  909. - static int xauth_datalen = 0;
  910. - static char *xauth_data = NULL;     /* NULL means get default data */
  911. - /*
  912. -  * This is a list of the authorization names which Xlib currently supports.
  913. -  * Xau will choose the file entry which matches the earliest entry in this
  914. -  * array, allowing us to prioritize these in terms of the most secure first
  915. -  */
  916. - static char *default_xauth_names[] = {
  917. - #ifdef SECURE_RPC
  918. -     "SUN-DES-1",
  919. - #endif
  920. - #ifdef HASXDMAUTH
  921. -     "XDM-AUTHORIZATION-1",
  922. - #endif
  923. -     "MIT-MAGIC-COOKIE-1"
  924. - };
  925. - static int default_xauth_lengths[] = {
  926. - #ifdef SECURE_RPC
  927. -     9,        /* strlen ("SUN-DES-1") */
  928. - #endif
  929. - #ifdef HASXDMAUTH
  930. -     19,        /* strlen ("XDM-AUTHORIZATION-1") */
  931. - #endif
  932. -     18        /* strlen ("MIT-MAGIC-COOKIE-1") */
  933. - };
  934. - #define NUM_DEFAULT_AUTH    (sizeof (default_xauth_names) / sizeof (default_xauth_names[0]))
  935. -     
  936. - static char **xauth_names = default_xauth_names;
  937. - static int  *xauth_lengths = default_xauth_lengths;
  938. - static int  xauth_names_length = NUM_DEFAULT_AUTH;
  939. X  static OutOfMemory();
  940. X  
  941. - void XSetAuthorization (name, namelen, data, datalen)
  942. -     int namelen, datalen;        /* lengths of name and data */
  943. -     char *name, *data;            /* NULL or arbitrary array of bytes */
  944. - {
  945. -     char *tmpname, *tmpdata;
  946. -     if (xauth_name) Xfree (xauth_name);     /* free any existing data */
  947. -     if (xauth_data) Xfree (xauth_data);
  948. -     xauth_name = xauth_data = NULL;    /* mark it no longer valid */
  949. -     xauth_namelen = xauth_datalen = 0;
  950. -     if (namelen < 0) namelen = 0;    /* check for bogus inputs */
  951. -     if (datalen < 0) datalen = 0;    /* maybe should return? */
  952. -     if (namelen > 0)  {            /* try to allocate space */
  953. -     tmpname = Xmalloc ((unsigned) namelen);
  954. -     if (!tmpname) return;
  955. -     bcopy (name, tmpname, namelen);
  956. -     } else {
  957. -     tmpname = NULL;
  958. -     }
  959. -     if (datalen > 0)  {
  960. -     tmpdata = Xmalloc ((unsigned) datalen);
  961. -     if (!tmpdata) {
  962. -         if (tmpname) (void) Xfree (tmpname);
  963. -         return;
  964. -     }
  965. -     bcopy (data, tmpdata, datalen);
  966. -     } else {
  967. -     tmpdata = NULL;
  968. -     }
  969. -     xauth_name = tmpname;        /* and store the suckers */
  970. -     xauth_namelen = namelen;
  971. -     if (tmpname)
  972. -     {
  973. -     xauth_names = &xauth_name;
  974. -     xauth_lengths = &xauth_namelen;
  975. -     xauth_names_length = 1;
  976. -     }
  977. -     else
  978. -     {
  979. -     xauth_names = default_xauth_names;
  980. -     xauth_lengths = default_xauth_lengths;
  981. -     xauth_names_length = NUM_DEFAULT_AUTH;
  982. -     }
  983. -     xauth_data = tmpdata;
  984. -     xauth_datalen = datalen;
  985. -     return;
  986. - }
  987. - #ifdef SECURE_RPC
  988. - /*
  989. -  * Create a credential that we can send to the X server.
  990. -  */
  991. - static int
  992. - auth_ezencode(servername, window, cred_out, len)
  993. -         char           *servername;
  994. -         int             window;
  995. -     char           *cred_out;
  996. -         int            *len;
  997. - {
  998. -         AUTH           *a;
  999. -         XDR             xdr;
  1000. -         a = authdes_create(servername, window, NULL, NULL);
  1001. -         if (a == (AUTH *)NULL) {
  1002. -                 perror("auth_create");
  1003. -                 return 0;
  1004. -         }
  1005. -         xdrmem_create(&xdr, cred_out, *len, XDR_ENCODE);
  1006. -         if (AUTH_MARSHALL(a, &xdr) == FALSE) {
  1007. -                 perror("auth_marshall");
  1008. -                 AUTH_DESTROY(a);
  1009. -                 return 0;
  1010. -         }
  1011. -         *len = xdr_getpos(&xdr);
  1012. -         AUTH_DESTROY(a);
  1013. -     return 1;
  1014. - }
  1015. - #endif
  1016. X  extern Bool _XWireToEvent();
  1017. X  extern Status _XUnknownNativeEvent();
  1018. X  extern Bool _XUnknownWireEvent();
  1019. --- 35,42 ----
  1020. ***************
  1021. *** 211,217 ****
  1022. X      xConnClientPrefix client;    /* client information */
  1023. X      xConnSetupPrefix prefix;    /* prefix information */
  1024. X      int vendorlen;            /* length of vendor string */
  1025. !     char *setup;            /* memory allocated at startup */
  1026. X      char *fullname = NULL;        /* expanded name of display */
  1027. X      int idisplay;            /* display number */
  1028. X      int iscreen;            /* screen number */
  1029. --- 60,66 ----
  1030. X      xConnClientPrefix client;    /* client information */
  1031. X      xConnSetupPrefix prefix;    /* prefix information */
  1032. X      int vendorlen;            /* length of vendor string */
  1033. !     char *setup = NULL;        /* memory allocated at startup */
  1034. X      char *fullname = NULL;        /* expanded name of display */
  1035. X      int idisplay;            /* display number */
  1036. X      int iscreen;            /* screen number */
  1037. ***************
  1038. *** 225,247 ****
  1039. X          xVisualType *vp;
  1040. X      } u;                /* proto data returned from server */
  1041. X      long setuplength;    /* number of bytes in setup message */
  1042. -     Xauth *authptr = NULL;
  1043. -     char *server_addr = NULL;
  1044. -     int server_addrlen = 0;
  1045. X      char *conn_auth_name, *conn_auth_data;
  1046. X      int conn_auth_namelen, conn_auth_datalen;
  1047. -     int conn_family;
  1048. X      unsigned long mask;
  1049. X      extern Bool _XSendClientPrefix();
  1050. X      extern int _XConnectDisplay();
  1051. X      extern XID _XAllocID();
  1052. - #ifdef SECURE_RPC
  1053. -     char    rpc_cred[MAX_AUTH_BYTES];
  1054. - #endif
  1055. -  
  1056. - #ifdef HASXDMAUTH
  1057. -     char    xdmcp_data[192/8];
  1058. - #endif
  1059. X  
  1060. X      /*
  1061. X       * If the display specifier string supplied as an argument to this 
  1062. --- 74,85 ----
  1063. ***************
  1064. *** 286,435 ****
  1065. X   */
  1066. X  
  1067. X      if ((dpy->fd = _XConnectDisplay (display_name, &fullname, &idisplay,
  1068. !                      &iscreen, &conn_family,
  1069. !                      &server_addrlen, &server_addr)) < 0) {
  1070. X          Xfree ((char *) dpy);
  1071. X          UnlockMutex(&lock);
  1072. X          return(NULL);
  1073. X      }
  1074. X  
  1075. X  /*
  1076. !  * Look up the authorization protocol name and data if necessary.
  1077. X   */
  1078. !     if (xauth_name && xauth_data) {
  1079. !         conn_auth_namelen = xauth_namelen;
  1080. !         conn_auth_name = xauth_name;
  1081. !         conn_auth_datalen = xauth_datalen;
  1082. !         conn_auth_data = xauth_data;
  1083. !     } else {
  1084. !         char dpynumbuf[40];        /* big enough to hold 2^64 and more */
  1085. !         (void) sprintf (dpynumbuf, "%d", idisplay);
  1086. X  
  1087. !         authptr = XauGetBestAuthByAddr ((unsigned short) conn_family,
  1088. !                     (unsigned short) server_addrlen,
  1089. !                     server_addr,
  1090. !                     (unsigned short) strlen (dpynumbuf),
  1091. !                     dpynumbuf,
  1092. !                     xauth_names_length,
  1093. !                     xauth_names,
  1094. !                     xauth_lengths);
  1095. !         if (authptr) {
  1096. !         conn_auth_namelen = authptr->name_length;
  1097. !         conn_auth_name = (char *)authptr->name;
  1098. !         conn_auth_datalen = authptr->data_length;
  1099. !         conn_auth_data = (char *)authptr->data;
  1100. !         } else {
  1101. !         conn_auth_namelen = 0;
  1102. !         conn_auth_name = NULL;
  1103. !         conn_auth_datalen = 0;
  1104. !         conn_auth_data = NULL;
  1105. !         }
  1106. X      }
  1107. ! #ifdef HASXDMAUTH
  1108. !     /*
  1109. !      * build XDM-AUTHORIZATION-1 data
  1110. !      */
  1111. !     if (conn_auth_namelen == 19 &&
  1112. !         !strncmp (conn_auth_name, "XDM-AUTHORIZATION-1", 19))
  1113. !     {
  1114. !         int        i, j;
  1115. !         long    now;
  1116. !         for (j = 0; j < 8; j++)
  1117. !         xdmcp_data[j] = conn_auth_data[j];
  1118. ! #ifdef STREAMSCONN /* && SVR4 */
  1119. !         {
  1120. !             struct netbuf    netb;
  1121. !             char        addrret[1024];
  1122. !     
  1123. !             netb.maxlen = sizeof addrret;
  1124. !             netb.buf = addrret;
  1125. !             if (t_getname (dpy->fd, &netb, LOCALNAME) == -1)
  1126. !             t_error ("t_getname");
  1127. !         /*
  1128. !          * XXX - assumes that the return data
  1129. !          * are in a struct sockaddr_in, and that
  1130. !          * the data structure is layed out in
  1131. !          * the normal fashion.  This WILL NOT WORK
  1132. !          * on a non 32-bit machine (same in Xstreams.c)
  1133. !          */
  1134. !         for (i = 4; i < 8; i++)
  1135. !             xdmcp_data[j++] = netb.buf[i];
  1136. !         for (i = 2; i < 4; i++)
  1137. !             xdmcp_data[j++] = netb.buf[i];
  1138. !         }
  1139. ! #else
  1140. !         {
  1141. !             unsigned long    addr;
  1142. !             unsigned short    port;
  1143. ! #ifdef TCPCONN
  1144. !             int        addrlen;
  1145. !             struct sockaddr_in    in_addr;
  1146. !     
  1147. !             addrlen = sizeof (in_addr);
  1148. !             if (getsockname (dpy->fd,
  1149. !                  (struct sockaddr *) &in_addr,
  1150. !                   &addrlen) != -1 &&
  1151. !             addrlen >= sizeof in_addr &&
  1152. !             in_addr.sin_family == AF_INET)
  1153. !             {
  1154. !             addr = ntohl (in_addr.sin_addr.s_addr);
  1155. !             port = ntohs (in_addr.sin_port);
  1156. !             }
  1157. !             else
  1158. ! #endif
  1159. !             {
  1160. !             static unsigned long    unix_addr = 0xFFFFFFFF;
  1161. !             addr = unix_addr--;
  1162. !             port = getpid ();
  1163. !             }
  1164. !             xdmcp_data[j++] = (addr >> 24) & 0xFF;
  1165. !             xdmcp_data[j++] = (addr >> 16) & 0xFF;
  1166. !             xdmcp_data[j++] = (addr >>  8) & 0xFF;
  1167. !             xdmcp_data[j++] = (addr >>  0) & 0xFF;
  1168. !             xdmcp_data[j++] = (port >>  8) & 0xFF;
  1169. !             xdmcp_data[j++] = (port >>  0) & 0xFF;
  1170. !         }
  1171. ! #endif
  1172. !         time (&now);
  1173. !         xdmcp_data[j++] = (now >> 24) & 0xFF;
  1174. !         xdmcp_data[j++] = (now >> 16) & 0xFF;
  1175. !         xdmcp_data[j++] = (now >>  8) & 0xFF;
  1176. !         xdmcp_data[j++] = (now >>  0) & 0xFF;
  1177. !         while (j < 192 / 8)
  1178. !         xdmcp_data[j++] = 0;
  1179. !         XdmcpWrap (xdmcp_data, conn_auth_data + 8,
  1180. !               xdmcp_data, j);
  1181. !         conn_auth_data = xdmcp_data;
  1182. !         conn_auth_datalen = j;
  1183. X      }
  1184. - #endif /* HASXDMAUTH */
  1185. - #ifdef SECURE_RPC
  1186. -         /*
  1187. -          * The SUN-DES-1 authorization protocol uses the
  1188. -          * "secure RPC" mechanism in SunOS 4.0+.
  1189. -          */
  1190. -         if (conn_auth_namelen == 9 && !strncmp(conn_auth_name,
  1191. -             "SUN-DES-1", 9)) {
  1192. -             static char servernetname[MAXNETNAMELEN + 1];
  1193. X  
  1194. -             /*
  1195. -              * Copy over the server's netname from the authorization
  1196. -              * data field filled in by XauGetAuthByAddr().
  1197. -              */
  1198. -             if (conn_auth_datalen > MAXNETNAMELEN) {
  1199. -                 return 0;
  1200. -             }
  1201. -             bcopy(conn_auth_data, servernetname, conn_auth_datalen);
  1202. -             servernetname[conn_auth_datalen] = '\0';
  1203. -         conn_auth_datalen = sizeof (rpc_cred);
  1204. -             if (auth_ezencode(servernetname, 100, rpc_cred, &conn_auth_datalen))
  1205. -         conn_auth_data = rpc_cred;
  1206. -         else
  1207. -         conn_auth_data = NULL;
  1208. -         }
  1209. - #endif
  1210. -     if (server_addr) (void) Xfree (server_addr);
  1211. X  /*
  1212. X   * The xConnClientPrefix describes the initial connection setup information
  1213. X   * and is followed by the authorization information.  Sites that are interested
  1214. --- 124,211 ----
  1215. X   */
  1216. X  
  1217. X      if ((dpy->fd = _XConnectDisplay (display_name, &fullname, &idisplay,
  1218. !                      &iscreen, &conn_auth_name,
  1219. !                      &conn_auth_namelen, &conn_auth_data,
  1220. !                      &conn_auth_datalen)) < 0) {
  1221. X          Xfree ((char *) dpy);
  1222. X          UnlockMutex(&lock);
  1223. X          return(NULL);
  1224. X      }
  1225. X  
  1226. +     /* Initialize as much of the display structure as we can */
  1227. +     dpy->display_name    = fullname;
  1228. +     dpy->keysyms        = (KeySym *) NULL;
  1229. +     dpy->modifiermap    = NULL;
  1230. +     dpy->lock_meaning    = NoSymbol;
  1231. +     dpy->keysyms_per_keycode = 0;
  1232. +     dpy->current        = None;
  1233. +     dpy->xdefaults        = (char *)NULL;
  1234. +     dpy->scratch_length    = 0L;
  1235. +     dpy->scratch_buffer    = NULL;
  1236. +     dpy->key_bindings    = NULL;
  1237. +     dpy->ext_procs        = (_XExtension *)NULL;
  1238. +     dpy->ext_data        = (XExtData *)NULL;
  1239. +     dpy->ext_number     = 0;
  1240. +     dpy->event_vec[X_Error] = _XUnknownWireEvent;
  1241. +     dpy->event_vec[X_Reply] = _XUnknownWireEvent;
  1242. +     dpy->wire_vec[X_Error]  = _XUnknownNativeEvent;
  1243. +     dpy->wire_vec[X_Reply]  = _XUnknownNativeEvent;
  1244. +     for (i = KeyPress; i < LASTEvent; i++) {
  1245. +         dpy->event_vec[i]     = _XWireToEvent;
  1246. +         dpy->wire_vec[i]     = NULL;
  1247. +     }
  1248. +     for (i = LASTEvent; i < 128; i++) {
  1249. +         dpy->event_vec[i]     = _XUnknownWireEvent;
  1250. +         dpy->wire_vec[i]     = _XUnknownNativeEvent;
  1251. +     }
  1252. +     dpy->resource_id    = 0;
  1253. +     dpy->db         = (struct _XrmHashBucketRec *)NULL;
  1254. +     dpy->cursor_font    = None;
  1255. +     dpy->flags        = 0;
  1256. + /* 
  1257. +  * Initialize pointers to NULL so that XFreeDisplayStructure will
  1258. +  * work if we run out of memory
  1259. +  */
  1260. +     dpy->screens = NULL;
  1261. +     dpy->vendor = NULL;
  1262. +     dpy->buffer = NULL;
  1263. +     dpy->atoms = NULL;
  1264. +     dpy->error_vec = NULL;
  1265. +     dpy->context_db = NULL;
  1266. X  /*
  1267. !  * Setup other information in this display structure.
  1268. X   */
  1269. !     dpy->vnumber = X_PROTOCOL;
  1270. !     dpy->resource_alloc = _XAllocID;
  1271. !     dpy->synchandler = NULL;
  1272. !     dpy->request = 0;
  1273. !     dpy->last_request_read = 0;
  1274. !     dpy->default_screen = iscreen;  /* Value returned by ConnectDisplay */
  1275. !     dpy->last_req = (char *)&_dummy_request;
  1276. X  
  1277. !     /* Set up the output buffers. */
  1278. !     if ((dpy->bufptr = dpy->buffer = Xmalloc(BUFSIZE)) == NULL) {
  1279. !             OutOfMemory (dpy, setup);
  1280. !         UnlockMutex(&lock);
  1281. !         return(NULL);
  1282. X      }
  1283. !     dpy->bufmax = dpy->buffer + BUFSIZE;
  1284. !  
  1285. !     /* Set up the input event queue and input event queue parameters. */
  1286. !     dpy->head = dpy->tail = NULL;
  1287. !     dpy->qlen = 0;
  1288. !     /* Set up free-function record */
  1289. !     if ((dpy->free_funcs = (_XFreeFuncRec *)Xcalloc(1,
  1290. !                             sizeof(_XFreeFuncRec)))
  1291. !         == NULL) {
  1292. !         OutOfMemory (dpy, setup);
  1293. !         UnlockMutex(&lock);
  1294. !         return(NULL);
  1295. X      }
  1296. X  
  1297. X  /*
  1298. X   * The xConnClientPrefix describes the initial connection setup information
  1299. X   * and is followed by the authorization information.  Sites that are interested
  1300. ***************
  1301. *** 452,458 ****
  1302. X          UnlockMutex(&lock);
  1303. X          return(NULL);
  1304. X      }        
  1305. !     if (authptr) XauDisposeAuth (authptr);
  1306. X  /*
  1307. X   * Now see if connection was accepted...
  1308. X   */
  1309. --- 228,235 ----
  1310. X          UnlockMutex(&lock);
  1311. X          return(NULL);
  1312. X      }        
  1313. !     if (conn_auth_name) Xfree(conn_auth_name);
  1314. !     if (conn_auth_data) Xfree(conn_auth_data);
  1315. X  /*
  1316. X   * Now see if connection was accepted...
  1317. X   */
  1318. ***************
  1319. *** 490,498 ****
  1320. X          (void) fwrite (u.failure, sizeof(char),
  1321. X              (int)prefix.lengthReason, stderr);
  1322. X          (void) fwrite ("\r\n", sizeof(char), 2, stderr);
  1323. !         _XDisconnectDisplay (dpy->fd);
  1324. !         Xfree ((char *)dpy);
  1325. !         Xfree (setup);
  1326. X          UnlockMutex(&lock);
  1327. X          return (NULL);
  1328. X      }
  1329. --- 267,273 ----
  1330. X          (void) fwrite (u.failure, sizeof(char),
  1331. X              (int)prefix.lengthReason, stderr);
  1332. X          (void) fwrite ("\r\n", sizeof(char), 2, stderr);
  1333. !         OutOfMemory(dpy, setup);
  1334. X          UnlockMutex(&lock);
  1335. X          return (NULL);
  1336. X      }
  1337. ***************
  1338. *** 508,522 ****
  1339. X      dpy->resource_mask    = u.setup->ridMask;
  1340. X      dpy->min_keycode    = u.setup->minKeyCode;
  1341. X      dpy->max_keycode    = u.setup->maxKeyCode;
  1342. -     dpy->keysyms        = (KeySym *) NULL;
  1343. -     dpy->modifiermap    = NULL;
  1344. -     dpy->lock_meaning    = NoSymbol;
  1345. -     dpy->keysyms_per_keycode = 0;
  1346. -     dpy->current        = None;
  1347. -     dpy->xdefaults        = (char *)NULL;
  1348. -     dpy->scratch_length    = 0L;
  1349. -     dpy->scratch_buffer    = NULL;
  1350. -     dpy->key_bindings    = NULL;
  1351. X      dpy->motion_buffer    = u.setup->motionBufferSize;
  1352. X      dpy->nformats        = u.setup->numFormats;
  1353. X      dpy->nscreens        = u.setup->numRoots;
  1354. --- 283,288 ----
  1355. ***************
  1356. *** 525,546 ****
  1357. X      dpy->bitmap_pad        = u.setup->bitmapScanlinePad;
  1358. X      dpy->bitmap_bit_order   = u.setup->bitmapBitOrder;
  1359. X      dpy->max_request_size    = u.setup->maxRequestSize;
  1360. -     dpy->ext_procs        = (_XExtension *)NULL;
  1361. -     dpy->ext_data        = (XExtData *)NULL;
  1362. -     dpy->ext_number     = 0;
  1363. -     dpy->event_vec[X_Error] = _XUnknownWireEvent;
  1364. -     dpy->event_vec[X_Reply] = _XUnknownWireEvent;
  1365. -     dpy->wire_vec[X_Error]  = _XUnknownNativeEvent;
  1366. -     dpy->wire_vec[X_Reply]  = _XUnknownNativeEvent;
  1367. -     for (i = KeyPress; i < LASTEvent; i++) {
  1368. -         dpy->event_vec[i]     = _XWireToEvent;
  1369. -         dpy->wire_vec[i]     = NULL;
  1370. -     }
  1371. -     for (i = LASTEvent; i < 128; i++) {
  1372. -         dpy->event_vec[i]     = _XUnknownWireEvent;
  1373. -         dpy->wire_vec[i]     = _XUnknownNativeEvent;
  1374. -     }
  1375. -     dpy->resource_id    = 0;
  1376. X      mask = dpy->resource_mask;
  1377. X      dpy->resource_shift    = 0;
  1378. X      while (!(mask & 1)) {
  1379. --- 291,296 ----
  1380. ***************
  1381. *** 547,568 ****
  1382. X          dpy->resource_shift++;
  1383. X          mask = mask >> 1;
  1384. X      }
  1385. -     dpy->db         = (struct _XrmHashBucketRec *)NULL;
  1386. -     dpy->cursor_font    = None;
  1387. -     dpy->flags        = 0;
  1388. - /* 
  1389. -  * Initialize pointers to NULL so that XFreeDisplayStructure will
  1390. -  * work if we run out of memory
  1391. -  */
  1392. -     dpy->screens = NULL;
  1393. -     dpy->display_name = NULL;
  1394. -     dpy->vendor = NULL;
  1395. -     dpy->buffer = NULL;
  1396. -     dpy->atoms = NULL;
  1397. -     dpy->error_vec = NULL;
  1398. -     dpy->context_db = NULL;
  1399. X  /*
  1400. X   * now extract the vendor string...  String must be null terminated,
  1401. X   * padded to multiple of 4 bytes.
  1402. --- 297,302 ----
  1403. ***************
  1404. *** 687,727 ****
  1405. X          
  1406. X  
  1407. X  /*
  1408. -  * Setup other information in this display structure.
  1409. -  */
  1410. -     dpy->vnumber = X_PROTOCOL;
  1411. -     dpy->resource_alloc = _XAllocID;
  1412. -     dpy->synchandler = NULL;
  1413. -     dpy->request = 0;
  1414. -     dpy->last_request_read = 0;
  1415. -     dpy->default_screen = iscreen;  /* Value returned by ConnectDisplay */
  1416. -     dpy->last_req = (char *)&_dummy_request;
  1417. -     /* Salt away the host:display string for later use */
  1418. -     dpy->display_name = fullname;
  1419. -  
  1420. -     /* Set up the output buffers. */
  1421. -     if ((dpy->bufptr = dpy->buffer = Xmalloc(BUFSIZE)) == NULL) {
  1422. -             OutOfMemory (dpy, setup);
  1423. -         UnlockMutex(&lock);
  1424. -         return(NULL);
  1425. -     }
  1426. -     dpy->bufmax = dpy->buffer + BUFSIZE;
  1427. -  
  1428. -     /* Set up the input event queue and input event queue parameters. */
  1429. -     dpy->head = dpy->tail = NULL;
  1430. -     dpy->qlen = 0;
  1431. -     /* Set up free-function record */
  1432. -     if ((dpy->free_funcs = (_XFreeFuncRec *)Xcalloc(1,
  1433. -                             sizeof(_XFreeFuncRec)))
  1434. -         == NULL) {
  1435. -         OutOfMemory (dpy, setup);
  1436. -         UnlockMutex(&lock);
  1437. -         return(NULL);
  1438. -     }
  1439. - /*
  1440. X   * Now start talking to the server to setup all other information...
  1441. X   */
  1442. X  
  1443. --- 421,426 ----
  1444. ***************
  1445. *** 827,832 ****
  1446. --- 526,555 ----
  1447. X  _XFreeDisplayStructure(dpy)
  1448. X      register Display *dpy;
  1449. X  {
  1450. +     while (dpy->ext_procs) {
  1451. +         _XExtension *ext = dpy->ext_procs;
  1452. +         dpy->ext_procs = ext->next;
  1453. +         if (ext->name)
  1454. +         Xfree (ext->name);
  1455. +         Xfree ((char *)ext);
  1456. +     }
  1457. +     if (dpy->im_filters)
  1458. +        (*dpy->free_funcs->im_filters)(dpy);
  1459. +     if (dpy->cms.clientCmaps)
  1460. +        (*dpy->free_funcs->clientCmaps)(dpy);
  1461. +     if (dpy->cms.defaultCCCs)
  1462. +        (*dpy->free_funcs->defaultCCCs)(dpy);
  1463. +     if (dpy->cms.perVisualIntensityMaps)
  1464. +        (*dpy->free_funcs->intensityMaps)(dpy);
  1465. +     if (dpy->atoms)
  1466. +         (*dpy->free_funcs->atoms)(dpy);
  1467. +     if (dpy->modifiermap)
  1468. +        (*dpy->free_funcs->modifiermap)(dpy->modifiermap);
  1469. +     if (dpy->key_bindings)
  1470. +        (*dpy->free_funcs->key_bindings)(dpy);
  1471. +     if (dpy->context_db)
  1472. +        (*dpy->free_funcs->context_db)(dpy);
  1473. X      if (dpy->screens) {
  1474. X          register int i;
  1475. X  
  1476. ***************
  1477. *** 872,907 ****
  1478. X  
  1479. X          if (dpy->buffer)
  1480. X         Xfree (dpy->buffer);
  1481. -     if (dpy->atoms)
  1482. -         (*dpy->free_funcs->atoms)(dpy);
  1483. X      if (dpy->keysyms)
  1484. X         Xfree ((char *) dpy->keysyms);
  1485. -     if (dpy->modifiermap)
  1486. -        (*dpy->free_funcs->modifiermap)(dpy->modifiermap);
  1487. X      if (dpy->xdefaults)
  1488. X         Xfree (dpy->xdefaults);
  1489. -     if (dpy->key_bindings)
  1490. -        (*dpy->free_funcs->key_bindings)(dpy);
  1491. X      if (dpy->error_vec)
  1492. X          Xfree ((char *)dpy->error_vec);
  1493. -     if (dpy->context_db)
  1494. -        (*dpy->free_funcs->context_db)(dpy);
  1495. -     if (dpy->cms.defaultCCCs)
  1496. -        (*dpy->free_funcs->defaultCCCs)(dpy);
  1497. -     if (dpy->cms.clientCmaps)
  1498. -        (*dpy->free_funcs->clientCmaps)(dpy);
  1499. -     if (dpy->cms.perVisualIntensityMaps)
  1500. -        (*dpy->free_funcs->intensityMaps)(dpy);
  1501. -     if (dpy->im_filters)
  1502. -        (*dpy->free_funcs->im_filters)(dpy);
  1503. -     while (dpy->ext_procs) {
  1504. -         _XExtension *ext = dpy->ext_procs;
  1505. -         dpy->ext_procs = ext->next;
  1506. -         if (ext->name)
  1507. -         Xfree (ext->name);
  1508. -         Xfree ((char *)ext);
  1509. -     }
  1510. X  
  1511. X      _XFreeExtData (dpy->ext_data);
  1512. X      Xfree ((char *)dpy->free_funcs);
  1513. --- 595,606 ----
  1514. *** /tmp/,RCSt1a12658    Wed Jul 22 16:13:41 1992
  1515. --- mit/lib/X/XcmsCCC.c    Wed Jul 22 16:13:41 1992
  1516. ***************
  1517. *** 1,4 ****
  1518. ! /* $XConsortium: XcmsCCC.c,v 1.10 91/07/25 01:08:25 rws Exp $" */
  1519. X  
  1520. X  /*
  1521. X   * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
  1522. --- 1,4 ----
  1523. ! /* $XConsortium: XcmsCCC.c,v 1.11 91/12/20 15:58:21 rws Exp $" */
  1524. X  
  1525. X  /*
  1526. X   * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
  1527. ***************
  1528. *** 237,243 ****
  1529. X   *
  1530. X   */
  1531. X  {
  1532. !     if (ccc == XcmsDefaultCCC(ccc->dpy, ccc->screenNumber)) {
  1533. X      /* do not allow clients to free DefaultCCC's */
  1534. X      return;
  1535. X      }
  1536. --- 237,244 ----
  1537. X   *
  1538. X   */
  1539. X  {
  1540. !     if (ccc->dpy->cms.defaultCCCs &&
  1541. !     ccc == ((XcmsCCC)ccc->dpy->cms.defaultCCCs) + ccc->screenNumber) {
  1542. X      /* do not allow clients to free DefaultCCC's */
  1543. X      return;
  1544. X      }
  1545. *** /tmp/da3910    Thu Jul 23 16:56:56 1992
  1546. --- mit/lib/X/XKeyBind.c    Thu Jul 23 16:56:54 1992
  1547. ***************
  1548. *** 1,4 ****
  1549. ! /* $XConsortium: XKeyBind.c,v 11.66 91/05/04 13:51:17 rws Exp $ */
  1550. X  /* Copyright 1985, 1987, Massachusetts Institute of Technology */
  1551. X  
  1552. X  /*
  1553. --- 1,4 ----
  1554. ! /* $XConsortium: XKeyBind.c,v 11.67 92/05/19 11:23:14 converse Exp $ */
  1555. X  /* Copyright 1985, 1987, Massachusetts Institute of Technology */
  1556. X  
  1557. X  /*
  1558. ***************
  1559. *** 275,283 ****
  1560. X          *upper -= (XK_scaron - XK_Scaron);
  1561. X      else if (sym >= XK_zcaron && sym <= XK_zabovedot)
  1562. X          *upper -= (XK_zcaron - XK_Zcaron);
  1563. !     else if (sym <= XK_Racute && sym <= XK_Tcedilla)
  1564. X          *lower += (XK_racute - XK_Racute);
  1565. !     else if (sym <= XK_racute && sym <= XK_tcedilla)
  1566. X          *upper -= (XK_racute - XK_Racute);
  1567. X      break;
  1568. X  #endif
  1569. --- 275,283 ----
  1570. X          *upper -= (XK_scaron - XK_Scaron);
  1571. X      else if (sym >= XK_zcaron && sym <= XK_zabovedot)
  1572. X          *upper -= (XK_zcaron - XK_Zcaron);
  1573. !     else if (sym >= XK_Racute && sym <= XK_Tcedilla)
  1574. X          *lower += (XK_racute - XK_Racute);
  1575. !     else if (sym >= XK_racute && sym <= XK_tcedilla)
  1576. X          *upper -= (XK_racute - XK_Racute);
  1577. X      break;
  1578. X  #endif
  1579. ***************
  1580. *** 295,301 ****
  1581. X      else if (sym >= XK_Cabovedot && sym <= XK_Scircumflex)
  1582. X          *lower += (XK_cabovedot - XK_Cabovedot);
  1583. X      else if (sym >= XK_cabovedot && sym <= XK_scircumflex)
  1584. !         *lower += (XK_cabovedot - XK_Cabovedot);
  1585. X      break;
  1586. X  #endif
  1587. X  #ifdef XK_LATIN4
  1588. --- 295,301 ----
  1589. X      else if (sym >= XK_Cabovedot && sym <= XK_Scircumflex)
  1590. X          *lower += (XK_cabovedot - XK_Cabovedot);
  1591. X      else if (sym >= XK_cabovedot && sym <= XK_scircumflex)
  1592. !         *upper -= (XK_cabovedot - XK_Cabovedot);
  1593. X      break;
  1594. X  #endif
  1595. X  #ifdef XK_LATIN4
  1596. *** /tmp/da3946    Thu Jul 23 16:57:02 1992
  1597. --- mit/lib/Xt/Create.c    Thu Jul 23 16:57:01 1992
  1598. ***************
  1599. *** 1,4 ****
  1600. ! /* $XConsortium: Create.c,v 1.87 91/05/09 18:09:13 swick Exp $ */
  1601. X  
  1602. X  /***********************************************************
  1603. X  Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  1604. --- 1,4 ----
  1605. ! /* $XConsortium: Create.c,v 1.88 92/05/11 16:38:19 converse Exp $ */
  1606. X  
  1607. X  /***********************************************************
  1608. X  Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  1609. ***************
  1610. *** 167,173 ****
  1611. X      char        *name, *class;
  1612. X      WidgetClass widget_class;
  1613. X      Widget      parent;
  1614. !     Screen*     default_screen;
  1615. X      ArgList     args;        /* must be NULL if typed_args is non-NULL */
  1616. X      Cardinal    num_args;
  1617. X      XtTypedArgList typed_args;    /* must be NULL if args is non-NULL */
  1618. --- 167,173 ----
  1619. X      char        *name, *class;
  1620. X      WidgetClass widget_class;
  1621. X      Widget      parent;
  1622. !     Screen*     default_screen; /* undefined when creating a nonwidget */
  1623. X      ArgList     args;        /* must be NULL if typed_args is non-NULL */
  1624. X      Cardinal    num_args;
  1625. X      XtTypedArgList typed_args;    /* must be NULL if args is non-NULL */
  1626. ***************
  1627. *** 355,360 ****
  1628. --- 355,362 ----
  1629. X                    params, &num_params);
  1630. X          }
  1631. X      }
  1632. +     } else {
  1633. +     default_screen = parent->core.screen;
  1634. X      }
  1635. X  
  1636. X      if (XtIsConstraint(parent)) {
  1637. ***************
  1638. *** 362,368 ****
  1639. X      } else {
  1640. X      cwc = NULL;
  1641. X      }
  1642. -     default_screen = parent->core.screen;
  1643. X      widget = _XtCreate(name, (char *)NULL, widget_class, parent,
  1644. X                 default_screen, args, num_args,
  1645. X                 typed_args, num_typed_args, cwc);
  1646. --- 364,369 ----
  1647. *** /tmp/da3982    Thu Jul 23 16:57:09 1992
  1648. --- mit/lib/Xt/Display.c    Thu Jul 23 16:57:08 1992
  1649. ***************
  1650. *** 1,4 ****
  1651. ! /* $XConsortium: Display.c,v 1.81 91/07/12 13:45:00 rws Exp $ */
  1652. X  
  1653. X  /***********************************************************
  1654. X  Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  1655. --- 1,4 ----
  1656. ! /* $XConsortium: Display.c,v 1.85 92/06/08 11:24:21 converse Exp $ */
  1657. X  
  1658. X  /***********************************************************
  1659. X  Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  1660. ***************
  1661. *** 176,188 ****
  1662. X      String language = NULL;
  1663. X  
  1664. X      /* parse the command line for name, display, and/or language */
  1665. !     if (!applName || !displayName || app->process->globalLangProcRec.proc)
  1666. !         db = _XtPreparseCommandLine(urlist, num_urs, *argc, argv,
  1667. !                     &applName, &displayName, &language);
  1668. X      d = XOpenDisplay(displayName);
  1669. X  
  1670. X      if (! applName && !(applName = getenv("RESOURCE_NAME"))) {
  1671. !         if (*argc > 0 && argv[0]) {
  1672. X          char *ptr = rindex(argv[0], '/');
  1673. X          if (ptr) applName = ++ptr;
  1674. X          else applName = argv[0];
  1675. --- 176,189 ----
  1676. X      String language = NULL;
  1677. X  
  1678. X      /* parse the command line for name, display, and/or language */
  1679. !     db = _XtPreparseCommandLine(urlist, num_urs, *argc, argv, &applName,
  1680. !                     (displayName ? NULL : &displayName),
  1681. !                     (app->process->globalLangProcRec.proc ?
  1682. !                      &language : NULL));
  1683. X      d = XOpenDisplay(displayName);
  1684. X  
  1685. X      if (! applName && !(applName = getenv("RESOURCE_NAME"))) {
  1686. !         if (*argc > 0 && argv[0] && *argv[0]) {
  1687. X          char *ptr = rindex(argv[0], '/');
  1688. X          if (ptr) applName = ++ptr;
  1689. X          else applName = argv[0];
  1690. ***************
  1691. *** 486,492 ****
  1692. X          if (xtpd->mapping_callbacks != NULL)
  1693. X          _XtRemoveAllCallbacks(&xtpd->mapping_callbacks);
  1694. X          XtDeleteFromAppContext(dpy, xtpd->appContext);
  1695. !             XtFree((char *) xtpd->keysyms);
  1696. X              XtFree((char *) xtpd->modKeysyms);
  1697. X              XtFree((char *) xtpd->modsToKeysyms);
  1698. X              xtpd->keysyms_per_keycode = 0;
  1699. --- 487,494 ----
  1700. X          if (xtpd->mapping_callbacks != NULL)
  1701. X          _XtRemoveAllCallbacks(&xtpd->mapping_callbacks);
  1702. X          XtDeleteFromAppContext(dpy, xtpd->appContext);
  1703. !         if (xtpd->keysyms)
  1704. !         XFree((char *) xtpd->keysyms);
  1705. X              XtFree((char *) xtpd->modKeysyms);
  1706. X              XtFree((char *) xtpd->modsToKeysyms);
  1707. SHAR_EOF
  1708. true || echo 'restore of fix-14 failed'
  1709. fi
  1710. echo 'End of  part 1'
  1711. echo 'File fix-14 is continued in part 2'
  1712. echo 2 > _shar_seq_.tmp
  1713. exit 0
  1714. -- 
  1715. Senior Systems Scientist        mail: dcmartin@msi.com
  1716. Molecular Simulations, Inc.        uucp: uunet!dcmartin
  1717. 796 North Pastoria Avenue        at&t: 408/522-9236
  1718. Sunnyvale, California 94086        fax: 408/732-0831
  1719.