[17701] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5121 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 15 09:05:31 2000

Date: Fri, 15 Dec 2000 06:05:09 -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: <976889109-v9-i5121@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 15 Dec 2000     Volume: 9 Number: 5121

Today's topics:
    Re: Ada feature borrowed for Perl?? gdemont@my-deja.com
    Re: Ada feature borrowed for Perl?? <jeff_robertson@yahoo.com>
        Attach file in email? <lars_lars@home.se>
    Re: CGI und Perl-Spezialisten gegen Bezahlung gesucht (Csaba Raduly)
        Function from string <dwb1@home.com>
        Function from string <dwb1@home.com>
    Re: Function from string (Garry Williams)
        Help!!!! <salva.perez@ctv-jet.com>
    Re: How to identify Windows platform from within a Perl <jeff_robertson@yahoo.com>
    Re: Is a Hash of Arrays possible? <timallen449@coldmail.com>
    Re: Is a Hash of Arrays possible? <nickco3@yahoo.co.uk>
    Re: ndbm/gdbm problem with Perl 5.6 (Anno Siegel)
        Stripping out meta tags from web pages <tony@codeisland.net>
        Truncated text from a POST operation <steve.jelfs@oracle.com>
    Re: Truncated text from a POST operation (Rafael Garcia-Suarez)
    Re: while(m//g) v.s. while(s///g) <sue@pennine.com>
    Re: Why doesn't this work????? (Location: redirection.. <mtaylorlrim@my-deja.com>
    Re: Windows cant recognize the original owner <NoJunkMail&Klaus.L@attglobal.net>
    Re: Windows cant recognize the original owner <Alessandro.Augusto@br.bosch.com>
    Re: Windows cant recognize the original owner <mnd2@ukc.ac.uk>
    Re: xml parser <mrodrigu@mirlin.xmltwig.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 15 Dec 2000 11:11:48 GMT
From: gdemont@my-deja.com
Subject: Re: Ada feature borrowed for Perl??
Message-Id: <91cu9j$kkl$1@nnrp1.deja.com>


> Does Ada use 'use' to use packages?

Yep - Ada uses to use 'use' to use packages!

Some sources on page below to take a look...

  http://members.nbci.com/_XMCM/gdemont/gsoft.htm

G.


Sent via Deja.com
http://www.deja.com/


------------------------------

Date: Fri, 15 Dec 2000 13:00:02 GMT
From: Jeff Robertson <jeff_robertson@yahoo.com>
Subject: Re: Ada feature borrowed for Perl??
Message-Id: <91d4kg$p5j$1@nnrp1.deja.com>

In article <vRk_5.5127$UN1.489925@newsread2.prod.itd.earthlink.net>,
  "Misanthrope" <no@spam.net> wrote:
> >
> > Packages ?
> >
>
> I don't think so.  Ada took that idea from Pascal and/or Modula 2
and/or
> Clu.
>

Doesn't matter where Ada's designers got the idea. Ada still could have
been the immediate inspiration for adding it to Perl.

--
"I'm a snotty E-commerce server software coder." - Joona Palaste, c.l.c.
http://www.geocities.com/jeff_robertson


Sent via Deja.com
http://www.deja.com/


------------------------------

Date: Fri, 15 Dec 2000 13:16:12 GMT
From: "Lars Svensson" <lars_lars@home.se>
Subject: Attach file in email?
Message-Id: <wQo_5.574$wz.31406@nntp1.chello.se>

Hello.
I've written a small script to send email from a website. I want to expand
it so I can attach a file and I don't know where to start.
Can someone help me?

regards Lars

--**--**--**--**--

#!/usr/local/bin/perl
use CGI ':standard';
print header('text/html');

open F, ">email" or die "Fel! :$!";
print F "To: " . param('to') . "\n";
print F "From: " . param('from') . "\n";
print F "Subject: " . param('subject') . "\n\n";
print F param('message') . "\n";;
close F;

system('/usr/lib/sendmail -t -oi < email');

print "<html><body><h1>OK!</h1></body></html>";

open(EMAIL, "<email") or die "Bummer...";
while($row = <EMAIL>) {
 $row =~ s/---(.*?)---/eval $1/eg;
 print "$row";
}
close EMAIL;
system("rm ./email");





------------------------------

Date: Fri, 15 Dec 2000 11:07:51 +0000 (UTC)
From: real.email@signature.this.is.invalid (Csaba Raduly)
Subject: Re: CGI und Perl-Spezialisten gegen Bezahlung gesucht
Message-Id: <Xns900B751B8quuxi@194.203.134.135>

[posted and mailed]

And so it came to pass that beatforge@hotmail.com (Beatforge) on 09 Dec 
2000 wrote <3a33f7b4.390907565@news.claranews.com>:

Dies ist ein technischer Gruppe, diskussion über den Programmiersprache 
Perl.

Empfehlung-msg geht in jobs.* Gruppen. 
Deutsch ist schwer :-) Du sollst bessere chancen haben in de.* 

[schnitt]

-- 
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com      http://www.sophos.com/
US Support +1 888 SOPHOS 9      UK Support +44 1235 559933
You are in a maze of twisted little minds, all different.


------------------------------

Date: Fri, 15 Dec 2000 13:11:04 GMT
From: "Daniel W. Burke" <dwb1@home.com>
Subject: Function from string
Message-Id: <Pine.LNX.4.20.0012150757570.5641-100000@ethyl.addictmud.org>


Hello,

We're in the process of taking 160k lines of perl code (scripts
and libraries, 305 files total), and doing some serious fixes to
them... this is code that 80% of it was originally wrote using
perl4, which we finally upgraded to 5 last year...

We're in the process right now of making everything work with a
"-w" and "strict"...  one problem we're having right now though
is, a trick was used to make a line of code call a function
based on a dropdown-box from a form.  It's a hash that looks
like this:

%CUSTOM_FUNCTION = (
  "NEW_AND_UPDATED","GetNewAndUpdated",
  "AVG_TO_CLOSURE","GetAvgToCLosure",
  "AGENT_ACTIVITY","GetAgentActivity",
<---- code snipped ---->
);

Then the function is called like this:

my $CustomFunction = $CUSTOM_FUNCTION{$in{'REPORT_TYPE'}};
&$CustomFunction;

Unfortunatly, when we add strict to the module, we get errors
like this:

Can't use string ("Top_10_Report_Old") as a subroutine ref while
"strict refs" in use at gccStdReportFuncs.pm line 726.

Is there a way we can work around this without removing strict
from that module?  Or maybe just a plain better way of getting
that functionality without creating 20 elsif's on the variable
returned from the form... 

Or is it merely not making use of the "refs" part of "strict"?
I'm not sure what the negatives of doing that would be.

Thanks,
Dan.




------------------------------

Date: Fri, 15 Dec 2000 13:12:37 GMT
From: "Daniel W. Burke" <dwb1@home.com>
Subject: Function from string
Message-Id: <Pine.LNX.4.20.0012150817000.5641-100000@ethyl.addictmud.org>


Sorry if this is a duplicate message... pine gave me an error 
the first time I tried to send it...

Hello,

We're in the process of taking 160k lines of perl code (scripts
and libraries, 305 files total), and doing some serious fixes to
them... this is code that 80% of it was originally wrote using
perl4, which we finally upgraded to 5 last year...

We're in the process right now of making everything work with a
"-w" and "strict"...  one problem we're having right now though
is, a trick was used to make a line of code call a function
based on a dropdown-box from a form.  It's a hash that looks
like this:

%CUSTOM_FUNCTION = (
  "NEW_AND_UPDATED","GetNewAndUpdated",
  "AVG_TO_CLOSURE","GetAvgToCLosure",
  "AGENT_ACTIVITY","GetAgentActivity",
<---- code snipped ---->
);

Then the function is called like this:

my $CustomFunction = $CUSTOM_FUNCTION{$in{'REPORT_TYPE'}};
&$CustomFunction;

Unfortunatly, when we add strict to the module, we get errors
like this:

Can't use string ("Top_10_Report_Old") as a subroutine ref while
"strict refs" in use at gccStdReportFuncs.pm line 726.

Is there a way we can work around this without removing strict
from that module?  Or maybe just a plain better way of getting
that functionality without creating 20 elsif's on the variable
returned from the form... 

Or is it merely not making use of the "refs" part of "strict"?
I'm not sure what the negatives of doing that would be.

Thanks,
Dan.





------------------------------

Date: Fri, 15 Dec 2000 14:03:23 GMT
From: garry@zweb.zvolve.net (Garry Williams)
Subject: Re: Function from string
Message-Id: <Lwp_5.1162$uF3.70466@eagle.america.net>

On Fri, 15 Dec 2000 13:11:04 GMT, Daniel W. Burke <dwb1@home.com> wrote:
>
>Then the function is called like this:
>
>my $CustomFunction = $CUSTOM_FUNCTION{$in{'REPORT_TYPE'}};
>&$CustomFunction;
>
>Unfortunatly, when we add strict to the module, we get errors
>like this:
>
>Can't use string ("Top_10_Report_Old") as a subroutine ref while
>"strict refs" in use at gccStdReportFuncs.pm line 726.
>
>Is there a way we can work around this without removing strict
>from that module?  

Sure.  Use a (hard) code reference: 

  %CUSTOM_FUNCTION = (
    "NEW_AND_UPDATED", \&GetNewAndUpdated,
    ...
  );
  ...
  my $CustomFunction = $CUSTOM_FUNCTION{$in{'REPORT_TYPE'}};
  $CustomFunction->();

-- 
Garry Williams


------------------------------

Date: Fri, 15 Dec 2000 13:16:39 +0100
From: "Juan Salvador" <salva.perez@ctv-jet.com>
Subject: Help!!!!
Message-Id: <91d1n2$o8f$1@talia.mad.ttd.net>

    Hi everybody!!!

    Anybody knows if exists a tool for indenting Perl sources (like indent
by example).

    Thanks!!!

    PD: Excuseme, but my english is poor!!!!! :(

--
___________________________________________________
Juan Salvador Perez Garcia / jperez@es.wanadoo.com
Usuario Registrado: 139516
RedHat Linux 6.2 - Kernel 2.2.18 - GNome 1.2
http://www.sauret.net
__________________________________________________




------------------------------

Date: Fri, 15 Dec 2000 13:35:32 GMT
From: Jeff Robertson <jeff_robertson@yahoo.com>
Subject: Re: How to identify Windows platform from within a Perl program?
Message-Id: <91d6n4$qrt$1@nnrp1.deja.com>

In article <slrn93iqq8.8bg.tim@degree.ath.cx>,
  tim@degree.ath.cx (Tim Hammerquist) wrote:
> Stephan Gross <sg@loralskynet.com> wrote:
> > I'm writing a program that will run off a network but save a copy
of a
> > file to a user's PC.  I figured I would save it to the user's
Desktop.
> > However, the Desktop folder is in different places depending on the
OS
> > - Win98, Windows NT or Win 2000.   Is there a way/module to identify
> > exactly which OS is running?  Environment variables only work on
> > Windows NT.
>
> The Perl variable $^O will return the platform, but it's exact value
on
> Win32 platforms varies with the distribution.  ActivePerl will return
a
> different value for any given platform than will MKS Perl.

I'm pretty sure that (in ActivePerl, at least) $^O will simply
be "MSWin32" on all of the platforms we are talking about here.

The function Win32::GetOSVersion() will probably be better.

> In addition, on Windows95/98, different users will have a different
> Desktop directory on the same system as well.  I believe under the
> D:\WINDOWS\Profiles directory, in addition to the D:\WINDOWS\Desktop.
> Have you taken this into account?

I would expect you'd need to look at the registry to determine this.

I don't think this is a Perl question anymore.

--
"I'm a snotty E-commerce server software coder." - Joona Palaste, c.l.c.
http://www.geocities.com/jeff_robertson


Sent via Deja.com
http://www.deja.com/


------------------------------

Date: Fri, 15 Dec 2000 13:08:40 +0100
From: "tim allen" <timallen449@coldmail.com>
Subject: Re: Is a Hash of Arrays possible?
Message-Id: <91d10j$onf$1@diana.bcn.ttd.net>

>Is it possible to have hash of arrays?
Try this (p. 275-277, Programming Perl 3d Ed, Larry Wall)

my %array_hash = ();

%array_hash = (
  startrek => ["Kirk","Picard"],
  matrix   => ["neo","trinity","morpheus"],
);

print $array_hash{startrek}[1];

>Also, I have a list of records in an excel file. Is it possible to read
these into a perl data file?
A good way to do this (if you'll be doing this reasonably often) is to use
the DBI module.  If you're on Windows and you're using ActiveState perl, the
commands to get the DBI module and the DBD-ODBC module necessary to talk to
an Excel ODBC source are:

c:\>ppm
PPM>install DBI
PPM>install DBD-ODBC

ppm is ActiveState's module loader-- it does all the module installation for
you, including downloading.  Otherwise, surf over to
http://www.cpan.org/modules/by-module/DBI/ and
http://www.cpan.org/modules/by-module/DBD/ .  In anycase, the documentation
for DBI and DBD-ODBC are at http://www.perldoc.com/cpan/DBI.html and
http://www.perldoc.com/cpan/DBD/ODBC.html .
I'm using DBI and DBD-ODBC to access MS-Access from perl.  It works very
well.

Good luck!

--
unmunge?cold=hot

@q=unpack('U*',"Tim Allen");@l=unpack('U*',"Geeky Hackers Grok Perl!\n"
);@w=(61,113,107,191,88,-11,74,107,105,127,97,119,115,47,64,120,118,29,
20,72,91,189,144,39,-88);foreach(@w){push(@g,($_-$l[$x]));$x++}foreach(
@g){print chr($_+$q[$z]);$z++;$z%=@q}





------------------------------

Date: Fri, 15 Dec 2000 12:06:43 +0000
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: Is a Hash of Arrays possible?
Message-Id: <3A3A0953.7E501FD2@yahoo.co.uk>

Edd wrote:

> Is it possible to have hash of arrays.

Yep. Have a look at the manpage for 'perldsc'

> I am trying to build up of a database
> of records consisting of  8-10 fields. What is the best way of doing this.

Objects? DBI? You have many, many, many options.

> I thought of using an hash of arrays, each member of  the hash will have a
> scalar key and an array of 8-10 items.

You could do that way, or an array of arrays, or a hash of hashes, or a hash of
objects. You have lots of options.

> Also, I have a list of records in an excel file. Is it possible to read
> these into a perl data file.

Dunneaux. Try a search at CPAN -
http://search.cpan.org/search?mode=module&query=excel



------------------------------

Date: 15 Dec 2000 11:53:49 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: ndbm/gdbm problem with Perl 5.6
Message-Id: <91d0od$v8o$1@lublin.zrz.tu-berlin.de>

Al  <"al<NoSpam> wrote in comp.lang.perl.misc:
>Environment - Solaris 2.6 sparc, Perl 5.005.02 & Perl 5.6, gdbm-1.8.0
>
>Initially, Perl 5.005.02 was built without gdbm support. We ran into a
>problem with bucket 'overload' so I decided to go to gdbm which
>supposedly doesn't have that problem. We have a number of files,
>generated via hash 'tie' statements and using NDBM_File which have had
>no problem in the past.
>
>I downloaded SMCgdbm-1.8.0 and installed it (/usr/local/lib) with no
>apparent problem. I then got the latest stable Perl version (5.6), and
>installed it. The install found the gdbm libraries, although the build
>initially failed until I added /usr/local/lib to LD_LIBRARY_PATH. After
>that the SNMP build proceeded normally and all tests passed. After a
>'make install', I found that existing programs using NDBM could no
>longer open the file - no error was returned via $!, just couldn't open
>it!
>
>If I created a new file (still using the exact same programs using
>NDBM), the programs worked as expected - just unable to open existing
>files.

Yes, of course.  You must migrate your database to GDBM before GDBM
can use it.  The migration process is basically: 

1 Tie one hash %h_ndbm to the original database using NDBM.

2 Create a new hash %h_gdbm and tie it to a new database using
  GDBM.  Use a different name from the old database file.

3 Copy the old hash to the new one.  You can simply say %h_gdbm =
  %h_ndbm, but that loads the whole hash into memory (twice, actually),
  so you may want to loop over the key/value pairs using each().

4 Step 3 has created a database file (or two).  Rename them to the
  old name.

Repeat this for every database you have.  Now the old program should
run using GDBM instead of NDBM in the tie statements.

Anno


------------------------------

Date: Fri, 15 Dec 2000 13:09:19 -0000
From: "Tony O Sullivan" <tony@codeisland.net>
Subject: Stripping out meta tags from web pages
Message-Id: <FLo_5.6036$Er5.3695@news.indigo.ie>

Hi,
Sorry if this is a bit too simple a thing to be asking , just I have spent
the last few days on it and I can't find the solution anywhere on the net or
think my way round the problem

here it is:
I am trying to strip out the keywords, descriptions and authors from html
documents

It works fine when the meta tags are of the format:

<META name="description" content="this is the description">
<META name="keywords" content="web,sites,search,tool">


but when the tags are formated:

<META  content="this is the description" name="description">
<META content="web,sites,search,tool" name="keywords" >

the stripping tool takes the wrong text - results like this:


KEYWORDS:Azteca Computer Support provides technical assistance for both Mac
and PC users in the business or home environment. We are based in Cork city,
Ireland." name="description"><meta
content="azteca,computer,support,Cork,Ireland,Apple,Mac,PC,technician,networ
k,backup,help,Windows,OS,NT,internet

DESCRIPTION:Azteca Computer Support provides technical assistance for both
Mac and PC users in the business or home environment. We are based in Cork
city, Ireland.

I understand why this is happenning but I can't find a way around it is
there some way of putting into the regular expression something like !> i.e.
no tags????????


here's the code :
#META_KEYWORDS
   if ($contents =~
m/<\s*META\s+name\s*=\s*[\"\']?keywords[\"\']?\s+content\s*=\s*[\"\']?(.*?)[
\"\']?\s*>/is)
   {
     my $meta_key = $1;
  $meta_key =~ s/\s+/ /g;
  $meta_keyword{$file_ref} = $meta_key;
 }
   elsif($contents =~
m/<\s*META\s+content\s*=\s*[\"\']?(.*?)[\"\']?\s+name\s*=\s*[\"\']?keywords[
\"\']?\s*>/is)
 {
  print "\nMETA_KEY:$1";
  my $meta_key = $1;
  $meta_key =~ s/\s+/ /g;
  $meta_keyword{$file_ref} = $meta_key;
 }


Any help or suggestions would result in my immeasurable graditude and
adoration!!!!
thanks in advance

Tony (aka quototoe)
mail me at tony@codeisland.net





------------------------------

Date: Fri, 15 Dec 2000 11:07:59 +0000
From: Steve Jelfs <steve.jelfs@oracle.com>
Subject: Truncated text from a POST operation
Message-Id: <3A39FB8F.42B45444@oracle.com>

I have a web form which passes text from a textarea, via a POST
operation, to a perl script which then processes the data.

The trouble is - this text keeps getting truncated although I though
that a POST wouldn't truncate (as opposed to GET).

Here's the bit I'm using to read the variables - am I missing something?

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
    ($name, $value) = split(/=/, $pair);
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $FORM{$name} = $value;
}

Cheers

Steve



------------------------------

Date: Fri, 15 Dec 2000 12:40:04 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Truncated text from a POST operation
Message-Id: <slrn93k489.1h6.rgarciasuarez@rafael.kazibao.net>

Steve Jelfs wrote in comp.lang.perl.misc:
> I have a web form which passes text from a textarea, via a POST
> operation, to a perl script which then processes the data.
> 
> The trouble is - this text keeps getting truncated although I though
> that a POST wouldn't truncate (as opposed to GET).
> 
> Here's the bit I'm using to read the variables - am I missing something?
> 
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/, $buffer);
> foreach $pair (@pairs) {
>     ($name, $value) = split(/=/, $pair);
>     $value =~ tr/+/ /;
>     $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>     $FORM{$name} = $value;
> }

Don't use this code. Use the CGI module. It's standard. It's bundled
with Perl. It's carefully tested. Moreover, the above code doesn't run
under 'use strict', which is bad.

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


------------------------------

Date: 15 Dec 2000 05:18:37 -0800
From: Sue Spence <sue@pennine.com>
Subject: Re: while(m//g) v.s. while(s///g)
Message-Id: <91d5nd01f2i@drn.newsguy.com>

In article <91bvei$bgo@netnews.hinet.net>, John says...
>
>Dear all,
>
>For the following program
>
>    $_ = "1 2 3 4 5";
>    while(m/\d/g) { print "matching $&\n" }
>
>__END__
>matching 1
>matching 2
>matching 3
>matching 4
>matching 5
>
>how can I do the same thing on s/// ?
>
>    $_ = "1 2 3 4 5";
>    while(s/\d/0/g) { print "replacing $&\n" }
>
>__END__
>replacing 5
>replacing 0
>...
>
>(I want "replacing 1, replacing 2 ... replacing 5".)
>

Try removing the /g (global) on your substitute command, and substitute a
character other than a digit (0-9).  The /g causes the substitution to happen as
many times as it can on $_.  Without /g, it will stop after it hits the first
match.

I suggest that you print $_ each time you match or substitute a character as it
will give you some more insight into what is happening.



------------------------------

Date: Fri, 15 Dec 2000 12:50:10 GMT
From: Mark <mtaylorlrim@my-deja.com>
Subject: Re: Why doesn't this work????? (Location: redirection....)
Message-Id: <91d421$ook$1@nnrp1.deja.com>

In article <3a318836.28060974@nntp.interaccess.com>,
  me wrote:
> I have been having problems with my perl scripts on a linux server...
>
> For redirection: here's a script that will not work (it works on
> another server I use with FreeBSD)
>
> #!/usr/local/bin/perl
>
> print "Location: http://www.cnn.com/\n\n";
>
> That's it.... It runs fine in telnet, but I always get "premature end
> of script headers" when I try to execute it through Apache server...It
> works fine on my FreeBSD installation.
>
> I'm assuming it's something set up incorrectly with the Apache Web
> Server, but other scripts seem to work fine (but only when I use CGI
> and it's commands, not normal print "text/html", etc.)
>
> Any ideas would be appreciated.
>
> Thanks...
>
> psantt@interaccess.com
>
>
On a command line type...

which perl

then compare the output to the top line of your script. You did upload
the script in ascii format, right?

Mark

--
Please reply to this newsgroup as my Deja mail
is used as a spam catcher only!


Sent via Deja.com
http://www.deja.com/


------------------------------

Date: Fri, 15 Dec 2000 23:25:13 +1100
From: "KlausL" <NoJunkMail&Klaus.L@attglobal.net>
Subject: Re: Windows cant recognize the original owner
Message-Id: <91d2jb$upk$1@arachne.labyrinth.net.au>

Alessandro,

I don't think this is a weakness; its a design feature! It allows users
to protect their files from the prying eyes of unethical system
administrators.
If an administrator seizes ownership of the folder in question then he
leaves a telltale behind that makes it clear to the owner that someone
has obtained access to his folders.

Klaus

Alessandro Augusto wrote in message <3A39F66B.91EE4157@br.bosch.com>...
>I found a Windows weakness with the ownership. I haven´t heard anything
>about
>it, so let me try to explain.
>
>Supose this:
>c:\home\user1
>c:\home\user2
>c:\home\...
>
>Now, suppose that user1, a normal user, who is the owner of directory
>"c:\home\user1" removed the permissions (ACE) of the administrator. So
>the administrator cant change
>any permission on this directory.
>
>The only way I found , being the administrator, to change the
>permissions of this
>directory, is taking the ownership of it. But when I do that, it mess up
>with the
>older permissions. Also, when I try to take the ownership, Windows does
>not
>recognize the original owner.
>
>How can I find a better solution to that?
>Have any one seen this before?
>
>Thanks
>Alessandro
>
>Ps. I posted this message to comp.lang.perl cause, I found this during a
>test
>of my perl script which apply ACLs to files. If the user removed the
>administrator
>ACE, my script cant change the permissions.
>




------------------------------

Date: Fri, 15 Dec 2000 10:34:20 -0200
From: Alessandro Augusto <Alessandro.Augusto@br.bosch.com>
Subject: Re: Windows cant recognize the original owner
Message-Id: <3A3A0FCC.9DD31C3F@br.bosch.com>

I dont think.

The goal of a security administrator is that his network be secure.
so if he sets some permissions, probably that is the best solution to known
exploits.

but if the user chances it, he leaves open holes.

The problem is, why, when the administrator has no permission to a
file/folder, when he wants to get the ownership, why NT does not
recognize the older owner?

If NT shows the old owner, then I can get it with my Perl script,
and set back after changed the permissions?

Alessandro

KlausL wrote:

> If an administrator seizes ownership of the folder in question then he
> leaves a telltale behind that makes it clear to the owner that someone
> has obtained access to his folders.
>
> Klaus



------------------------------

Date: Fri, 15 Dec 2000 13:23:24 -0000
From: "Mark Dixon" <mnd2@ukc.ac.uk>
Subject: Re: Windows cant recognize the original owner
Message-Id: <91d60d$jei$1@spruce.ukc.ac.uk>

Why not just stop the users fiddling with permissions?

Mark




------------------------------

Date: Fri, 15 Dec 2000 13:39:54 +0100
From: Michel Rodriguez <mrodrigu@mirlin.xmltwig.com>
Subject: Re: xml parser
Message-Id: <91cvq1$qg2$1@wanadoo.fr>

Frédéric Hoerni wrote:

> hello
> i am looking for an XML parser to read from an XML file and get some
> values from some objects.
> 
> I tried the XML::Parser module that does not read the values of the items
> in the file
> I tried the XML::XPath that cannot read 'name' in the following : <item
> name='xyz'/>
> (XML::XPath can read only this : <item><name>xyz</name></item>)


I am sure XML::XPath can read the attribute value.

In XML::Parser you can certainly read it too:

my $p= new XML::Parser( Handlers => { Start => \&start });
$p->parsefile( 'file.xml');

sub start 
  { my( $p, $gi, %att)=@_;
    if( $gi eq 'item') { print $att{name}, "\n"; } #
  }

You can also use XML::SImple, XML::PYX or XML::Twig (amongst others) for 
this.
-- 
Michel Rodriguez
Perl & XML
http://www.xmltwig.com
Toulouse Perl Mongers : http://hfb.pm.org/~toulouse/




------------------------------

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 5121
**************************************


home help back first fref pref prev next nref lref last post