You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Alessandro Forghieri <Al...@think3.com> on 2003/02/13 10:31:59 UTC

[OT?] Win32 permissions puzzler

Greetings.
[not really modperl-specific...]
I have a Win32 based modperl2 app, where apache needs to run impersonating a
domain user (this is because 
it needs to access a network share, something LocalSystem cannot do - if
anybody has a better solution I
would like to know about it).

Anyway, it turns out that - on a given installation which uses both standard
domain users *AND* Active Directory users - I get a syntax error:

use Bar qw($foo);

if($foo) {
...
Global symbol "$foo" requires explicit package name at

Just after the start of the script.

This disappears if the user apache impersonates is given administrator
rights...
WTF??? (took me a couple of hours to nail this down). 
So I must assume that the "use" statement somehow failed, but I cannot
figure out

i) Why should it fail 

and 

ii) How could it fail without the entire script failing at compile time.

Note that the package "Bar" lives under site/lib/ and I am use'ing a number
of other packages from there,
including - implicitely - the whole mp2 shebang... so I *think* apache has
read access to that directory,
or it should crash and burn much earlier...)

I do not like very much (understatement) the "admin permissions"
workaround.... ideas?

Cheers,
alf

Re: [OT?] Win32 permissions puzzler

Posted by Stas Bekman <st...@stason.org>.
Alessandro Forghieri wrote:
[...]
> use Bar qw($foo);
> 
> if($foo) {
> ...
> Global symbol "$foo" requires explicit package name at

use vars qw($foo);
use Bar qw($foo);

or with 5.6+

our $foo;
use Bar qw($foo);

See:
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Using_Global_Variables_and_Sharing_Them_Between_Modules_Packages

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com