view release on metacpan or search on metacpan
lib/File/Temp.pm view on Meta::CPAN
unless (-d $parent) {
${$options{ErrStr}} = "Parent directory ($parent) is not a directory";
return ();
}
# Check the stickiness of the directory and chown giveaway if required
# If the directory is world writable the sticky bit
# must be set
if (File::Temp->safe_level == MEDIUM) {
my $safeerr;
lib/File/Temp.pm view on Meta::CPAN
return 1;
}
# Internal routine to check whether a directory is safe
# for temp files. Safer than _is_safe since it checks for
# the possibility of chown giveaway and if that is a possibility
# checks each directory in the path to see if it is safe (with _is_safe)
# If _PC_CHOWN_RESTRICTED is not set, does the full test of each
# directory anyway.
lib/File/Temp.pm view on Meta::CPAN
my $err_ref = shift;
# Should Get the value of _PC_CHOWN_RESTRICTED if it is defined
# and If it is not there do the extensive test
local($@);
my $chown_restricted;
$chown_restricted = &POSIX::_PC_CHOWN_RESTRICTED()
if eval { &POSIX::_PC_CHOWN_RESTRICTED(); 1};
# If chown_resticted is set to some value we should test it
if (defined $chown_restricted) {
# Return if the current directory is safe
return _is_safe($path,$err_ref) if POSIX::sysconf( $chown_restricted );
}
# To reach this point either, the _PC_CHOWN_RESTRICTED symbol
# was not available or the symbol was there but chown giveaway
# is allowed. Either way, we now have to test the entire tree for
# safety.
# Convert path to an absolute directory if required
unless (File::Spec->file_name_is_absolute($path)) {
lib/File/Temp.pm view on Meta::CPAN
#pod for sticky bit.
#pod
#pod =item HIGH
#pod
#pod In addition to the MEDIUM security checks, also check for the
#pod possibility of ``chown() giveaway'' using the L<POSIX|POSIX>
#pod sysconf() function. If this is a possibility, each directory in the
#pod path is checked in turn for safeness, recursively walking back to the
#pod root directory.
#pod
#pod For platforms that do not support the L<POSIX|POSIX>
#pod C<_PC_CHOWN_RESTRICTED> symbol (for example, Windows NT) it is
#pod assumed that ``chown() giveaway'' is possible and the recursive test
#pod is performed.
#pod
#pod =back
#pod
#pod The level can be changed as follows:
lib/File/Temp.pm view on Meta::CPAN
for sticky bit.
=item HIGH
In addition to the MEDIUM security checks, also check for the
possibility of ``chown() giveaway'' using the L<POSIX|POSIX>
sysconf() function. If this is a possibility, each directory in the
path is checked in turn for safeness, recursively walking back to the
root directory.
For platforms that do not support the L<POSIX|POSIX>
C<_PC_CHOWN_RESTRICTED> symbol (for example, Windows NT) it is
assumed that ``chown() giveaway'' is possible and the recursive test
is performed.
=back
The level can be changed as follows:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/Tools.pm view on Meta::CPAN
=cut
=head2 chown
For now use the built in chown function.
It accepts only UID and GID values, but it is easy to retreive them:
chown $uid, $gid, @files;
chown getpwnam($user), getgrname($group), @files;
For recursive application use the L<find> function.
find( sub {chown $uid, $gid, $_}, @dirs);
Windows: See chmod above.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/Truncate/Undoable.pm view on Meta::CPAN
On do, will trash file then create an empty file (with the same permission and
ownership as the original). On undo, will trash the new file and untrash the old
file.
Note: chown will not be done if we are not running as root. Symlink is currently
not permitted.
Fixed state: file exists and size is not zero.
Fixable state: file exists and size is not zero.
lib/File/Truncate/Undoable.pm view on Meta::CPAN
my $res = File::Trash::Undoable::trash(
-tx_action=>'fix_state', path=>$path, suffix=>substr($taid,0,8));
return $res unless $res->[0] == 200 || $res->[0] == 304;
open my($fh), ">", $path or return [500, "Can't create: $!"];
chmod $st[2] & 07777, $path; # ignore error?
unless ($>) { chown $st[4], $st[5], $path } # XXX ignore error?
return [200, "OK"];
}
[400, "Invalid -tx_action"];
}
lib/File/Truncate/Undoable.pm view on Meta::CPAN
On do, will trash file then create an empty file (with the same permission and
ownership as the original). On undo, will trash the new file and untrash the old
file.
Note: chown will not be done if we are not running as root. Symlink is currently
not permitted.
Fixed state: file exists and size is not zero.
Fixable state: file exists and size is not zero.
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-basic.t view on Meta::CPAN
subtest "root tempdir tests" => sub {
plan skip_all => "not root" if $>;
mkdir "$tempdir/sub0", 0700 or die;
chmod 0700, "$tempdir/sub0" or die;
chown 1000, 0, "$tempdir/sub0" or die;
$ENV{XDG_RUNTIME_DIR} = "$tempdir/sub0";
is(get_user_tempdir(), "$tempdir/sub0/$>",
"rejects different-owner tempdir");
};
t/01-basic.t view on Meta::CPAN
"rejects group-writable subdir");
subtest "root subdir tests" => sub {
plan skip_all => "not root" if $>;
$ENV{TMPDIR} = "$tempdir/sub0";
chown 1000, 0, "$tempdir/sub0/$>" or die;
is(get_user_tempdir(), "$tempdir/sub0/$>.1",
"rejects different-owner subdir");
};
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/chown.pm view on Meta::CPAN
package File::chown;
our $DATE = '2015-09-10'; # DATE
our $VERSION = '0.02'; # VERSION
use 5.010001;
lib/File/chown.pm view on Meta::CPAN
use warnings;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(
chown
);
sub chown {
my $opts = ref($_[0]) eq 'HASH' ? shift : {};
my ($user, $group);
if ($opts->{ref}) {
my @st = stat($opts->{ref})
or die "Can't stat chown ref '$opts->{ref}': $!";
($user, $group) = @st[4, 5];
} else {
@_ or die "Please specify user";
$user = shift // -1;
unless ($user =~ /\A-?\d+\z/) {
lib/File/chown.pm view on Meta::CPAN
$group = $grent[2];
}
}
if (!($opts->{deref} // 1)) {
require File::lchown;
return File::lchown::lchown($user, $group, @_);
} else {
return CORE::chown($user, $group, @_);
}
}
1;
# ABSTRACT: chown which groks user-/group names and some other extra features
__END__
=pod
=encoding UTF-8
=head1 NAME
File::chown - chown which groks user-/group names and some other extra features
=head1 VERSION
This document describes version 0.02 of File::chown (from Perl distribution File-chown), released on 2015-09-10.
=head1 SYNOPSIS
use File::chown; # exports chown() by default
# chown by user-/group names
chown "ujang", "ujang", @files;
# numeric ID's still work
chown -1, 500, "myfile.txt";
# option: use a reference file's owner/group instead of specifying directly,
# like the Unix chown command's --reference=FILE.
chown({ref => "/etc/passwd"}, "mypasswd");
# option: use lchown instead of chown, like Unix chown command's --no-derefence
# (-h).
chown({deref=>0}, "nobody", "nobody", "/home/user/www");
=head1 DESCRIPTION
L<File::chown> provides C<chown()> which overloads the core version with one
that groks user-/group names, as well as some other extra features.
=head1 FUNCTIONS
=head2 chown([ \%opts, ] LIST) => bool
Changes the owner (and group) of a list of files. Like the core version of
C<chown()>, The first two elements of the list must be C<$user> and C<$group>
which can be numeric ID's (or -1 to mean unchanged) or string which will be
looked up using C<getpwnam> and C<getgrnam>. Function will die if lookup fails.
It accepts an optional first hashref argument containing options. Known options:
=over
=item * ref => str
Like C<--reference> option in the C<chown> Unix command, meaning to get C<$user>
and C<$group> from a specified filename instead of from the first two elements
of the argument list.
=item * deref => bool (default: 1)
If set to 0 then, like the C<--no-dereference> (C<-h>) option of the C<chown>
Unix command, will use L<File::lchown> instead of the core C<chown()>. This is
to set ownership of a symlink itself instead of the symlink target.
=back
=head1 SEE ALSO
C<chown> in perlfunc
The C<chown> Unix command
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/File-chown>.
=head1 SOURCE
Source repository is at L<https://github.com/perlancar/perl-File-chown>.
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=File-chown>
When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/lchown.pm view on Meta::CPAN
# You may distribute under the terms of either the GNU General Public License
# or the Artistic License (the same terms as Perl itself)
#
# (C) Paul Evans, 2010,2025 -- leonerd@leonerd.org.uk
package File::lchown 0.03;
use v5.14;
use warnings;
use Exporter 'import';
our @EXPORT_OK = qw(
lchown
lutimes
);
require XSLoader;
XSLoader::load( __PACKAGE__, our $VERSION );
=head1 NAME
C<File::lchown> - modify attributes of symlinks without dereferencing them
=head1 SYNOPSIS
=for highlighter language=perl
use File::lchown qw( lchown lutimes );
lchown $uid, $gid, $linkpath or die "Cannot lchown() - $!";
lutimes $atime, $mtime, $linkpath or die "Cannot lutimes() - $!";
=head1 DESCRIPTION
The regular C<chown> system call will dereference a symlink and apply
ownership changes to the file at which it points. Some OSes provide system
calls that do not dereference a symlink but instead apply their changes
directly to the named path, even if that path is a symlink (in much the same
way that C<lstat> will return attributes of a symlink rather than the file at
which it points).
lib/File/lchown.pm view on Meta::CPAN
=head1 FUNCTIONS
=cut
=head2 lchown
$count = lchown $uid, $gid, @paths;
Set the new user or group ownership of the specified paths, without
dereferencing any symlinks. Passing the value C<-1> as either the C<$uid> or
C<$gid> will leave that attribute unchanged. Returns the number of files
successfully changed.
lib/File/lchown.pm view on Meta::CPAN
Set the access and modification times on the specified paths, without
dereferencing any symlinks. Passing C<undef> as both C<$atime> and C<$mtime>
will update the times to the current system time.
Note that for both C<lchown> and C<lutimes>, if more than one path is given,
if later paths succeed after earlier failures, then the value of C<$!> will
not be reliable to indicate the nature of the failure. If you wish to use
C<$!> to report on failures, make sure only to pass one path at a time.
I<Since version 0.03> either time may be given as a fractional value, or as an
lib/File/lchown.pm view on Meta::CPAN
=over 4
=item *
C<lchown(2)> - change ownership of a file
=item *
C<lutimes(2)> - change file timestamps
view all matches for this distribution
view release on metacpan or search on metacpan
my ($fuse_vmajor, $fuse_vminor, $fuse_vmicro) = fuse_version();
my $fuse_version = $fuse_vmajor + ($fuse_vminor * 1.0 / 1_000) +
($fuse_vmicro * 1.0 / 1_000_000);
# â ï¸ @names must match the callback_index enum defined in Fuse.xs
my @names = qw(getattr readlink mknod mkdir unlink rmdir symlink
rename link chmod chown truncate open read write
statfs flush release fsync setxattr getxattr listxattr
removexattr opendir readdir releasedir fsyncdir init
destroy access create lock utimens
bmap ioctl poll write_buf read_buf flock fallocate);
Returns an errno.
Called to change permissions on a file/directory/device/symlink.
=head3 chown
Arguments: Pathname, numeric uid, numeric gid.
Returns an errno.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Filesys/POSIX.pm view on Meta::CPAN
throw &Errno::ENOTDIR unless $inode->dir;
return $self->{'cwd'} = $inode;
}
=item C<$fs-E<gt>chown($path, $uid, $gid)>
Using C<$fs-E<gt>stat()> to locate the inode of the path specified, update that
inode object's 'uid' and 'gid' fields with the values specified. The inode of
the file modified will be returned.
=cut
sub chown {
my ( $self, $path, $uid, $gid ) = @_;
my $inode = $self->stat($path);
$inode->chown( $uid, $gid );
return $inode;
}
=item C<$fs-E<gt>fchown($fd, $uid, $gid)>
Using C<$fs-E<gt>fstat()> to locate the inode of the file descriptor specified,
update that inode object's 'uid' and 'gid' fields with the values specified. A
reference to the affected inode will be returned.
=cut
sub fchown {
my ( $self, $fd, $uid, $gid ) = @_;
my $inode = $self->fstat($fd);
$inode->chown( $uid, $gid );
return $inode;
}
=item C<$fs-E<gt>chmod($path, $mode)>
view all matches for this distribution
view release on metacpan or search on metacpan
easyxs/ppport.h view on Meta::CPAN
KEY_chdir|5.003007||Viu
KEY_CHECK|5.006000||Viu
KEY_chmod|5.003007||Viu
KEY_chomp|5.003007||Viu
KEY_chop|5.003007||Viu
KEY_chown|5.003007||Viu
KEY_chr|5.003007||Viu
KEY_chroot|5.003007||Viu
KEY_close|5.003007||Viu
KEY_closedir|5.003007||Viu
KEY_cmp|5.003007||Viu
easyxs/ppport.h view on Meta::CPAN
PERL_LANGINFO_H|5.027004||Viu
PERL_LAST_5_18_0_INTERP_MEMBER|5.017009||Viu
Perl_ldexp|5.021003|5.021003|n
PerlLIO_access|5.005000||Viu
PerlLIO_chmod|5.005000||Viu
PerlLIO_chown|5.005000||Viu
PerlLIO_chsize|5.005000||Viu
PerlLIO_close|5.005000||Viu
PerlLIO_dup2|5.005000||Viu
PerlLIO_dup2_cloexec|5.027008||Viu
PerlLIO_dup|5.005000||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
SmbClient.pm view on Meta::CPAN
=over
=item *
chown
=item *
chmod
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Filesys/Virtual/Async/Dispatcher.pm view on Meta::CPAN
}
return;
}
sub chown {
my( $self, $fh_or_path, $uid, $gid, $callback ) = @_;
# is it a fh or path?
if ( ref $fh_or_path ) {
# get the proper mount
my $mapping = $self->_resolve_fh( $fh_or_path );
if ( defined $mapping ) {
if ( exists $self->{'fhmap'}->{ $mapping } ) {
my( $mount, undef ) = $self->_findmount( $self->{'fhmap'}->{ $mapping } );
$mount->chown( $fh_or_path, $uid, $gid, $callback );
} else {
die "internal inconsistency - unknown fh: $fh_or_path";
}
} else {
die "internal inconsistency - unknown fh: $fh_or_path";
}
} else {
my( $mount, $where ) = $self->_findmount( $fh_or_path );
$mount->chown( $where, $uid, $gid, $callback );
}
return;
}
view all matches for this distribution
view release on metacpan or search on metacpan
my $self = shift;
aio_utime( $self->_path_from_root( shift ), $_[ 0 ], $_[ 1 ], $_[ 2 ] );
}
sub chown {
my $self = shift;
aio_chown( $self->_path_from_root( shift ), $_[ 0 ], $_[ 1 ], $_[ 2 ] );
}
sub truncate {
my $self = shift;
=item lstat()
=item utime()
=item chown()
=item truncate()
=item chmod()
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Filesys/Virtual/Async/inMemory.pm view on Meta::CPAN
}
return;
}
sub chown {
my( $self, $path, $uid, $gid, $callback ) = @_;
# FIXME we don't support fh mode because it would require insane amounts of munging the paths
if ( ref $path ) {
if ( DEBUG ) {
warn 'Passing a REF to chown() is not supported!';
}
$callback->( -ENOSYS() );
return;
}
lib/Filesys/Virtual/Async/inMemory.pm view on Meta::CPAN
# FIXME fix relative path/sanitize path?
# determine if we should be using callback mode
if ( ref( $self ) ne __PACKAGE__ ) {
if ( $self->can( '_chown' ) ) {
$callback->( $self->_chown( $path, $uid, $gid ) );
} else {
$callback->( -ENOSYS() );
}
return;
}
lib/Filesys/Virtual/Async/inMemory.pm view on Meta::CPAN
The way this module implements subclassing is to call a private method whenever it detects a subclass using this
module as a superclass. Please don't override the ::Async API! What you need to do is define your own _method subs
for the ones you want to override. All other methods that aren't defined will return ENOSYS to the ::Async API.
Available methods to implement: _rmtree, _scandir, _move, _copy, _load, _readdir, _rmdir, _mkdir, _rename, _mknod,
_unlink, _chmod, _truncate, _chown, _utime, _stat, _write, _open.
Again, please look at the source for this module to see how it interacts with the subclass. Some of the methods have
been "simplified" to reduce the pain of managing the data. Be sure to let this module create the object, because
we need the "readonly" attribute to be present in the hash! If "readonly" is set, this module will take over the
logic for certain methods and not call your method if there's a readonly violation ( write(), for example ).
view all matches for this distribution
view release on metacpan or search on metacpan
sub utime {
croak 'subclass didn\'t define utime';
}
sub chown {
croak 'subclass didn\'t define chown';
}
sub truncate {
croak 'subclass didn\'t define truncate';
}
=item lstat()
=item utime()
=item chown()
=item truncate()
=item chmod()
view all matches for this distribution
view release on metacpan or search on metacpan
=pod
=head2 mkdir($dir, $mode)
Creats a directory with $mode (defaults to 0755) and chown()'s the directory
with the uid and gid. The return value is from mkdir().
=cut
sub mkdir {
$mode ||= 0755;
my $ret = (mkdir($dir, $mode)) ? 1 : 0;
if ($ret) {
chown($self->{uid}, $self->{gid}, $dir);
}
return $ret;
}
=pod
view all matches for this distribution
view release on metacpan or search on metacpan
JS/js/sunos4.h view on Meta::CPAN
extern int connect(int, struct sockaddr *, int);
extern int readlink(const char *, char *, int);
extern int symlink(const char *, const char *);
extern int ftruncate(int, off_t);
extern int fchmod(int, mode_t);
extern int fchown(int, uid_t, gid_t);
extern int lstat(const char *, struct stat *);
extern int fstat(int, struct stat *);
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
extern int gethostname(char *, int);
extern char *getwd(char *);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Chj/IO/Tempfile.pm view on Meta::CPAN
defined $euid
or croak "xreplace_or_withmode: ?? can't stat own file "
. Chj::singlequote($path) . ": $!";
if ($euid == 0) {
$! = undef;
chown $uid, $gid, $path
or croak "xreplace_or_withmode: chown "
. Chj::singlequote($path) . ": $!";
} else {
if ($uid != $euid) {
carp "xreplace_or_withmode: warning: cannot set owner of "
. Chj::singlequote($path)
. " to $uid since we are not root"
if $warn_all_failures;
$mode &= 0777; # see below
}
$! = undef;
chown $euid, $gid, $path or do {
# only a warning, ok?
carp "xreplace_or_withmode: warning: could not set group of "
. Chj::singlequote($path)
. " to $gid: $!"
lib/Chj/IO/Tempfile.pm view on Meta::CPAN
# assuming stat object
$mode = $orwithmode->permissions;
if ($> == 0) {
$! = undef;
chown $orwithmode->uid, $orwithmode->gid, $path
or croak "xreplace_or_withmode: chown "
. Chj::singlequote($path) . ": $!";
}
} else {
if ($orwithmode =~ /^0/) {
$orwithmode = oct $orwithmode;
view all matches for this distribution
view release on metacpan or search on metacpan
sub rofs {
&Say("---45---rofs(@_)\n");
return -EROFS();
}
sub u_chmod { &rofs('chmod' ,@_); }
sub u_chown { &rofs('chown' ,@_); }
sub u_fsync { &rofs('fsync' ,@_); }
sub u_link { &rofs('link' ,@_); }
sub u_mkdir { &rofs('mkdir' ,@_); }
sub u_mknod { &rofs('mknod' ,@_); }
sub u_removexattr { &rofs('removexattr' ,@_); }
'release' => 'Fuse::Funifs::u_release' ,
#-- Not implemented callbacks
'getxattr' => 'Fuse::Funifs::u_getxattr', #--NOTE: avoid (keep this undef) to supress 2+ extra calls on each file
#-- Disabled access
'chmod' => 'Fuse::Funifs::u_chmod' ,
'chown' => 'Fuse::Funifs::u_chown' ,
'fsync' => 'Fuse::Funifs::u_fsync' ,
'link' => 'Fuse::Funifs::u_link' ,
'mkdir' => 'Fuse::Funifs::u_mkdir' ,
'mknod' => 'Fuse::Funifs::u_mknod' ,
'removexattr' => 'Fuse::Funifs::u_removexattr',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Fuse/Class.pm view on Meta::CPAN
Fuse::main(@args, %fnmap);
}
BEGIN {
@callback = qw (getattr readlink getdir mknod mkdir unlink
rmdir symlink rename link chmod chown truncate
utime open read write statfs flush release fsync
setxattr getxattr listxattr removexattr);
if (Fuse->can('fuse_version')) {
my $fuse_version = Fuse::fuse_version();
if ($fuse_version >= 2.3) {
lib/Fuse/Class.pm view on Meta::CPAN
=head2 chmod(PATH_NAME, MODE).
Return an errno (0 if success).
This method is called to change permissions on a entity.
=head2 chown(PATH_NAME, UID, GID).
Return an errno (0 if success).
This method is called to change ownership of a entity.
=head2 truncate(PATH_NAME, OFFSET).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Fuse/Filesys/Virtual.pm view on Meta::CPAN
sub chmod {
my $self = shift;
return 0;
}
=head2 chown
Always returns -EPERM.
This function is not supported by Virtual::Filesys.
=cut
sub chown {
my $self = shift;
return -EPERM();
}
=head2 truncate
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Fuse/PDF.pm view on Meta::CPAN
chmod => sub {
my ($file, $perms) = @_;
return $fs->fs_chmod($file, $perms);
}
) : (),
$fs->can('fs_chown') ? (
chown => sub {
my ($file, $uid, $gid) = @_;
return $fs->fs_chown($file, $uid, $gid);
}
) : (),
$fs->can('fs_truncate') ? (
truncate => sub {
my ($file, $length) = @_;
lib/Fuse/PDF.pm view on Meta::CPAN
support for threaded Perl in a future release. Patches welcome
(remove the C<threaded =E<gt> 0> line from this file and add locking
to L<Fuse::PDF::FS>).
B<Unsupported:> special files (named pipes, etc.), following symlinks
out of the filesystem, permission enforcement, C<chown>, C<flush>,
reading from unlinked filehandles.
B<Hard links:> I have not yet implemented hard links. I'll implement
compressed streams at the same time.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Fuse/PerlSSH/FS.pm view on Meta::CPAN
die "Cannot delfattr('$_[0]','$_[1]') - no namespace" if $_[1] !~ /\./;
my ($ns,$key) = split(/\./,$_[1],2);
File::ExtAttr::delfattr($_[0], $key, { namespace => $ns }) or die "Cannot delfattr('$_[0]','$_[1]') - $!";
},
);
$self->{ssh}->use_library('FS', qw( chown chmod lstat readlink rename rmdir symlink unlink utime ) );
$self->{ssh}->use_library('Fuse::PerlSSH::RemoteFunctions');
my $rval;
eval { $rval = $self->_remote->call("test_connection"); };
die "Fuse::PerlSSH::FS ssh connection not working!" if $@;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Fuse/Simple.pm view on Meta::CPAN
See L<Fuse>
=item B<"/"> => { hash for your root directory },
=item B<chmod> B<chown> B<flush> B<fsync> B<getattr> B<getdir> etc
See L<Fuse>
You can replace any of the low-level functions if you want, but if
you wanted to mess around with the dirty bits, you'd probably not be
lib/Fuse/Simple.pm view on Meta::CPAN
"/" => $fs,
);
# the default subs
my %fs_subs = (
"chmod" => \&fs_not_imp,
"chown" => \&fs_not_imp,
"flush" => \&fs_flush,
"fsync" => \&fs_not_imp,
"getattr" => \&fs_getattr,
"getdir" => \&fs_getdir,
"getxattr" => \&fs_not_imp,
lib/Fuse/Simple.pm view on Meta::CPAN
see L</SYNOPSIS>
=head1 NOTES
Most things apart from coderefs can't be written, and nothing can be
renamed, chown()ed, deleted, etc. This is not considered a bug, but I
reserve the right to add something clever in a later release :-)
=head1 BUGS
accessor() is a bit thick, doesn't handle seeks, multi-block writes,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Fuse/TM.pm view on Meta::CPAN
readlink=>sub { return $self->tm_readlink(@_); },
$self->{rw}?
( write=>sub { return $self->tm_write(@_);},
release=>sub { return $self->tm_release(@_); },
chmod=>sub { return $self->tm_dummy(@_); },
chown=>sub { return $self->tm_dummy(@_); },
utime=>sub { return $self->tm_dummy(@_); },
truncate=>sub { return $self->tm_truncate(@_); },
rename=>sub { return $self->tm_rename(@_); },
mkdir=>sub { return $self->tm_mkdir(@_); },
symlink=>sub { return $self->tm_symlink(@_); },
lib/Fuse/TM.pm view on Meta::CPAN
return 0;
}
return -EPERM();
}
# for utime, chmod, chown and other, nonimplemented but commonly used functions
sub tm_dummy
{
my ($self)=@_;
Carp::croak("invalid object argument\n") if (!ref($self) || !$self->isa(__PACKAGE__));
view all matches for this distribution
view release on metacpan or search on metacpan
use constant FUSE_IOCTL_RETRY => (1 << 2);
use constant FUSE_IOCTL_MAX_IOV => 256;
sub main {
my @names = qw(getattr readlink getdir mknod mkdir unlink rmdir symlink
rename link chmod chown truncate utime open read write statfs
flush release fsync setxattr getxattr listxattr removexattr
opendir readdir releasedir fsyncdir init destroy access
create ftruncate fgetattr lock utimens bmap);
my ($fuse_vmajor, $fuse_vminor, $fuse_vmicro) = fuse_version();
my $fuse_version = $fuse_vmajor + ($fuse_vminor * 1.0 / 1_000) +
Returns an errno.
Called to change permissions on a file/directory/device/symlink.
=head3 chown
Arguments: Pathname, numeric uid, numeric gid.
Returns an errno.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Future/Batch/ppport.h view on Meta::CPAN
KEY_chdir|5.003007||Viu
KEY_CHECK|5.006000||Viu
KEY_chmod|5.003007||Viu
KEY_chomp|5.003007||Viu
KEY_chop|5.003007||Viu
KEY_chown|5.003007||Viu
KEY_chr|5.003007||Viu
KEY_chroot|5.003007||Viu
KEY_close|5.003007||Viu
KEY_closedir|5.003007||Viu
KEY_cmp|5.003007||Viu
lib/Future/Batch/ppport.h view on Meta::CPAN
PERL_LANGINFO_H|5.027004||Viu
PERL_LAST_5_18_0_INTERP_MEMBER|5.017009||Viu
Perl_ldexp|5.021003|5.021003|n
PerlLIO_access|5.005000||Viu
PerlLIO_chmod|5.005000||Viu
PerlLIO_chown|5.005000||Viu
PerlLIO_chsize|5.005000||Viu
PerlLIO_close|5.005000||Viu
PerlLIO_dup2|5.005000||Viu
PerlLIO_dup2_cloexec|5.027008||Viu
PerlLIO_dup|5.005000||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
- \P{PROP} means literal P{PROP}
- \X means literal X
- support POSIX-style character classes
- modifier /a /d /l /u, and /aa of regexp makes die
- use 5.12.0; --> use 5.12.0; no strict qw(refs);
- remove test 201_kanji.t,202_kanji.t,203_kanji.t,204_kanji.t,205_glob.t,210_chmod.t,211_chown.t,212_dbmopen.t,214_glob.t,216_open.t,217_qx.t,218_rename.t,221_sysopen.t,222_system.t,223_truncate.t,225_utime.t,226_chdir.t,227_chmod.t,228_chown.t,229...
- created by INABA Hitoshi
0.75 2011-06-05 00:00:00
- remove Esjis::binmode and Esjis::open (it's a bad idea)
- created by INABA Hitoshi
view all matches for this distribution
view release on metacpan or search on metacpan
bin/gbrowse_import_ucsc_db.pl view on Meta::CPAN
unless (-d $dir) {
print STDERR "Creating database directory for $dsn. You may be prompted for your password.\n";
system "sudo mkdir -p $dir";
}
unless (-w $dir) {
system "sudo chown $uid $dir";
system "sudo chgrp $gid $dir";
}
return $dir;
}
bin/gbrowse_import_ucsc_db.pl view on Meta::CPAN
print STDERR "Creating FASTA index...";
my $index = Bio::DB::Fasta->new($path) or die "Couldn't create index";
print "done\n";
my $wwwuser = GBrowse::ConfigData->config('wwwuser');
system "sudo chown -R $wwwuser $path";
return $path;
}
sub create_gene_db {
my ($dir,$dsn) = @_;
bin/gbrowse_import_ucsc_db.pl view on Meta::CPAN
return if -e $file && -w $file;
my $uid = $<;
my ($gid) = $( =~ /^(\d+)/;
system "sudo touch $file";
system "sudo chown $uid $file";
system "sudo chgrp $gid $file";
system "chmod +w $file";
}
package GFFWriter;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/GD/Graph/Thermometer.pm view on Meta::CPAN
The system user under which this module was invoked does not
have sufficient permission to write to the result image file.
Make sure that the user has write permission on the target
directory, or alternately, touch the file into existance and
use chown and chmod to give write permissions on the result
file itself to the user which will invoke the module. If this
is run by your web server, that user is likely nobody, apache,
www-data or something similiar.
=item C<< The call to GD::Graph::Thermometer failed to define
view all matches for this distribution
view release on metacpan or search on metacpan
% make test
% make install
Tips :
- if you want secure memory, do not forget :
% chown root /usr/local/bin/gpg ; chmod 4755 /usr/local/bin/gpg
=head1 METHODS
Look at the "test.pl" and "quick_test.pl" for examples and futher explanations.
Q: How secure is GPG ?
A: As secure as you want... Be carefull. First, GPG is no
more securer than 'gpg'.
Second, all passphrases are stored in non-secure memory, unless
you "chown root" and "chmod 4755" your script first. Third, your
script probably store passpharses somewhere on the disk, and
this is *not* secure.
Q: Why using GPG, and not GnuPG or GnuPG::Interface ??
A: Because of their input/output facilities,
view all matches for this distribution