Mark Knoop <> wrote:
>>> A quick look at the documentation for Config::Scoped suggests that
>>> it expected behaviour unless permission checks are disabled. grep
>>> the documentation for 'permission' for more info, particularly the
>>> permissions_validate function.
>>
>> All I can say in my defence was that it was very late last night when
>> I was trying to find out what was going on and missed this bit...
>>
>> Thanks
>> Mark
>>
>
> This leads me to another question. From the documentation for
> Config::Scoped...
>
> #############################################################
>
> $parser->permissions_validate()
> Checks for owner and permission safety unless warnings for
> permissions are off in the current scope. The owner of the cfg_file
> (and any included file) must be either the real uid or superuser and
> no one but owner may write to it. Must throw a
> Config::Scoped::Error::Validate::Permissions exception otherwise.
> This method may be overridden to perform different safety checks if
> necessary. The method has the following interface:
>
> $parser->permissions_validate( handle => $fh ); or
>
> $parser->permissions_validate( file => $file_name );
>
> ##############################################################
>
> This doesn't sound to me like there is an easy way to switch this off
> in the code but rather I have to override the function. Is it
> sensible to override the function with one that simply returns true?
> If so can anyone give me a pointer on how to go about it?
It could be as simple as:
In a file called MyConfig.pm:
-----------------------------
use strict;
use warnings;
package MyConfig;
use base "Config::Scoped";
sub permissions_validate { return 1; }
------------------------------
However, I think the suggestion below would probably be better.
>
> Another workaround I guess is to change the file permissions in the
> code before I use it which somehow seems a bit messy.
What about in the constructor?
my $parser = Config::Scoped->new(... warnings => {permissions =>
'off'});
HTH
--
Brian Raven
=========================================
Atos Euronext Market Solutions Disclaimer
=========================================
The information contained in this e-mail is confidential and solely for the
intended addressee(s). Unauthorised reproduction, disclosure, modification,
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message do not
necessarily reflect those of Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited - Registered in England & Wales with
registration no. 3962327. Registered office address at 25 Bank Street London
E14 5NQ United Kingdom.
Atos Euronext Market Solutions SAS - Registered in France with registration no.
425 100 294. Registered office address at 6/8 Boulevard Haussmann 75009 Paris
France.
L'information contenue dans cet e-mail est confidentielle et uniquement
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail
vous parvient par erreur, nous vous prions de bien vouloir prevenir
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre
systeme. Le contenu de ce message electronique ne represente pas necessairement
la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Société de droit anglais, enregistrée au
Royaume Uni sous le numéro 3962327, dont le siège social se situe 25 Bank
Street E14 5NQ Londres Royaume Uni.
Atos Euronext Market Solutions SAS, société par actions simplifiée, enregistré
au registre dui commerce et des sociétés sous le numéro 425 100 294 RCS Paris
et dont le siège social se situe 6/8 Boulevard Haussmann 75009 Paris France.
=========================================
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs