Re: crypt() under windows

2000-04-19 Thread Rusty Foster

Meta comment: should replies here go to the list by default? I keep
replying only to the author by accident, when I meant to reply only to
the list. This has probably been discussed before... Anyway:

Matt Sergeant wrote:
> 
> On Wed, 19 Apr 2000, Tim Bishop wrote:
> 
> >
> > Hi-
> >
> > We used Martin Vorlaender's Crypt::UnixCrypt module for the same reason
> > you need it - no crypt() on Windows.
> 
> Nonesense. Read README.win32 before building your perl.

Whether it's true or not, if you're going to use crypt() in an
application that you want to have some prayer of being easily
cross-platform, Crypt::UnixCrypt is the way to go. I had trouble moving
my stuff from redhat linux to slackware and FreeBSD, because it's
possible to set up the systems without crypt() (or with a crypt() that
doesn't behave even similarly to the RH linux version, in the case of
BSD). Basically, it's usually pretty important that crypt() work
predictably in your application, if you're going to use it, and at least
a perl-only implementation is predicatable across platforms.

--R


-- 
===
|  Rusty Foster   | "You can never entirely stop being what   |
|   [EMAIL PROTECTED]| you once were. That's why it's important  |
|[EMAIL PROTECTED]  | to be the right person today, and not put |
| http://www.kuro5hin.org | it off till tomorrow."-Larry Wall |
===



Apache::Scoreboard won't compile...

2000-04-16 Thread Rusty Foster

I'm at a loss as to what to do here... 

The system in question: 
slackware 7, 
Apache 1.3.12, 
mod_perl 1.22,
perl 5.005_03
Apache::Scoreboard 0.10

Here's what happens when I run make (perl Makefile.PL runs fine):

[mkdir blib stuff...]
cp lib/Apache/ScoreboardGraph.pm blib/lib/Apache/ScoreboardGraph.pm
cp Scoreboard.pm blib/lib/Apache/Scoreboard.pm
make[1]: Entering directory `/usr/src/Apache-Scoreboard-0.10/Dummy'
mkdir ../blib/arch/auto/Apache/DummyScoreboard
mkdir ../blib/lib/auto/Apache/DummyScoreboard
cp DummyScoreboard.pm ../blib/lib/Apache/DummyScoreboard.pm
/usr/bin/perl -I/usr/lib/perl5/i386-linux -I/usr/lib/perl5
/usr/lib/perl5/ExtUtils/xsubpp  -typemap /usr/lib/perl5/ExtUtils/typemap
-typemap /usr/lib/perl5/site_perl/i386-linux/auto/Apache/typemap
-typemap typemap DummyScoreboard.xs >xstmp.c && mv xstmp.c
DummyScoreboard.c
Please specify prototyping behavior for DummyScoreboard.xs (see perlxs
manual)
cc -c -I../ -I/usr/lib/perl5/site_perl/i386-linux/auto/Apache/include
-I/usr/lib/perl5/site_perl/i386-linux/auto/Apache/include/modules/perl
-I/usr/lib/perl5/site_perl/i386-linux/auto/Apache/include/include
-I/usr/lib/perl5/site_perl/i386-linux/auto/Apache/include/regex
-I/usr/lib/perl5/site_perl/i386-linux/auto/Apache/include/os/unix
-I/include -I/usr/local/apache/include -Dbool=char -DHAS_BOOL
-I/usr/local/include -O2-DVERSION=\"0.04\" -DXS_VERSION=\"0.04\"
-fpic -I/usr/lib/perl5/i386-linux/CORE  DummyScoreboard.c
In file included from DummyScoreboard.xs:2:
/usr/lib/perl5/site_perl/i386-linux/auto/Apache/include/include/scoreboard.h:150:
field `start_time' has incomplete type
/usr/lib/perl5/site_perl/i386-linux/auto/Apache/include/include/scoreboard.h:151:
field `stop_time' has incomplete type
make[1]: *** [DummyScoreboard.o] Error 1
make[1]: Leaving directory `/usr/src/Apache-Scoreboard-0.10/Dummy'
make: *** [subdirs] Error 2


Note in particular the "Please specify prototyping behavior for
DummyScoreboard.xs" and the "incomplete type" warnings. Does anyone know
what this problem is, or even know where I should start looking? Thanks
in advance.

--R
-- 
=======
|  Rusty Foster   | "You can never entirely stop being what   |
|   [EMAIL PROTECTED]| you once were. That's why it's important  |
|[EMAIL PROTECTED]  | to be the right person today, and not put |
| http://www.kuro5hin.org | it off till tomorrow."-Larry Wall |
===



Re: [slightly OT] Problem with cookies

2000-04-07 Thread Rusty Foster

Oops. Meant to send this to the list. :-)


Bill Moseley wrote:
> 
> At 07:29 PM 04/06/00 -0400, Rusty Foster wrote:
> >What I ended up doing was targeting cookies at a host (i.e.
> >domain=www.kuro5hin.org), and setting up VirtualHost sections as
> >follows:
> >
> >NameVirtualHost 216.181.35.174  # IP of www.kuro5hin.org
> >
> ># Redirect all hostless requests to www VHost
> >
> >ServerName kuro5hin.org
> >Redirect permanent / http://www.kuro5hin.org/
> >
> >
> ># Proper URI for www.kuro5hin.org
> >
> >  ServerName www.kuro5hin.org
> >  ...etc...
> >
> 
> Why not reverse the order of these virtual host sections so people without
> a Host: host go to the www.huro5hin.org virtual host?  Their URL will read
> wrong, but not much you can do about that.
> 

That's how it was originally, and they went to the right VHost, *BUT*
you recall that the original problem was cookies. I had to target my
cookies to 'www.kuro5hin.org', because there are other virtual hosts in
the same domain that get a different cookie with the same name. They
need to be distinguished by hostname, and the browser won't send a
cookie targeted at 'www.kuro5hin.org' to 'kuro5hin.org'. Hence, the URL
has to read right, for everything to work.

--R

> Bill Moseley
> mailto:[EMAIL PROTECTED]

-- 
===
|  Rusty Foster   | "You can never entirely stop being what   |
|   [EMAIL PROTECTED]| you once were. That's why it's important  |
|[EMAIL PROTECTED]  | to be the right person today, and not put |
| http://www.kuro5hin.org | it off till tomorrow."-Larry Wall |
===



Re: [slightly OT] Problem with cookies

2000-04-06 Thread Rusty Foster

> At 05:29 PM 04/06/00 -0400, you wrote:
> >Kee,
> >
> >I'm about to that point. What is the easiest way to do this? I have one
> >IP for the domain. Should I have my scripts check SERVER_NAME & do a
> >redirect? BTW, I have complete control over the box so I can do what I
> >want. :-)
> >

I think whoever said that http://cloudstock.com/ doesn't match
.cloudstock.com might be right.

I had a similar problem with cookies on kuro5hin.org. I needed to set a
session=blah cookie for www.kuro5hin.org, and a *different* session
cookie for scoop.kuro5hin.org. So I couldn't use .kuro5hin.org as the
domain. But I wanted people who came to http://kuro5hin.org/ to go to
www.kuro5hin.org by default.

What I ended up doing was targeting cookies at a host (i.e.
domain=www.kuro5hin.org), and setting up VirtualHost sections as
follows:

NameVirtualHost 216.181.35.174  # IP of www.kuro5hin.org

# Redirect all hostless requests to www VHost

ServerName kuro5hin.org
Redirect permanent / http://www.kuro5hin.org/


# Proper URI for www.kuro5hin.org

  ServerName www.kuro5hin.org
  ...etc...


This way, people who come in to http://kuro5hin.org/ get redirected
right off the bat, and so far this seems to have solved the problem.

--R

PS- General comment: Cookies are a neat idea, but good lord are they
ever a PITA to implement. :-/

-- 
=======
|  Rusty Foster   | "You can never entirely stop being what   |
|   [EMAIL PROTECTED]| you once were. That's why it's important  |
|[EMAIL PROTECTED]  | to be the right person today, and not put |
| http://www.kuro5hin.org | it off till tomorrow."-Larry Wall |
===