Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!milano!cadillac!harp From: harp@cadillac.Berkeley.EDU (Christopher North-Keys) Newsgroups: comp.windows.x Subject: Re: Wish list for R5 Message-ID: <10370@cadillac.CAD.MCC.COM> Date: 13 Aug 90 09:32:50 GMT References: <9008130225.AA21698@shamash.McRCIM.McGill.EDU> Sender: news@cadillac.CAD.MCC.COM Reply-To: harp@cadillac.Berkeley.EDU (Christopher North-Keys) Lines: 64 This is a minor detail (ah, well) relating to the X authority interface. According to my interpretation of the man page, and the evidence presented by direct experimentation, there is a basic tool missing from the xauth program. Group Talisman had little difficulty working out the usage of the MIT-MAGIC-COOKIE-1 mechanism, and indeed are using it now between the Uni.Tx@Austin, MCC, and MIT. However, in order to avoid using script ftp sessions between MCC(secured vs. rsh and rlogin) and MIT, it became necessary to add new cookies *ONLY* in the event they did not already exist. This usage of fixed cookies (now that sounds strange...) seemed like an obvious thing to do, but it's here that the problems arose. I already knew there was a simple operation to override existing entries, now what I needed was either a command which only overrode *missing* entries, or a way to test for the existance of an entry. The first didn't exists. Oh, well, I figured, "sure", the second would be there. No need to run ``grep $DISPLAY $XAUTHORITY'' (Nasty! Yechh! Bad!) or anything like that. Surely... Bad news. ``xauth list $DISPLAY'' returns success even if the display in question has no existing cookie. Now I'm using (C-Shell): set xkey = 2004`date +%j%m%d%y%H%M%S`0feedface xauth add unix:0.0 . $xkey if ( 0 == `xauth list $DISPLAY | wc -l` ) xauth add $DISPLAY . $xkey This is *ugly*. I figured the third line *should* be something like: xauth list $DISPLAY || xauth add $DISPLAY . $xkey or even better (add-if-missing): xauth verify $DISPLAY . $xkey Which would allow: set xkey = 2004`date +%j%m%d%y%H%M%S`0feedface cat <<... | xauth >>& /dev/null add unix:0.0 . $xkey verify $DISPLAY . $xkey ... But both if these approaches drew double-nulls. Now, if the idea it that the cookies should *always* be dynamic, it's already suffering, because there's no decent way to reload cookies during a session with xrdb or the like just now...but if it was expected they might be static: Could someone please fix it? Please? We *have* to use it, but fixing it ourselves it rather hard in places where the words ``in my copious spare time'' have become a running joke... Of course, if we just missed something: yell at us (rather, me), eh? ______________________________________________________________________________ Christopher North-Keys Assoc. Systems Analyst Group Talisman Harp[@Mcc.Com] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~