[13918] in Perl-Users-Digest
No subject found in mail header
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 10 17:47:58 1999
Date: Mon, 8 Nov 1999 12:58:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942094695-v9-i1314@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 8 Nov 1999 Volume: 9 Number: 1314
Today's topics:
Re: Problem using Expect.pm <rootbeer@redcat.com>
Re: Problem using Expect.pm <cassell@mail.cor.epa.gov>
Re: Problem using Expect.pm <willmurat@my-deja.com>
Re: Problem with eval and lexical scoping (Kragen Sitaker)
Re: Problem with perl and MSIE5 <mehkri@yahoo.com>
Re: Problem with perl and MSIE5 <lr@hpl.hp.com>
Re: Problem with perl and MSIE5 <dan@tuatha.sidhe.org>
Re: Problem with perl and MSIE5 (Alan Curry)
Re: Problem with perl and MSIE5 <flavell@a5.ph.gla.ac.uk>
Re: Problem with perl and MSIE5 <cassell@mail.cor.epa.gov>
Re: Problem with perl and MSIE5 (Abigail)
Re: Problem with perl and MSIE5 (Martien Verbruggen)
Problems with form submission <who@mx3.redestb.es>
Re: Problems with form submission <gellyfish@gellyfish.com>
Re: proposed "??" operator causing ambiguous syntax (Bart Lateur)
Re: proposed "??" operator causing ambiguous syntax (Ilya Zakharevich)
Re: proposed "??" operator causing ambiguous syntax (Bart Lateur)
Protecting a file <graeme@sandwell98.freeserve.co.uk>
Re: Protecting a file (Abigail)
Re: Protecting a file (Kragen Sitaker)
Re: Protecting a file <gellyfish@gellyfish.com>
Re: Protecting a file (Craig Berry)
Re: Protecting a file <webmaster@mendonet.com>
ps command in Perl <cingram-at-pjocs-dot-demon-dot-co-dot-uk>
Re: ps command in Perl <gellyfish@gellyfish.com>
Re: ps command in Perl raju_k@iname.com
Re: ps command in Perl <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 5 Nov 1999 12:34:32 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Problem using Expect.pm
Message-Id: <Pine.GSO.4.10.9911051233050.29670-100000@user2.teleport.com>
On Fri, 5 Nov 1999, William wrote:
> I'm trying to use Expect.pm in a setuid program to changes passwords
> in a Web Page.
You're not the first; you won't be the last. But be vewwy vewwy careful.
> Insecure dependency in exec while running setuid at
> /usr/local/lib/perl5/site_perl/5.005/Expect.pm line 84
Have you seen what perldiag has to say about this message? Hope this
helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 05 Nov 1999 14:28:11 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Problem using Expect.pm
Message-Id: <382359FB.1FAC8EF1@mail.cor.epa.gov>
William wrote:
[snip]
> And I got this message:
>
> Insecure dependency in exec while running setuid at
> /usr/local/lib/perl5/site_perl/5.005/Expect.pm line 84
Ooh, you're going to kick yourself when I tell you this.
It's in the perldiag page. All the Perl error messages
and their meanings are catalogued there. If you look up
this one (using, say, perldoc) you will find this:
(F) You tried to do something that the tainting mechanism didn't like. The
tainting mechanism is turned on when you're running setuid or setgid, or when
you specify -T to turn it on explicitly. The tainting mechanism labels all data
that's derived directly or indirectly from the user, who is considered to be
unworthy of your trust. If any such data is used in a ``dangerous'' operation,
you get this error. See perlsec for more information.
So read the perlsec page and learn more about tainting.
It's worth taking the time.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 08 Nov 1999 11:51:12 GMT
From: William <willmurat@my-deja.com>
Subject: Re: Problem using Expect.pm
Message-Id: <806dfg$psk$1@nnrp1.deja.com>
Thaks for the help! I'm just a newbie in Perl and your advices will help
me.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 07 Nov 1999 23:50:18 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Problem with eval and lexical scoping
Message-Id: <_eoV3.54803$23.2034233@typ11.nn.bcandid.com>
In article <FIsBH1.1Ds@news.boeing.com>,
Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
>In article <37eff311.0@news.victoria.tc.ca>,
>Cody Jones <ua025@vtn1.victoria.tc.ca> wrote:
>> my $outer_eval = '{ my $x = 1; eval \'print $x\'; }';
>> eval $outer_eval;
>
>Works in 5.005_03 as previously noted, but with 5.004_04
>the following slight change works too:
>
> my $outer_eval = '{ my $x = 1; eval "print $x" }';
That is not a slight change. That is a radical change. $x gets
interpolated now during the outer eval.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Fri, 5 Nov 1999 05:20:40 -0800 (PST)
From: Mohammad Akram Ali Mehkri <mehkri@yahoo.com>
To: "comp.lang.perl.misc@list.deja.com" <comp.lang.perl.misc@list.deja.com>
Subject: Re: Problem with perl and MSIE5
Message-Id: <19991105132040.13403.rocketmail@web215.mail.yahoo.com>
Check the http header that u r writing.
It should either be
print "Content-type:text/html\015\012\015\012";
print "Content-type:text/html\n\r\n\r";
--- "apogee101@my-deja.com" <apogee101@my-deja.com> wrote:
> Message from the Deja.com forum:
> comp.lang.perl.misc
> Your subscription is set to individual email delivery
> >
> Might be sort of a newbie question, if it is, I'm sorry ...
>
> I'm fairly new to the field of CGI programming with perl, and I've now
> successfully written my script, It's called by a form, and delivers back
> a http/HTML page. If I call it from the form in NS4, it works fine.
>
> However, if I call it in MSIE5 from that same form, instead of
> displaying the generated HTML document, the browser first warns me that
> I'm trying to download a file called "myscript.pl" or "myscript.cgi",
> I've tried both, and then opens the raw HTML text in Notepad.
>
> Can anybody tell me what stupid mistake I'm making?
>
> Kind regards,
> Mike
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
>
>
> _____________________________________________________________
> Deja.com: Before you buy.
> http://www.deja.com/
> * To modify or remove your subscription, go to
> http://www.deja.com/edit_sub.xp?group=comp.lang.perl.misc
> * Read this thread at
> http://www.deja.com/thread/%3C7vkim4%24agr%241%40nnrp1.deja.com%3E
>
>
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 5 Nov 1999 09:40:08 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Problem with perl and MSIE5
Message-Id: <MPG.128cb6547083e58798a1b8@nntp.hpl.hp.com>
In article <19991105132040.13403.rocketmail@web215.mail.yahoo.com> on
Fri, 5 Nov 1999 05:20:40 -0800 (PST), Mohammad Akram Ali Mehkri
<mehkri@yahoo.com> says...
> Check the http header that u r writing.
Whether or not English is your native tongue, you should know that we
use it in this newsgroup, not k3wl d00d tawk.
> It should either be
> print "Content-type:text/html\015\012\015\012";
> print "Content-type:text/html\n\r\n\r";
Four errors in two lines is a pretty good ratio.
The RFC for HTTP requires a space after the colon, though some browsers
will accept this garbage.
Writing "Content-type: text/html\n\n" is perfectly acceptable from Unix
and Windows/DOS platforms, at least, and probably all platforms (which I
can't test).
Except on a Mac, if I understand it, the representation of "\n" is
"\012" and of "\r" is "\015", so you have the last line backwards, and
shouldn't use it in any case.
Thank you for sharing!
> --- "apogee101@my-deja.com" <apogee101@my-deja.com> wrote:
> > Message from the Deja.com forum:
> > comp.lang.perl.misc
> > Your subscription is set to individual email delivery
<SNIP, SNIP, SNIP> Oh, well...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 05 Nov 1999 18:07:45 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Problem with perl and MSIE5
Message-Id: <R1FU3.2178$c06.15354@news.rdc1.ct.home.com>
Larry Rosler <lr@hpl.hp.com> wrote:
> Writing "Content-type: text/html\n\n" is perfectly acceptable from Unix
> and Windows/DOS platforms, at least, and probably all platforms (which I
> can't test).
Strictly speaking it's wrong. \n gets you a bare linefeed on Unix, which
isn't a valid HTTP line terminator. The standard says lines end with the
two-octet sequence \0x0D\0x0A. Most servers'll accept this since it's
painfully common, but it's still incorrect...
Dan
------------------------------
Date: Fri, 05 Nov 1999 19:14:09 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Problem with perl and MSIE5
Message-Id: <50GU3.31605$23.1652827@typ11.nn.bcandid.com>
In article <R1FU3.2178$c06.15354@news.rdc1.ct.home.com>,
Dan Sugalski <dan@tuatha.sidhe.org> wrote:
>Strictly speaking it's wrong. \n gets you a bare linefeed on Unix, which
>isn't a valid HTTP line terminator. The standard says lines end with the
>two-octet sequence \0x0D\0x0A. Most servers'll accept this since it's
>painfully common, but it's still incorrect...
Who told you that the protocol by which a web server talks to a CGI program
is same as the protocol by which a web server talks to an HTTP client?
--
Alan Curry |Declaration of | _../\. ./\.._ ____. ____.
pacman@cqc.com|bigotries (should| [ | | ] / _> / _>
--------------+save some time): | \__/ \__/ \___: \___:
Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman
------------------------------
Date: Fri, 5 Nov 1999 20:29:54 +0000
From: "Alan J. Flavell" <flavell@a5.ph.gla.ac.uk>
Subject: Re: Problem with perl and MSIE5
Message-Id: <Pine.OSF.4.20.9911051950450.11528-100000@a5.ph.gla.ac.uk>
On Fri, 5 Nov 1999, Dan Sugalski wrote:
> Larry Rosler <lr@hpl.hp.com> wrote:
>
> > Writing "Content-type: text/html\n\n" is perfectly acceptable from Unix
> > and Windows/DOS platforms, at least, and probably all platforms (which I
> > can't test).
>
> Strictly speaking it's wrong. \n gets you a bare linefeed on Unix, which
> isn't a valid HTTP line terminator.
But a CGI script is writing a CGI response, not an HTTP response, so
you should be looking in the CGI specification, not in the HTTP
specification, for enlightenment.
(And by the way, if I may say so - well, I have said so before - there
are several points where the existing Perl CGI-related FAQs seem to
muddle up these issues too. Sometimes I'm tempted to suggest to their
respected authors that they should remove them from the Perl FAQs, and
offer them to the CGI authoring group for peer review instead. But
that might seem rude...)
> The standard says lines end with the
> two-octet sequence \0x0D\0x0A.
Well, the traditional NSCA CGI spec was quite vague on this, as I
recall, so perhaps it would be more productive to consult the draft
RFC:
http://web.golux.com/coar/cgi/draft-coar-cgi-v11-03-clean.html
Looking now at 7.1 Non-Parsed Header Output:
Scripts using the NPH output form MUST return a complete HTTP response
message, as described in Section 6 of the HTTP specifications [3,8].
In _this_ (i.e the NPH) case, I'd say your strictures apply.
However, the more common and convenient case would be 7.2 Parsed
Header Output: here, all the lines are documented to be terminated
by "NL", and what that means is codified in the BNF rules earlier on:
NL = CR | LF
Note that this flatly contradicts the grumblings in perlfaq9 "How do I
redirect to another page?". (I really think that short article needs
to be put up for peer review in the CGI community. I can see at least
three things wrong with it, one of which is this muddled stuff about
newline representations).
> Most servers'll accept this since it's
> painfully common, but it's still incorrect...
Seems not. What one might say in respect of NON-parsed output is that
"most _clients_ will accept this, because, although the HTTP
specification lays down that it is incorrect for a server to send it,
it also recommends client implementers to tolerate it". (See RFC2616
section 19.3).
But in the case of parsed headers, the _script_ sends output according
to the CGI specification, and it's the job of the _server_ to ensure
that any HTTP headers that it generates based on the CGI response are
in conformance with the HTTP specification. If the server fails to do
that, then it would be a bug in the server, and not a failure on the
part of the CGI script, unless you reject that draft CGI RFC on this
point.
ttfn
------------------------------
Date: Fri, 05 Nov 1999 17:24:03 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
To: A.Flavell@physics.gla.ac.uk
Subject: Re: Problem with perl and MSIE5
Message-Id: <38238333.B1FD987D@mail.cor.epa.gov>
[courtesy cc emailed to poster]
Alan J. Flavell wrote:
[snip]
> (And by the way, if I may say so - well, I have said so before - there
> are several points where the existing Perl CGI-related FAQs seem to
> muddle up these issues too. Sometimes I'm tempted to suggest to their
> respected authors that they should remove them from the Perl FAQs, and
> offer them to the CGI authoring group for peer review instead. But
> that might seem rude...)
Possibly rude, but don't you think that exposure to this
newsgroup will have beaten the sensitivity out of them? :-)
Really, I think you should thake this up with TomC and get
the answers to these posts cleaned up. What's the point of
having FAQs with bad advice in them? I can give bad advice
all by myself.
This post may count in that category.
> Note that this flatly contradicts the grumblings in perlfaq9 "How do I
> redirect to another page?". (I really think that short article needs
> to be put up for peer review in the CGI community. I can see at least
> three things wrong with it, one of which is this muddled stuff about
> newline representations).
See? You do need to get these FAQs corrected. This issue
shows up here way too often and wrong answers are always
bandied about, in amongst the right ones.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 5 Nov 1999 20:14:09 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Problem with perl and MSIE5
Message-Id: <slrn8273ug.dk.abigail@alexandra.delanet.com>
Dan Sugalski (dan@tuatha.sidhe.org) wrote on MMCCLVII September MCMXCIII
in <URL:news:R1FU3.2178$c06.15354@news.rdc1.ct.home.com>:
__ Larry Rosler <lr@hpl.hp.com> wrote:
__
__ > Writing "Content-type: text/html\n\n" is perfectly acceptable from Unix
__ > and Windows/DOS platforms, at least, and probably all platforms (which I
__ > can't test).
__
__ Strictly speaking it's wrong. \n gets you a bare linefeed on Unix, which
__ isn't a valid HTTP line terminator. The standard says lines end with the
__ two-octet sequence \0x0D\0x0A. Most servers'll accept this since it's
__ painfully common, but it's still incorrect...
True if you send it straight down the wire. But for >95% of the programs,
the output isn't send down to the browser, but to the server, which ought
to do the \n -> \x0D\x0A translation.
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 6 Nov 1999 03:50:22 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Problem with perl and MSIE5
Message-Id: <slrn8279e5.5vv.mgjv@wobbie.heliotrope.home>
On Fri, 5 Nov 1999 20:29:54 +0000,
Alan J. Flavell <flavell@a5.ph.gla.ac.uk> wrote:
> Note that this flatly contradicts the grumblings in perlfaq9 "How do I
> redirect to another page?". (I really think that short article needs
> to be put up for peer review in the CGI community. I can see at least
> three things wrong with it, one of which is this muddled stuff about
> newline representations).
Naw, we shouldn't even have it in the FAQ. Redirections and stuff like
that belong in the CGI or HTTP or whatever FAQ. _Not_ in the Perl FAQ.
Martien
--
Martien Verbruggen |
Interactive Media Division | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Fri, 5 Nov 1999 18:03:52 +0100
From: "WhoIs" <who@mx3.redestb.es>
Subject: Problems with form submission
Message-Id: <7vv2h9$2h11@SGI3651ef0.iddeo.es>
I'm trying to submit an HTML form from a perl script, by the way explained
in the recipe 20.2 of the Perl Cookbook by Christiansen & Torkington, but I
can't. The form is ever submitted, but if I put the URL with the params in
the form like GET method does
(mydomain.com/cgi-local/my_cgi_program.pl?arg1=value1&arg2=value2& ...), the
form is submitted correctly.
What can I do to submit the form from the script?
TIA.
Josep Ruano Bou.
------------------------------
Date: 6 Nov 1999 11:58:29 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Problems with form submission
Message-Id: <801555$a6b$1@gellyfish.btinternet.com>
On Fri, 5 Nov 1999 18:03:52 +0100 WhoIs wrote:
> I'm trying to submit an HTML form from a perl script, by the way explained
> in the recipe 20.2 of the Perl Cookbook by Christiansen & Torkington, but I
> can't. The form is ever submitted, but if I put the URL with the params in
> the form like GET method does
> (mydomain.com/cgi-local/my_cgi_program.pl?arg1=value1&arg2=value2& ...), the
> form is submitted correctly.
> What can I do to submit the form from the script?
>
There are two code snippets in that section of the Cookbook - it is difficult
to know what to say unless we know which method you are trying. Perhaps
you might care to show us the code that you have that doesnt work .
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Fri, 05 Nov 1999 20:54:28 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: proposed "??" operator causing ambiguous syntax
Message-Id: <3823416e.773618@news.skynet.be>
Tom Phoenix wrote:
>Yes. Still, since you had to search and search to find this one example,
>there's not much chance that any real-world program will suffer from this
>ambiguity. Thus, if the _only_ argument against this operator were this
>weak one, no one should have a problem with it.
Well, I couldn't find an example at the time. So I forgot about it. The
recent discussion stirred it up again, and I found this example in under
half a minute. Not "that long", I'd say.
But anyway, the problem is real. Whenever you have a "??" operator
followed by a "?:" contruct, you have the problem. *It doesn't even have
to be in the same statement*, or one the same line, so no, it wouldn't
be very uncommon. Look at this innocent-looking example:
$x = $y ?? $z; $a = $b; $c = $d?-1:1;
The pattern is a rather long one, starting from the second question mark
till the last one.
There's no way you can releave the ambiguity with adding whitespace.
You'd only change the "pattern".
OTOH, you can get rid of the ambiguity if you do want the pattern match,
by separating the first and the second question mark with a space. So if
the ambiguity must stay in the syntax, I'd be in favour of the "??"
operator over the currently recognized syntax with the pattern. I think
this kind of pattern match is very rarely used anyway.
--
Bart.
------------------------------
Date: 5 Nov 1999 22:49:56 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: proposed "??" operator causing ambiguous syntax
Message-Id: <7vvmuk$82j$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Bart Lateur
<bart.lateur@skynet.be>],
who wrote in article <3823416e.773618@news.skynet.be>:
> But anyway, the problem is real.
It is not.
> Whenever you have a "??" operator
> followed by a "?:" contruct, you have the problem. *It doesn't even have
> to be in the same statement*, or one the same line, so no, it wouldn't
> be very uncommon. Look at this innocent-looking example:
>
> $x = $y ?? $z; $a = $b; $c = $d?-1:1;
This is ?? operator.
$x = $y ? ? $z; $a = $b; $c = $d?-1:1;
This is not. Perl always (? at least Larry thinks so) picks up a
longest operator if there is a choice. There is no more ambiguity
than in (1..2).
> OTOH, you can get rid of the ambiguity if you do want the pattern match,
> by separating the first and the second question mark with a space. So if
> the ambiguity must stay in the syntax, I'd be in favour of the "??"
> operator over the currently recognized syntax with the pattern. I think
> this kind of pattern match is very rarely used anyway.
Well, frankly speaking, I know *no* cases when ?match? is of slightest
use. Only thing it does is confusing error message if you mixup your ?:.
Ilya
------------------------------
Date: Sat, 06 Nov 1999 10:09:07 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: proposed "??" operator causing ambiguous syntax
Message-Id: <3824f428.6037630@news.skynet.be>
Ilya Zakharevich wrote:
>> $x = $y ?? $z; $a = $b; $c = $d?-1:1;
>
>This is ?? operator.
>
> $x = $y ? ? $z; $a = $b; $c = $d?-1:1;
>
>This is not. Perl always (? at least Larry thinks so) picks up a
>longest operator if there is a choice. There is no more ambiguity
>than in (1..2).
It IS ambiguous. You just stated that there's a general rule for how
Perl solves these ambiguities.
Another currently existing example of ambiguity is
$a+++$b
Is that { $a++ + $b } or { $a + ++$b }? According to your claim it must
be the former. According to a test, it is.
($a,$b) = (10,20);
$x = $a+++$b;
print "$x $a $b\n";
-->
30 11 20
So $a got updated.
>Well, frankly speaking, I know *no* cases when ?match? is of slightest
>use. Only thing it does is confusing error message if you mixup your ?:.
:-)
It's not essential. For practical purposes, you can get by, using ".."
in scalar context, as in this substitute for the example given in perlop
in theentry for ?PATTERN? :
while(<>) {
if(($first=/^$/) .. ($last = eof || 0)) {
# on or following first empty line
print "$first $last : $_";
$first = 0; #clear flag
}
}
Works too, if the first empty line happens to be the last line in a
file.
--
Bart.
------------------------------
Date: Sat, 6 Nov 1999 19:29:41 -0000
From: "Graeme Sandwell" <graeme@sandwell98.freeserve.co.uk>
Subject: Protecting a file
Message-Id: <802087$8vk$1@news7.svr.pol.co.uk>
Hi,
On my web server there are data files which contain email addresses in them,
which are used as a mailing list. What is the best way of protecting them
from the robots which scan files for spamming or from people accessing them?
An .htaccess file or some sort of encryption. I am using Perl 5 on a Lynix
server.
Please help!
Graeme :-)
------------------------------
Date: 6 Nov 1999 13:58:46 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Protecting a file
Message-Id: <slrn8292ak.2i1.abigail@alexandra.delanet.com>
Graeme Sandwell (graeme@sandwell98.freeserve.co.uk) wrote on MMCCLVIII
September MCMXCIII in <URL:news:802087$8vk$1@news7.svr.pol.co.uk>:
()
() On my web server there are data files which contain email addresses in them,
() which are used as a mailing list. What is the best way of protecting them
() from the robots which scan files for spamming or from people accessing them?
$ > file
Or, just remove the file from the server. If you don't want people
to access it, what it's doing there?
() An .htaccess file or some sort of encryption. I am using Perl 5 on a Lynix
() server.
Lynix server? Perhaps you are confused with the Lynx browser?
Anyway, this has nothing to do with Perl. Don't ask in this group.
Abigail
--
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sat, 06 Nov 1999 20:24:40 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Protecting a file
Message-Id: <c80V3.48757$23.1844964@typ11.nn.bcandid.com>
In article <802087$8vk$1@news7.svr.pol.co.uk>,
Graeme Sandwell <graeme@sandwell98.freeserve.co.uk> wrote:
>On my web server there are data files which contain email addresses in them,
>which are used as a mailing list. What is the best way of protecting them
>from the robots which scan files for spamming or from people accessing them?
Take them off the web server, or move them out of public_html or
wherever your web server serves from.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 6 Nov 1999 20:34:20 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Protecting a file
Message-Id: <8023cc$bok$1@gellyfish.btinternet.com>
On Sat, 6 Nov 1999 19:29:41 -0000 Graeme Sandwell wrote:
> Hi,
>
> On my web server there are data files which contain email addresses in them,
> which are used as a mailing list. What is the best way of protecting them
> from the robots which scan files for spamming or from people accessing them?
>
Dont put them anywhere they can be accessed. If you are simply worried
about robots you might look at the information on this subject -
<http://info.webcrawler.com/mak/projects/robots/robots.html>
> An .htaccess file or some sort of encryption. I am using Perl 5 on a Lynix
> server.
Of course Perl is nothing to do with any of this - you might want to ask
in a group that is concerned with web server administration.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 07 Nov 1999 08:49:17 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Protecting a file
Message-Id: <s2af8dbc531@corp.supernews.com>
Graeme Sandwell (graeme@sandwell98.freeserve.co.uk) wrote:
: On my web server there are data files which contain email addresses in them,
: which are used as a mailing list. What is the best way of protecting them
: from the robots which scan files for spamming or from people accessing them?
Just put them somewhere that the 'bots can't see, outside the htdocs tree.
Presumably you're not putting raw lists of email addrs out on the web,
right? This presumably feeds some sort of app. The appp can use them
anywhere in the local file system.
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: Sun, 07 Nov 1999 18:11:08 -0800
From: Jon Hollcraft <webmaster@mendonet.com>
To: Graeme Sandwell <graeme@sandwell98.freeserve.co.uk>
Subject: Re: Protecting a file
Message-Id: <3826313C.7189@mendonet.com>
Graeme Sandwell wrote:
>
> Hi,
>
> On my web server there are data files which contain email addresses in them,
> which are used as a mailing list. What is the best way of protecting them
> from the robots which scan files for spamming or from people accessing them?
>
> An .htaccess file or some sort of encryption. I am using Perl 5 on a Lynix
> server.
>
> Please help!
>
> Graeme :-)
Just suggestions:
A. chmod to 0660 so that the file is not world readable. If it is
stashed in your cgi directories, Group should still have access.
B. Some servers protect .dat files with a "Document contains no data"
error message if someone guesses the actual name of the file and types
it into a URI.
C. As far as I know, bots only pull world readable URI's. If I'm wrong
I'm sure I'll hear about it, and learn something.
D. Plunk in what I've coined a trapdoor. Save the meta below as
index.html and stash it in directorys where you want to divert snoops.
Other URI's can be pretty creative. This one just shows the browser
machine's c: drive.
<meta http-equiv="Refresh" content="0; URL=file:///C:/">
Ya gotta have a little fun once in a while.
Jon
------------------------------
Date: Fri, 5 Nov 1999 09:51:32 -0000
From: "Clyde Ingram" <cingram-at-pjocs-dot-demon-dot-co-dot-uk>
Subject: ps command in Perl
Message-Id: <941819852.12289.0.nnrp-12.9e98e5bc@news.demon.co.uk>
Can anyone suggest how to implement the Unix ps command in Perl?
A quick glance at Perl command related to processes does not show me
anything that lets me find the process ID of a given process command.
And the Unix Reconstruction Project does not adverise a Perl equivalent.
Any pointers/suggestions would be appreciated. Thank-you.
Clyde Ingram
------------------------------
Date: 5 Nov 1999 16:55:02 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: ps command in Perl
Message-Id: <38230be6_2@newsread3.dircon.co.uk>
Clyde Ingram <cingram-at-pjocs-dot-demon-dot-co-dot-uk> wrote:
> Can anyone suggest how to implement the Unix ps command in Perl?
>
> A quick glance at Perl command related to processes does not show me
> anything that lets me find the process ID of a given process command.
>
> And the Unix Reconstruction Project does not adverise a Perl equivalent.
>
> Any pointers/suggestions would be appreciated. Thank-you.
>
Dont bother it is impossible to do in any platfrom independent fashion.
If you need to get process information in a Perl program use the backticks
chomp(@ps = grep {!/UID/} `ps -ef`);
/J\
--
"Mr Creutzfeldt and Mr Jakob: No-one had ever heard of these two eminent
medical men until someone had the
------------------------------
Date: Fri, 05 Nov 1999 21:17:25 GMT
From: raju_k@iname.com
Subject: Re: ps command in Perl
Message-Id: <7vvhh1$9ga$1@nnrp1.deja.com>
I played around with this a while back and it works on both linux and
solaris, at least ...
http://www.cpan.org/authors/id/D/DU/DURIST/Proc-ProcessTable-0.23.tar.gz
--raju
In article <941819852.12289.0.nnrp-12.9e98e5bc@news.demon.co.uk>,
"Clyde Ingram" <cingram-at-pjocs-dot-demon-dot-co-dot-uk> wrote:
> Can anyone suggest how to implement the Unix ps command in Perl?
>
> A quick glance at Perl command related to processes does not show me
> anything that lets me find the process ID of a given process command.
>
> And the Unix Reconstruction Project does not adverise a Perl
equivalent.
>
> Any pointers/suggestions would be appreciated. Thank-you.
>
> Clyde Ingram
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 6 Nov 1999 11:27:05 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: ps command in Perl
Message-Id: <8013aa$a3h$1@gellyfish.btinternet.com>
On 5 Nov 1999 16:55:02 GMT Jonathan Stowe wrote:
> Clyde Ingram <cingram-at-pjocs-dot-demon-dot-co-dot-uk> wrote:
>> Can anyone suggest how to implement the Unix ps command in Perl?
>>
>
> Dont bother it is impossible to do in any platfrom independent fashion.
>
Oh I got bored so for a pre-breakfast warmup I knocked out this :
#!/usr/bin/perl -w
use strict;
my $procdir = '/proc' ; #
my @proctable;
opendir(PROCS,$procdir) || die "Can't open $procdir - $!\n";
my @procs = grep /\d+/, readdir(PROCS);
closedir(PROCS);
foreach my $process ( @procs)
{
open CMD, "$procdir/$process/cmdline" or next;
my $cmdline = <CMD>;
close CMD;
open STAT, "$procdir/$process/status" or next;
my %status = map { split /:\t+/ } <STAT>;
close STAT;
chomp($status{Uid} = (split /\s+/,$status{Uid})[0]);
my $user = getpwuid($status{Uid});
chomp $status{PPid};
chomp $status{State};
chomp $status{Name};
$cmdline ||= $status{Name};
$cmdline =~ tr/\x0/ /;
push @proctable , [$process, $status{PPid},$user,$status{State},$cmdline ];
}
foreach (@proctable)
{
print $_->[2],"\t",$_->[0],"\t",$_->[1],"\t",$_->[3],"\t",$_->[4],"\n";
}
This is only guranteed to work on Linux 2.2.0 kernel or later. The observant
will notice that I cheated by using 'status' as opposed to 'stat' but I
discovered that the manpage differed from the reality and was in danger
of getting bogged down in the source code for the real 'ps'.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1314
**************************************