home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / windows / openloo / 3643 < prev    next >
Encoding:
Text File  |  1992-08-29  |  4.4 KB  |  132 lines

  1. Newsgroups: comp.windows.open-look
  2. Path: sparky!uunet!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!sun4nl!fwi.uva.nl!casper
  3. From: casper@fwi.uva.nl (Casper H.S. Dik)
  4. Subject: Re: Remote client works in X11, not NeWS - auth problem?
  5. Message-ID: <1992Aug28.194129.29862@fwi.uva.nl>
  6. Sender: news@fwi.uva.nl
  7. Nntp-Posting-Host: adam.fwi.uva.nl
  8. Organization: FWI, University of Amsterdam
  9. References: <1992Aug28.175756.5674@athena.cs.uga.edu>
  10. Date: Fri, 28 Aug 1992 19:41:29 GMT
  11. Lines: 119
  12.  
  13. weinri@athena.cs.uga.edu (Kevin Weinrich) writes:
  14.  
  15. >I have a problem that I *think* is an XNeWS authorization problem.
  16. >I'm hoping someone has seen this before.
  17.  
  18. >If I run xauth, it responds:
  19. >  Using authority file /home/kbw/.Xauthority
  20. >  xauth>
  21. >I type:
  22. >  list
  23. >it responds:
  24. >  #ffff##:  MIT-MAGIC-COOKIE-1  debf8cd. . .
  25. >That first field looks mangled (it should say something about helios),
  26. >but the servers seem to accept it.
  27.  
  28. This is the entry that is generated by news. It is usually in the
  29. file .xnews.$DISPLAY or some such.
  30. This entry is a so called ``wild card'' entry (matches any DISPLAY).
  31. I wrote a script that will take a #ffff## entry from
  32. a .xnews.$DISPLAY and put a hostname/unix:0 and hostname:0 in
  33. your .Xauthority file. Run it at the start of your ~/.xinitrc or
  34. after mkcookie in the openwin startup script. Xnews will need
  35. the #ffff## entry, so you better leave the mkcookie stuff alone.
  36.  
  37. Shar file with ``openwinauthmerge'' appended.
  38.  
  39. Casper
  40.  
  41. #! /bin/sh
  42. # This is a shell archive.  Remove anything before this line, then unpack
  43. # it by saving it into a file and typing "sh file".  To overwrite existing
  44. # files, type "sh file -c".  You can also feed this as standard input via
  45. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  46. # will see the following message at the end:
  47. #        "End of shell archive."
  48. # Contents:  openwinauthmerge
  49. # Wrapped by casper@fwi.uva.nl on Fri Aug 28 21:38:58 1992
  50. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  51. if test -f 'openwinauthmerge' -a "${1}" != "-c" ; then 
  52.   echo shar: Will not clobber existing file \"'openwinauthmerge'\"
  53. else
  54. echo shar: Extracting \"'openwinauthmerge'\" \(1922 characters\)
  55. sed "s/^X//" >'openwinauthmerge' <<'END_OF_FILE'
  56. X#!/bin/sh
  57. X#
  58. X# Merge the openwin ``wildcard'' authority cookie with the user's
  59. X# ~/.Xauthority file. Don't add the wild card to ~/.Xauthority as
  60. X# X clients will prefer the explicit entries that might exist from
  61. X# previous X sessions and we also might want to be able to run multiple
  62. X# X sessions on multiple displays at the same time.
  63. X#
  64. X# This programs should be the first to run in ~/.xinitrc.
  65. X# E.g.,
  66. X# openwinauthmerge
  67. X# XAUTHORITY=$HOME/.Xauthority; export XAUTHORITY
  68. X#
  69. X# Casper Dik (casper@fwi.uva.nl)
  70. X#
  71. X
  72. X
  73. Xif [ "$DISPLAY" = "" ]
  74. Xthen
  75. X    echo '$DISPLAY not set.' 1>&2
  76. X    exit 1
  77. Xfi
  78. XHOST=`hostname`
  79. XDISP=`expr $DISPLAY : '.*\(:[0-9]*\)\.*'`
  80. XNEWSAUTH=$HOME/.xnews.$HOST$DISP
  81. XXAUTH=$HOME/.Xauthority
  82. Xif [ ! -r "$NEWSAUTH" ]
  83. Xthen
  84. X    echo "Can't read NeWS authority file." 1>&2
  85. X    exit 1
  86. Xfi
  87. X
  88. X
  89. X# Does your xauth has the R4/openwin 2 bug that destroys hex numbers containing
  90. X# a-f or A-F?
  91. Xxauth -q -f $XAUTH add ${HOST}${DISP} . abcd
  92. Xval=`set \`xauth -i -q -f $XAUTH list ${HOST}${DISP}\`; echo $3`
  93. Xif [ "$val" != abcd ]
  94. Xthen
  95. X    # has bug, must use numerical values.
  96. X    # A numerical x auth entry looks like:
  97. X    # type length [ address ] length [ number ] length name length cookie
  98. X    #
  99. X    # the address and number field are non existant if the length field are 0
  100. X    #
  101. X    # Merging (we don't want to pass the cookie as argument)
  102. X    #
  103. X    # TCP/IP socket
  104. X    xauth -q -f $XAUTH add ${HOST}${DISP} . 00
  105. X    # Unix socket
  106. X    xauth -q -f $XAUTH add ${DISP} . 00
  107. X    ( 
  108. X    xauth -i -q -f $NEWSAUTH nlist 2>/dev/null
  109. X    xauth -i -q -f $XAUTH nlist ${HOST}${DISP} ${DISP}
  110. X    ) | awk 'NR == 1 { cookie = " " $4 " " $5 " " $6 " " $7 }
  111. X         NR > 1 { print $1 " " $2 " " $3 " " $4 " " $5  cookie }' |
  112. X    xauth -q -f $XAUTH nmerge -
  113. Xelse
  114. X    # It's so easy:
  115. X    xauth -i -q -f $NEWSAUTH list 2> /dev/null|
  116. X    awk '{ print "add '${HOST}${DISP}' " $2 " " $3;
  117. X       print "add '${DISP}' " $2 " " $3 }' |
  118. X    xauth -q -f $XAUTH
  119. Xfi
  120. END_OF_FILE
  121. if test 1922 -ne `wc -c <'openwinauthmerge'`; then
  122.     echo shar: \"'openwinauthmerge'\" unpacked with wrong size!
  123. fi
  124. chmod +x 'openwinauthmerge'
  125. # end of 'openwinauthmerge'
  126. fi
  127. echo shar: End of shell archive.
  128. exit 0
  129. -- 
  130.                         |    Casper H.S. Dik
  131.                         |    casper@fwi.uva.nl
  132.