current-0.9.3: patch: header authentication

John Berninger <[email protected]>
Newsgroups gmane.network.up2date.current.devel
Message-ID <[email protected]>
Folks -

        I've figured out what I did wrong with the first two attempts to
make the ConstructParser in current-0.9.3 work.  I've attached a patch
file that actually does the right thing this time; it's against base
0.9.3.  Apologies for the errors.

        For those of you interested in what happened:

        The first time I added the parser calls, I forgot to check to
make sure the header was a list of lists as opposed to a list of
strings; the patch I sent out earlier attempted to access the parsed
object via a ConstructParser call that wasn't in the module for some
reason.  Both these issues have been fixed in this patch.

-- 
Thank you,
John Berninger

Systems Administrator		[email protected]
Department of Mathematics	Box 8205, Harrelson Hall
NC State University		Raleigh, NC 27695
Phone:  (919)515-6315		Fax:	(919)515-3798

GPG Key ID: A8C1D45C
        Fingerprint: B1BB 90CB 5314 3113 CF22  66AE 822D 42A8 A8C1 D45C
--
header-final.patch (text/plain, 999 B)
diff -bru current-0.9.3/auth.py current-devel/auth.py
--- current-0.9.3/auth.py	Tue Jan  8 23:54:39 2002
+++ current-devel/auth.py	Mon Jan 28 21:07:21 2002
@@ -177,9 +177,16 @@
         else:
             cp = ConstructParser.ConstructParser(headers[header_attr])
             try:
-                self.data['X-RHN-Auth-Channels'] = cp.parseIt()
-            except:
+                tmpHdr = cp.parseIt()
+                log ("Header object successfully parsed: %s" % tmpHdr, DEBUG2)
+                if not type(tmpHdr[0]) == type([]):
+                    self.data['X-RHN-Auth-Channels'] = [tmpHdr]
+                else:
+                    self.data['X-RHN-Auth-Channels'] = tmpHdr
+            except Exception, e:
+                log ("Exception caught: %s" % e, DEBUG2)
                 self.data['X-RHN-Auth-Channels'] = ''
+            
             # we can't print errors from here effectively, so just making
             # part of the auth data be empty will ensure a neg auth.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.