home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume18 / X11R5-fix14 / part01 next >
Encoding:
Text File  |  1993-04-28  |  51.5 KB  |  1,770 lines

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