You are not logged in.

#1 2014-12-22 17:08:18

strix
Member
From: Switzerland
Registered: 2013-04-29
Posts: 13

Perl permissions

For quite a time, I have a problem with perl on my system. I don't have the permissions to install or even execute perl scripts as a normal user. IMHO this shouldn't be the default behaviour, but I can't say when and where this changed on my computer.

Examples:

.-(~) - (strix@tirion)-
`--> id
uid=1000(strix) gid=100(users) groups=100(users),7(lp),10(wheel),50(games),90(network),91(video),108(vboxusers),150(wireshark)
.-(~) - (strix@tirion)-
`--> cpan
Can't locate App/Cpan.pm:   Permission denied at /usr/bin/core_perl/cpan line 9.
BEGIN failed--compilation aborted at /usr/bin/core_perl/cpan line 9.
.-(~) - (strix@tirion)-
`--> perl-rename
Can't locate Text/Abbrev.pm:   Permission denied at /usr/bin/perl-rename line 22.
BEGIN failed--compilation aborted at /usr/bin/perl-rename line 22.
.-(~) - (strix@tirion)-
`--> pacman -Qs perl
local/cairo-perl 1.104-2
    Perl wrappers for cairo
local/glade-perl 1.007-8
    Gtk2-GladeXML perl bindings for glade 2.x
local/glib-perl 1.305-1
    Perl wrappers for glib 2.x, including GObject
local/gtk2-perl 1.2492-1
    Perl bindings for GTK+ 2.x
local/irssi 0.8.17-1
    Modular text mode IRC client with Perl scripting
local/lib32-pcre 8.36-1
    A library that implements Perl 5-style regular expressions (32-bit)
local/pango-perl 1.226-1
    Perl bindings for Pango
local/pcre 8.36-2
    A library that implements Perl 5-style regular expressions
local/perl 5.20.1-1 (base)
    A highly capable, feature-rich programming language
local/perl-anyevent 4:7.08-1
    The DBI of event loop programming
local/perl-anyevent-i3 0.16-1
    Communicate with the i3 window manager
local/perl-async-interrupt 1.20-2
    allow C/XS libraries to interrupt perl asynchronously
local/perl-common-sense 3.73-1
    Implements some sane defaults for Perl programs
local/perl-data-dump 1.22-1
    Pretty printing of data structures
local/perl-digest-hmac 1.03-3
    Perl Module: Keyed-Hashing for Message Authentication.
local/perl-digest-sha1 2.13-5
    Perl interface to the SHA-1 Algorithm
local/perl-encode-locale 1.03-2
    Determine the locale encoding
local/perl-error 0.17022-1
    Perl/CPAN Error module - Error/exception handling in an OO-ish way
local/perl-ev 4.18-1
    perl interface to libev, a high performance full-featured event loop
local/perl-file-listing 6.04-2
    parse directory listing
local/perl-file-which 1.09-4
    Portable implementation of which
local/perl-guard 1.023-1
    safe cleanup blocks
local/perl-html-parser 3.71-3
    Perl HTML parser class
local/perl-html-tagset 3.20-4
    Data tables useful in parsing HTML
local/perl-http-cookies 6.01-2
    HTTP cookie jars
local/perl-http-daemon 6.01-2
    A simple http server class
local/perl-http-date 6.02-2
    Date conversion routines
local/perl-http-message 6.06-2
    HTTP style messages
local/perl-http-negotiate 6.01-2
    Choose a variant to serve
local/perl-image-exiftool 9.76-1
    Reader and rewriter of EXIF informations that supports raw files
local/perl-json-xs 3.01-3
    JSON::XS - JSON serialising/deserialising, done correctly and fast
local/perl-libwww 6.08-1
    The World-Wide Web library for Perl
local/perl-locale-gettext 1.05-11
    Permits access from Perl to the gettext() family of functions
local/perl-lwp-mediatypes 6.02-2
    Guess the media type of a file or a URL
local/perl-net-dns 0.81-1
    Perl Module: Interface to the DNS resolver
local/perl-net-http 6.07-1
    Low-level HTTP connection (client)
local/perl-net-ip 1.26-2
    Perl Module: Easy manipulation of IPv4 and IPv6 addresses
local/perl-rename 1.9-1
    Renames multiple files using Perl regular expressions.
local/perl-text-unidecode 0.04-2
    US-ASCII transliterations of Unicode text
local/perl-types-serialiser 1.0-1
    simple data types for common serialisation formats
local/perl-uri 1.65-1
    Uniform Resource Identifiers (absolute and relative)
local/perl-www-robotrules 6.02-2
    Database of robots.txt-derived permissions
local/perl-xml-fast 0.11-5
    Simple and very fast XML to hash conversion.
local/perl-xml-parser 2.43-1
    Expat-based XML parser module for perl

Any ideas, how to fix this and where this problem comes from?

Offline

#2 2014-12-24 05:07:53

edm7707
Member
Registered: 2014-10-30
Posts: 6

Re: Perl permissions

I'm Gonna ask the obvious. Do the scripts you made have executable permissions set? 

Do all scripts complain about permissions( hello world for example) or just some particular ones?
Because if its the latter, the script might be trying to invoke some commands that actually need super user privileges regardless of the invocation in perl?

Offline

#3 2014-12-24 09:02:18

strix
Member
From: Switzerland
Registered: 2013-04-29
Posts: 13

Re: Perl permissions

Okay, first of all: I'm an absolute Noob when it comes to Perl. I only use perl in scripts I downloaded or which are part of a package.

So to answer you first question, yes:

lrwxrwxrwx 1 root root 18 Jul  4 14:53 /usr/bin/perl-rename -> vendor_perl/rename*
-r-xr-xr-x 1 root root 13K Jul  4 14:53 /usr/bin/vendor_perl/rename*

-r-xr-xr-x 1 root root 241K Nov 16 14:26 /usr/bin/vendor_perl/exiftool*

The scripts complain, as soon as they use perl modules, e.g. almost always:

A simple Hello World works:

`--> cat hello.pl 
#!/usr/bin/perl
print "Hello World\n";
`--> ./hello.pl 
Hello World

But most perl packages do not:

exiftool:

`--> exiftool 
Can't locate File/RandomAccess.pm:   Permission denied at /usr/share/perl5/vendor_perl/Image/ExifTool.pm line 21.
BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/Image/ExifTool.pm line 21.
Compilation failed in require at /usr/bin/vendor_perl/exiftool line 33.
BEGIN failed--compilation aborted at /usr/bin/vendor_perl/exiftool line 33.

iptab:

`--> iptab
Can't locate Net/IP.pm:   Permission denied at /usr/bin/vendor_perl/iptab line 6.
BEGIN failed--compilation aborted at /usr/bin/vendor_perl/iptab line 6.

Edit:

the perl modules do exist:

`--> ll /usr/share/perl5/vendor_perl/Net/IP.pm 
-r--r--r-- 1 root root 73K Nov 28  2012 /usr/share/perl5/vendor_perl/Net/IP.pm

Are these the correct permissions? And why can't I install any perl modules as user?

Last edited by strix (2014-12-28 13:05:39)

Offline

Board footer

Powered by FluxBB