Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: [error] Insecure dependency in unlink while running with -T switch at /: msg#00550

apache.mod-perl

Subject: Re: [error] Insecure dependency in unlink while running with -T switch at /usr/lib/perl5/site_perl/5.6.0/Apache/Session/Store/File.pm line 106

Is Apache::Session::DB_type Faster than Apache::Session::File?

I already use a lot of DB connections and I used Apache::Session::File to
reduce this,

Marty
----- Original Message -----
From: "Cees Hek" <cees@xxxxxxxxxxxxxxxx>
To: "Martin Moss" <martin_moss@xxxxxxxxxxxxxx>
Cc: <modperl@xxxxxxxxxxxxxxx>
Sent: Friday, February 28, 2003 5:39 AM
Subject: Re: [error] Insecure dependency in unlink while running with -T
switch at /usr/lib/perl5/site_perl/5.6.0/Apache/Session/Store/File.pm line
106


> Quoting Martin Moss <Martin_moss@xxxxxxxxxxxxxx>:
>
> > All,
> > Can Anybody see what I'm doing wrong here?
> >
> > I have the following error :-
> > [error] Insecure dependency in unlink while running with -T switch at
> > /usr/lib/perl5/site_perl/5.6.0/Apache/Session/Store/File.pm line 106.
>
> The problem is not with your code, it is that Apache::Session::File
does
> not work in Taint mode. Apache::Session::Store::File gets the session ID
from a
> file (which means session_is is tainted), and then uses the tainted
session_id
> to delete a file (hence the unlink error).
>
> A quick fix for this is for you to untaint the session ID yourself
after
> the session has been unserialized. Put the following two lines right after
you
> tie the session:
>
> $session{_session_id} =~ /^([a-zA-Z0-9]+)$/;
> $session{_session_id} = $1;
>
> This probably should be fixed in Apache::Session itself as I am sure
other
> people will run into it.
>
> By the way, you really shouldn't be using Apache::Session::File
anyway for
> performance reasons. At least use Apache::Session::DB_File which most
likely
> doesn't suffer from this taint problem and will be much quicker.
>
> Cees
>
>
>
> >
> > When I run the following subroutine:-
> >
> > sub delete_session
> > {
> > my $self=shift;
> > my $session_id=shift;
> >
> > if ($session_id =~ /^(\w\w*)$/)
> > {
> > $session_id = $1; # $data now untainted
> > }
> > else
> > {
> > die "Bad Tainted data in $session_id"; # log this somewhere
> > }
> >
> > die $self->{lh}->maketext("No Session_id given") unless ($session_id);
> >
> > my $t=time;
> > my %session;
> >
> > my $Directory = My::Conf::APACHE_SESSIONS_TMPDIR;
> > my $LockDirectory = My::Conf::APACHE_SESSIONS_LOCKDIR;
> >
> > $Directory="XX_GRRRRR_XX$Directory"."XX_GRRRRR_XX"; #e.g.
> > '/path/to/dir/'
> > $LockDirectory="XX_GRRRRR_XX$LockDirectory"."XX_GRRRRR_XX"; #e.g.
> > '/path/to/dir/'
> >
> > if ($Directory =~ /^XX_GRRRRR_XX(.*)XX_GRRRRR_XX$/)
> > {
> > $Directory = $1; # $data now untainted
> > }
> > else
> > {
> > die "Bad Tainted data in $Directory"; # log this somewhere
> > }
> >
> > if ($LockDirectory =~ /^XX_GRRRRR_XX(.*)XX_GRRRRR_XX$/)
> > {
> > $LockDirectory = $1; # $data now untainted
> > }
> > else
> > {
> > die "Bad Tainted data in $LockDirectory"; # log this
somewhere
> > }
> >
> > #Load an existing session
> > eval
> > {
> > tie %session, 'Apache::Session::File',$session_id,
> > {
> > Directory => Bficient::Conf::APACHE_SESSIONS_TMPDIR,
> > LockDirectory =>
Bficient::Conf::APACHE_SESSIONS_LOCKDIR,
> > };
> > };
> > if ($@)
> > {
> > die $self->{lh}->maketext("Couldn't Load Apache::Session -
\"[_1]\"
> > For '\"[_2]\"'",$@,$self->UserName);
> > }
> >
> > print STDERR "Just about to unlink\n";
> > tied(%session)->delete;
> > return 1;
> > }
> >
> >
>
>
>




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
version-control...    qnx.openqnx.dev...    redhat.rhn.user...    ietf.openpgp/20...    mail.mutt.user/...    web.microformat...    java.sync4j.use...    education.ezpro...    user-groups.blu...    solaris.manager...    org.fitug.debat...    technology.erps...    politics.activi...    linux.redhat.fe...    bug-tracking.ma...    xfce.user/2004-...    hams/2004-11/ms...    kde.users.pim/2...    culture.cooking...    freebsd.devel.x...    gnu.m4.adhoc/20...    ngpt.user/2002-...    apple.fink.deve...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation