To follow up:
I found an unescaped ~ early in my config file,
once I fixed that the authorization keyword
works fine, thanks for the tip.
This code works on Linux but not on Solaris
using Suns getopt from libc:
for (pos = 0; pos < strlen(optarg); pos++)
optarg[pos] = '*';
to hide the password from a process listing.
I checked using some test code and the argv
string and optarg are the same address, so
it must be getting copied prior? I'm not
sure how to create a work around for this
but I plan to just use the config file method
anyway.
Thanks again,
-Carl Edwards
Vitesse Semiconductor
>From: Gilles Detillieux <[EMAIL PROTECTED]>
>Subject: Re: [htdig] config file authorization attribute
>To: [EMAIL PROTECTED]
>Date: Thu, 13 Sep 2001 17:09:03 -0500 (CDT)
>Cc: [EMAIL PROTECTED] (ht://Dig mailing list)
>MIME-Version: 1.0
>Content-Transfer-Encoding: 7bit
>
>According to Carl Edwards:
>> Thanks for the response.
>>
>> Here is a snippet of the -vvv output which shows
>> the htdig version:
>>
>> 1:0:http://fabdata.vitesse.com/
>> New server: fabdata.vitesse.com, 80
>> Trying local files
>> tried local file /import/wwwint/robots.txt
>> Local retrieval failed, trying HTTP
>> Retrieval command for http://fabdata.vitesse.com/robots.txt: GET /robots.txt
HTT
>> P/1.0
>> User-Agent: htdig/3.1.5 ([EMAIL PROTECTED])
>> Authorization: Basic Y2Vkd2FyZHM6dGFtN2FuZGM=
>> Host: fabdata.vitesse.com
>>
>>
>> Here is the ps output:
>>
>> cedwards@marley% ps -ef | grep htdig
>> cedwards 26563 26444 19 16:39:43 pts/15 0:32 bin/htdig -vvv -c
conf/htdig.conf -u cedwards:tmppassd -a
>>
>>
>> I've tried it under Solaris 7 and 8 on Sparc.
>
>Well, that's htdig 3.1.5 sure enough. That number is hardcoded
>in during compilation, so unless someone deliberately bumped up
>the version number on older code and recompiled, there's no mistake.
>I'm not familiar with how Solaris deals with process arguments, nor how
>the C runtime startup code sets up argv, but there's got to be some extra
>copying going on somewhere that doesn't happen on most UNIX-like systems.
>Another possibility is that getopt() copies the argument that it returns
>via optarg, rather than just setting it to a string address in the
>argv vector. Can any Solaris users out there comment on this, and/or
>try some test programs to confirm/narrow down any of this?
>
>> When I was trying the config file way my passwd
>> did have some special characters which I tried
>> double quoting, escaping and eventually I just
>> changed it to something simpler for testing.
>
>Double quoting won't help, but putting a single backslash before a
>backslash, dollar sign or left quote would. E.g.:
>
> \ -> \\
> $ -> \$
> ~ -> \~
>
>This is exactly how the htdig code handles -u. It sets the
>authorization attribute using config.Add(), which does exactly the
>encodings above so that when the authorization attribute is fetched
>by the HTTP handler, no variable substitution takes place. Are you
>sure you tried
>
>authorization: cedwards:tmppassd
>
>in your htdig.conf after setting your Basic authorization user name
>and password to that? Are you sure there wasn't something odd before
>this line, like an attribute setting that ended with a single backslash,
>causing this line to get swallowed up?
>
>Be sure you change your user name and password to something else, if these
>are literally what you used. Remember you posted these to a public forum.
>
>--
>Gilles R. Detillieux E-mail: <[EMAIL PROTECTED]>
>Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/~grdetil
>Dept. Physiology, U. of Manitoba Phone: (204)789-3766
>Winnipeg, MB R3E 3J7 (Canada) Fax: (204)789-3930
_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html