Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevents other packages from accessing libraries they require when run by root user #6

Open
stuart-little opened this issue May 28, 2021 · 0 comments

Comments

@stuart-little
Copy link

I have a VPS where I run as root. The script I'm testing is as follows:

#!/usr/bin/env perl                                  
use warnings;                                        
use v5.12;                                                                                                

use App::Daemon qw( daemonize );
$App::Daemon::pidfile  = qq|$0.pid|;                 
use POSIX qw(strftime);                              
use Time::Interval;                                                                                       

daemonize();
my $now = strftime("%F %T %Z", localtime);           
my $diff = getInterval(                                  
    $now,
    $now,
    'small'                                              
);

This dies immediately, because Time::Interval is prevented from finding Date::Parse:

# <script> -X
Cannot remove /root/bin/pl.pl.pid at /root/.perlbrew/libs/perl-5.35.0@535/lib/perl5/App/Daemon.pm line 212. 
                                                   
Can't locate Date/Parse.pm:   /root/.perlbrew/libs/perl-5.35.0@535/lib/perl5/x86_64-linux/Date/Parse.pm: Permission denied at /root/.perlbrew/libs/perl-5.35.0@535/lib/perl5/Time/Interval.pm line 38.

The file /root/.perlbrew/libs/perl-5.35.0@535/lib/perl5/x86_64-linux/Date/Parse.pm is definitely there..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant