view release on metacpan or search on metacpan
lib/CohortExplorer/Application.pm view on Meta::CPAN
# Check command history file exists and is readable and writable
my $command_history_file =
File::Spec->catfile( File::HomeDir->my_home, ".CohortExplorer_History" );
if ( !-r $command_history_file || !-w $command_history_file ) {
throw_app_init_exception( error =>
"'$command_history_file' must exist with RW enabled (i.e. chmod 766) for CohortExplorer"
);
}
# Prompt for password if not provided at command line
if ( !$opts->{password} ) {
view all matches for this distribution
view release on metacpan or search on metacpan
eval {
for my $file (
qw(users/jane users/john
lists/vent lists/perl lists/girlsonly)
) {
chmod(0644, "data1.4/$file");
}
};
my $data = _data();
cmp_deeply((users("data1.4"))[0], $data->{users}, "users()");
if $Colloquy::Data::VERSION >= 1.15;
eval {
my $oldW = $^W;
$^W = 0;
chmod(0666, "data1.4/lists/girlsonly");
my ($lists) = lists("data1.4");
$^W = $oldW;
};
ok($@ =~ /insecure/, 'dies properly on insecure permissions');
}
view all matches for this distribution
view release on metacpan or search on metacpan
gen/gen_decl.pl view on Meta::CPAN
Function BuiltinFunc truncate
Function BuiltinFunc warn
Function BuiltinFunc write
Function BuiltinFunc vec
Function BuiltinFunc chdir
Function BuiltinFunc chmod
Function BuiltinFunc chown
Function BuiltinFunc chroot
Function BuiltinFunc fcntl
Function BuiltinFunc glob
Function BuiltinFunc ioctl
view all matches for this distribution
view release on metacpan or search on metacpan
src/compiler/util/Compiler_gen_token_decl.cpp view on Meta::CPAN
{Enum::Token::Type::BuiltinFunc, Enum::Token::Kind::Function, "BuiltinFunc", "truncate"},
{Enum::Token::Type::BuiltinFunc, Enum::Token::Kind::Function, "BuiltinFunc", "warn"},
{Enum::Token::Type::BuiltinFunc, Enum::Token::Kind::Function, "BuiltinFunc", "write"},
{Enum::Token::Type::BuiltinFunc, Enum::Token::Kind::Function, "BuiltinFunc", "vec"},
{Enum::Token::Type::BuiltinFunc, Enum::Token::Kind::Function, "BuiltinFunc", "chdir"},
{Enum::Token::Type::BuiltinFunc, Enum::Token::Kind::Function, "BuiltinFunc", "chmod"},
{Enum::Token::Type::BuiltinFunc, Enum::Token::Kind::Function, "BuiltinFunc", "chown"},
{Enum::Token::Type::BuiltinFunc, Enum::Token::Kind::Function, "BuiltinFunc", "chroot"},
{Enum::Token::Type::BuiltinFunc, Enum::Token::Kind::Function, "BuiltinFunc", "fcntl"},
{Enum::Token::Type::BuiltinFunc, Enum::Token::Kind::Function, "BuiltinFunc", "glob"},
{Enum::Token::Type::BuiltinFunc, Enum::Token::Kind::Function, "BuiltinFunc", "ioctl"},
view all matches for this distribution
view release on metacpan or search on metacpan
t/complete_program.t view on Meta::CPAN
use File::Temp qw(tempdir);
use Filesys::Cap qw(fs_is_cs);
use Test::More 0.98;
use Complete::Program qw(complete_program);
sub mkexe { write_text($_[0], ""); chmod 0755, $_[0] }
local $Complete::Common::OPT_CI = 0;
local $Complete::Common::OPT_MAP_CASE = 0;
local $Complete::Common::OPT_FUZZY = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Compress/Bzip2.pm view on Meta::CPAN
}
sub _set_stat_from_snapshot ( $$ ) {
my ( $filename, $statsnap ) = @_;
if ( !chmod( S_IMODE( $statsnap->[2] ), $filename ) ) {
bz_seterror( &BZ_IO_ERROR, "chmod ".sprintf('%03o', S_IMODE( $statsnap->[2] ))." $filename failed: $!" );
return undef;
}
if ( !utime @$statsnap[8,9], $filename ) {
bz_seterror( &BZ_IO_ERROR,
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
# Un-comment this if you add C files to link with later:
OBJECT => '$(O_FILES)', # link all the C files too
LICENSE => 'lgpl',
'dist' => {
PREOP => 'chmod 600 Makefile.PL',
TARFLAGS => '--group=none --owner=bjoern -cvf',
COMPRESS => 'gzip -9',
},
XS => { 'Deflate7.xs' => 'Deflate7.c' },
C => [
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
use ExtUtils::MakeMaker;
WriteMakefile(
'dist' => {
PREOP => 'pod2text LZF.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
COMPRESS => 'gzip -9v',
SUFFIX => '.gz',
},
'NAME' => 'Compress::LZF',
'VERSION_FROM' => 'LZF.pm',
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
use ExtUtils::MakeMaker;
WriteMakefile(
'dist' => {
PREOP => 'pod2text LZV1.pm | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
COMPRESS => 'gzip -9v',
SUFFIX => '.gz',
},
'NAME' => 'Compress::LZV1',
'VERSION_FROM' => 'LZV1.pm',
view all matches for this distribution
view release on metacpan or search on metacpan
t/compress/CompTestUtils.pm view on Meta::CPAN
Carp::croak "NO!!!!" if defined $_;
# autogenerate the name if none supplied
$_ = "tst" . $$ . "X" . $index ++ . ".tmp"
unless defined $_;
}
chmod 0777, @_;
for (@_) { 1 while unlink $_ } ;
bless [ @_ ], $self ;
}
sub DESTROY
{
my $self = shift ;
chmod 0777, @{ $self } ;
for (@$self) { 1 while unlink $_ } ;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/compress/CompTestUtils.pm view on Meta::CPAN
{
# autogenerate the name unless if none supplied
$_ = "tst" . $index ++ . ".tmp"
unless defined $_;
}
chmod 0777, @_;
for (@_) { 1 while unlink $_ } ;
bless [ @_ ], $self ;
}
sub DESTROY
{
my $self = shift ;
chmod 0777, @{ $self } ;
for (@$self) { 1 while unlink $_ } ;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/compress/CompTestUtils.pm view on Meta::CPAN
Carp::croak "NO!!!!" if defined $_;
# autogenerate the name if none supplied
$_ = "tst" . $$ . "X" . $index ++ . ".tmp"
unless defined $_;
}
chmod 0777, @_;
for (@_) { 1 while unlink $_ } ;
bless [ @_ ], $self ;
}
sub DESTROY
{
my $self = shift ;
chmod 0777, @{ $self } ;
for (@$self) { 1 while unlink $_ } ;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
ext/zstd/programs/fileio.c view on Meta::CPAN
#define FNSPACE 30
/* Default file permissions 0666 (modulated by umask) */
/* Temporary restricted file permissions are used when we're going to
* chmod/chown at the end of the operation. */
#if !defined(_WIN32)
/* These macros aren't defined on windows. */
#define DEFAULT_FILE_PERMISSIONS (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
#define TEMPORARY_FILE_PERMISSIONS (S_IRUSR|S_IWUSR)
#else
ext/zstd/programs/fileio.c view on Meta::CPAN
}
#if defined(_WIN32) || defined(WIN32)
/* windows doesn't allow remove read-only files,
* so try to make it writable first */
if (!(statbuf.st_mode & _S_IWRITE)) {
UTIL_chmod(path, &statbuf, _S_IWRITE);
}
#endif
return remove(path);
}
view all matches for this distribution
view release on metacpan or search on metacpan
ext/zstd/programs/fileio.c view on Meta::CPAN
return 0;
}
#if defined(_WIN32) || defined(WIN32)
/* windows doesn't allow remove read-only files,
* so try to make it writable first */
chmod(path, _S_IWRITE);
#endif
return remove(path);
}
/** FIO_openSrcFile() :
ext/zstd/programs/fileio.c view on Meta::CPAN
{ FILE* const f = fopen( dstFileName, "wb" );
if (f == NULL) {
DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno));
} else {
chmod(dstFileName, 00600);
}
return f;
}
}
ext/zstd/programs/fileio.c view on Meta::CPAN
&& strcmp(dstFileName, nulmark) /* special case : don't remove() /dev/null (#316) */
&& strcmp(dstFileName, stdoutmark) /* special case : don't remove() stdout */
) {
FIO_remove(dstFileName); /* remove decompression artefact; note: don't do anything special if remove() fails */
} else { /* operation success */
if ( strcmp(dstFileName, stdoutmark) /* special case : don't chmod stdout */
&& strcmp(dstFileName, nulmark) /* special case : don't chmod /dev/null */
&& transfer_permissions ) /* file permissions correctly extracted from src */
UTIL_setFileStat(dstFileName, &statbuf); /* transfer file permissions from src into dst */
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
tools/Conf/Libconfig/WrapXS.pm view on Meta::CPAN
my $mapdir = "$basedir/xsbuilder/maps";
my @dirs = ("$basedir/src");
unless (-d $mapdir)
{
mkdir ($mapdir, 0755);
chmod (0755, $mapdir);
}
sub new_parsesource { [ Conf::Libconfig::ParseSource->new ] }
sub my_xs_prefix { 'config_xs_' }
view all matches for this distribution
view release on metacpan or search on metacpan
$tpar{'gid'} = $par->{'gid'} unless $tpar{'gid'};
croak "No filename!" unless $file = $par->{'file_name'};
($tmp = $file) =~ s/$/.new/;
open(FILEO, ">$tmp") || croak "can't create $tmp:$!";
chmod $tpar{'mode'}, $tmp;
chown $tpar{'uid'}, $tpar{'gid'}, $tmp;
for my $line (@{$par->{'lines'}}) {
print FILEO "$line\n";
$fsize += length($line)+1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
Debian_CPANTS.txt view on Meta::CPAN
"libfax-hylafax-client-perl", "Fax-Hylafax-Client", "1.02", "0", "0"
"libfcgi-perl", "FCGI", "0.67", "0", "0"
"libfcgi-procmanager-perl", "FCGI-ProcManager", "0.18", "0", "0"
"libfeed-find-perl", "Feed-Find", "0.06", "0", "0"
"libfile-basedir-perl", "File-BaseDir", "0.03", "0", "0"
"libfile-chmod-perl", "File-chmod", "not-uploaded", "0", "0"
"libfile-copy-recursive-perl", "File-Copy-Recursive", "0.36", "0", "0"
"libfile-desktopentry-perl", "File-DesktopEntry", "0.04", "1", "0"
"libfile-extattr-perl", "File-ExtAttr", "not-uploaded", "0", "0"
"libfile-find-rule-perl", "File-Find-Rule", "0.30", "1", "1"
"libfile-flock-perl", "File-Flock", "not-uploaded", "0", "0"
view all matches for this distribution
view release on metacpan or search on metacpan
Hierarchical/Dump.pm view on Meta::CPAN
variable2
<node>
key value
</node>
$
$ chmod 755 example.conf
$ ./example.conf
node->key = 'value'
variable1 = 'value'
variable2 = ''
$
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Generator/File.pm view on Meta::CPAN
$tmpath = $path . ".tmp";
_unlink($tmpath) if -e $tmpath;
file_write($tmpath, data => $data);
@stat = stat($path);
if (@stat) {
_chmod($stat[ST_MODE] & oct(7777), $tmpath);
_chown($stat[ST_UID], $stat[ST_GID], $tmpath);
_unlink($path);
}
rename($tmpath, $path)
or dief("cannot rename(%s, %s): %s", $tmpath, $path, $!);
lib/Config/Generator/File.pm view on Meta::CPAN
#
# fatal helpers
#
sub _chmod ($$) {
my($mode, $path) = @_;
chmod($mode, $path)
or dief("cannot chmod(%04o, %s): %s", $mode, $path, $!);
}
sub _chown ($$$) {
my($uid, $gid, $path) = @_;
lib/Config/Generator/File.pm view on Meta::CPAN
_printf2("would have changed %s (but we are not root)\n", $what);
} else {
if ($NoAction) {
_printf1("would have changed %s\n", $what);
} else {
_chmod($mode, $rpath);
_printf1("changed %s\n", $what);
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/HAProxy.pm view on Meta::CPAN
my $sb = stat($self->filename);
$self->backup;
rename($tempfile, $self->filename)
or croak "can't rename $tempfile to ".$self->tempfile.": $!";
# This will succeed: we've created the file, so we're owning it.
chmod $sb->mode & 0777, $self->filename;
# This will fail unless we are root, let it be so.
chown $sb->uid, $sb->gid, $self->filename;
$self->tree->clear_dirty;
return 1;
view all matches for this distribution
view release on metacpan or search on metacpan
t/reader-err.t view on Meta::CPAN
filetest->import('access');
my ($fh, $fn) = File::Temp::tempfile('tempXXXXX', UNLINK => 1);
close $fh;
chmod 0222, $fn;
if (-r $fn) {
chmod 0666, $fh;
skip "chmoding file 0222 left it -r", 1;
}
eval { Config::INI::Reader->read_file($fn); };
like($@, qr/not readable/, "can't read an unreadable file");
chmod 0666, $fh;
}
eval { Config::INI::Reader->read_string; };
like($@, qr/no string provided/i, 'read_string without args');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/IniFiles.pm view on Meta::CPAN
carp "Unable to rename temp config file ($new_file) to ${filename}: $!";
return undef;
}
if ( exists $self->{file_mode} )
{
if ( not chmod( oct( $self->{file_mode} ), $filename ) )
{
carp "Unable to chmod $filename!";
}
}
return 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
run-and-save view on Meta::CPAN
case $line in
\#!*)
printf '%s\n\n' "$line" >&3;;
\#COMMIT)
printf '#!/bin/sh\n\n:\n' >&3
chmod u+x "$saveas"
exec 3>&-
test "${saveas#/}" = "$saveas" && exec "./$saveas"
exec "$saveas";;
\#ROLLBACK)
exit 1;;
run-and-save view on Meta::CPAN
while read -r line; do
case $line in
\#COMMIT)
mv -b -f "$tmp" "$saveas"
chmod u+x "$saveas"
exec 3>&-
test "${saveas#/}" = "$saveas" && exec "./$saveas"
exec "$saveas";;
\#ROLLBACK)
exit 1;;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Model/models/Itself/Class.pl view on Meta::CPAN
type => 'leaf',
value_type => 'uniline',
level => 'normal',
summary => 'configuration file mode',
description => 'specify the configuration file mode. C<file_mode> parameter can be used to set the '
. 'mode of the written file. C<file_mode> value can be in any form supported by L<Path::Tiny/chmod>.'
},
default_layer => {
type => 'node',
config_class_name => 'Itself::ConfigReadWrite::DefaultLayer',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Model/Backend/PlainFile.pm view on Meta::CPAN
}
if (@v) {
$logger->trace("PlainFile write opening $file to write $elt");
$file->spew_utf8(@v);
$file->chmod($args{file_mode}) if $args{file_mode};
}
elsif ($file->exists) {
$logger->trace("PlainFile delete $file");
$file->remove;
}
lib/Config/Model/Backend/PlainFile.pm view on Meta::CPAN
string_b=else>, this backend writes "C<something>" in file
C<example.string_a> and C<else> in file C<example.string_b>.
C<file_mode> parameter can be used to set the mode of the written
file. C<file_mode> value can be in any form supported by
L<Path::Tiny/chmod>.
=head1 Methods
=head2 read_leaf
view all matches for this distribution
view release on metacpan or search on metacpan
t/01_basic.t view on Meta::CPAN
my $tst = temppath();
my $fh = $exe->open("w", 0700) or die "open failed.";
print $fh file("t/editor/exe$suffix")->slurp;
undef $fh;
chmod 0700, $exe;
$ENV{EDITOR} = $exe;
$ENV{TEST_FILE} = $tst;
#system $exe, "Changes";
#p $tst->slurp;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Config/Proxy/Base.pm view on Meta::CPAN
$self->backup;
rename($tempfile, $self->filename)
or croak "can't rename $tempfile to ".$self->tempfile.": $!";
# This will succeed: we've created the file, so we're owning it.
chmod $sb->mode & 0777, $self->filename;
# This will fail unless we are root, let it be so.
chown $sb->uid, $sb->gid, $self->filename;
$self->tree->clear_dirty;
return 1;
view all matches for this distribution
view release on metacpan or search on metacpan
t/02-perm.t view on Meta::CPAN
use Test::More tests => 4;
use File::Spec;
BEGIN { use_ok('Config::Scoped') }
my $unsafe_cfg = File::Spec->catfile( 't', 'files', 'fvalid.cfg' );
chmod 0664, $unsafe_cfg;
my ($p, $cfg);
isa_ok($p = Config::Scoped->new(file => $unsafe_cfg), 'Config::Scoped');
eval { $cfg = $p->parse; };
isa_ok($@, 'Config::Scoped::Error::Validate::Permissions');
view all matches for this distribution
view release on metacpan or search on metacpan
# --- MakeMaker tool_xsubpp section:
# --- MakeMaker tools_other section:
CHMOD = $(ABSPERLRUN) -MExtUtils::Command -e chmod --
CP = $(ABSPERLRUN) -MExtUtils::Command -e cp --
MV = $(ABSPERLRUN) -MExtUtils::Command -e mv --
NOOP = rem
NOECHO = @
RM_F = $(ABSPERLRUN) -MExtUtils::Command -e rm_f --
view all matches for this distribution
view release on metacpan or search on metacpan
CONTRIBUTING.md view on Meta::CPAN
Dependencies for this module are recorded in the `META.json` file.
Installation is most easily done with `cpanminus`[1], which can be
made available locally via:
$ curl -L https://cpanmin.us/ -o cpanm
$ chmod +x cpanm
To install the dependencies into a local directory (to avoid polluting
your Perl distribution),
$ export PERL5LIB=${PERL5LIB}:$PWD/local
view all matches for this distribution