view release on metacpan or search on metacpan
# --- MakeMaker tool_xsubpp section:
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
MV = mv
NOOP = $(SHELL) -c true
NOECHO = @
RM_F = rm -f
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Search/Tutorial.pm view on Meta::CPAN
);
$app->run();
Now make it executable:
$ chmod +x search.pl
=head2 Step 6: Test Your Instance Script
First, test it on the command-line:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Application/Structured/Tools/Starter.pm view on Meta::CPAN
sub create_server_pl {
my $self = shift;
my $fname = File::Spec->catfile( $self->{basedir}, 'server.pl' );
$self->create_file( $fname, $self->server_pl_guts() );
chmod 0755, ($fname);
$self->progress("Created $fname");
return 'server.pl';
}
lib/CGI/Application/Structured/Tools/Starter.pm view on Meta::CPAN
sub create_debug_sh {
my $self = shift;
my $fname = File::Spec->catfile( $self->{basedir}, 'debug.sh' );
$self->create_file( $fname, $self->debug_sh_guts() );
chmod 0755, ($fname);
$self->progress("Created $fname");
return 'debug.sh';
}
lib/CGI/Application/Structured/Tools/Starter.pm view on Meta::CPAN
$self->{template_path} = File::Spec->rel2abs( $self->{templatedir} );
# Store template directory
my $fname = File::Spec->catfile( $tdir, 'create_controller.pl' );
$self->create_file( $fname, $self->create_pl_guts() );
chmod 0755, ($fname);
$self->progress("Created $fname");
return 'script/create_controller.pl';
}
lib/CGI/Application/Structured/Tools/Starter.pm view on Meta::CPAN
}
# create the user script
my $fname = File::Spec->catfile( $tdir, 'create_dbic_schema.pl' );
$self->create_file( $fname, $self->create_create_dbic_guts() );
chmod 0755, ($fname);
$self->progress("Created $fname");
return 'script/create_dbic_schema.pl';
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Auth/Auto.pm view on Meta::CPAN
=head1 EXAMPLE SCRIPT
This example script is included in the distribution.
Example assumes you installed CGI::Auth support files in $ENV{DOCUMENT_ROOT}/../cgi-bin/auth
Make this $ENV{DOCUMENT_ROOT}/../cgi-bin/auth.cgi to test it. Don't forget chmod 0755.
#!/usr/bin/perl -w
BEGIN { use CGI::Carp qw(fatalsToBrowser); eval qq|use lib '$ENV{DOCUMENT_ROOT}/../lib';|; } # or wherever your lib is
use strict;
use CGI::Auth::Auto;
lib/CGI/Auth/Auto.pm view on Meta::CPAN
The authdir needs to exist and contain a user.dat simple text file.
If you do not provide an authdir argument, that's ok, we try to guess for it.
If your script is in /home/myself/cgi-bin/script.pl , then your auth dir is guessed as
/home/myself/cgi-bin/auth
And it must exist and contain the user.dat file. This can be a blank text file to begin with.
Make sure it is chown and chmod properly.
If your cgi is failing, turn on L<DEBUG> and run it again. A lot of useful information may be there.
=head2 Auth::check - Invalid 'User Name' field at ...
view all matches for this distribution
view release on metacpan or search on metacpan
eg/01_template.pl view on Meta::CPAN
setup_pfile => 1,
logoff_param => 'cik',
changep_param => 'changepassword',
cookie_id => 'passcookie',
cookie_timeout => '10m',
chmod_value => 0777,
);
$auth->set_template(template());
$auth->set_title(title());
return $auth;
view all matches for this distribution
view release on metacpan or search on metacpan
AuthRegister.pm view on Meta::CPAN
if ($redirect_uri ne '') {
my $stoken = &gen_secret; $userid=~s/["<>]//g;
my $f = "$DBdir/$DBcasTokens";
if (!-f $f && !&check_db_files) { $LogReport.=$Error; &store_log;
print "<html><body>Error: $Error"; exit; }
if (!-f $f) { putfile $f, ''; chmod 0600, $f; }
&_db8_append($f, "userid:$userid\nstoken:$stoken" );
if ($Error ne '') { $LogReport.=$Error; &store_log;
print "<html><body>Error: $Error"; exit; }
my $h = "<input type=\"hidden\" name=\"username\" value=\"$userid\">";
$page=~ s/<!--!hiddenfields-->/$h\n$&/;
AuthRegister.pm view on Meta::CPAN
# params: $email, opt: pwstore type: md5 raw
sub reset_password {
my $email = shift; my $pwstore = shift; $pwstore = 'md5' if $pwstore eq '';
my $password = &random_password(6); my $pwdf = "$DBdir/$DBpwd";
if (!-f $pwdf) { putfile $pwdf, ''; chmod 0600, $pwdf }
if (!&lock_mkdir($pwdf)) { $Error.="378-ERR:\n"; return ''; }
local *PH; open(PH, $pwdf) or croak($!);
my $content = '';
while (<PH>) {
my ($e,$p) = split;
AuthRegister.pm view on Meta::CPAN
$content .= "$email ";
if ($pwstore eq 'raw') { $content.="raw:$password" }
elsif($pwstore eq 'md5') { $content.="md5:".md5_base64($password) }
else { $content.="raw:$password" }
$content .= "\n";
putfile $pwdf, $content; chmod 0600, $pwdf; &unlock_mkdir($pwdf);
return $password;
}
# $pwstoretype:md5,raw
sub password_set {
AuthRegister.pm view on Meta::CPAN
my ($e,$p) = split;
if ($e eq $email) { $content.=$newrow; $newrow=''; }
else { $content.=$_ }
}
$content.=$newrow; $newrow=''; close(PH);
putfile $pwdf, $content; chmod 0600, $pwdf; &unlock_mkdir($pwdf);
return 1;
}
sub md5_base64 {
my $arg=shift; require Digest::MD5; return Digest::MD5::md5_base64($arg); }
AuthRegister.pm view on Meta::CPAN
sub check_db_files {
my $ret; my $pwfile = "$DBdir/$DBpwd";
if (!-d $DBdir) { $ret = mkdir($DBdir, 0700);
if (!$ret) { $Error.="687-ERR: Could not create dir '$DBdir'"; return ''; }}
if (!-f $pwfile) { putfile $pwfile, ''; chmod 0600, $pwfile; }
if (!-f $pwfile) { $Error.="689-ERR: Could not create $pwfile file";
return ''; }
my $f = "$DBdir/$DBusers";
if (!-f $f) { putfile $f, "#userid:someid\n#email:email\@domain.com\n";
chmod 0600, $f; }
if (!-f $f) { $Error.="694-ERR: Could not create $f file"; return ''; }
$f = "$DBdir/$DBsessions";
if (!-d $f) { $ret = mkdir($f, 0700);
if (!$ret) { $Error.="708-ERR: Could not create dir '$f'"; return ''; }}
AuthRegister.pm view on Meta::CPAN
}
if ($argcopy ne $arg_save) {
if (!open(F, ">$dbf.lock/new")) { &unlock_mkdir($dbf);
$Error.="828-ERR: opening file $dbf.lock/new: $!"; return ''; }
print F $argcopy; close(F); chmod 0600, "$dbf.lock/new"; unlink($dbf);
rename("$dbf.lock/new", $dbf); }
&unlock_mkdir($dbf);
} # end of _db8_remove
# Read DB records in the RFC822-like style (to add reference).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Browse.pm view on Meta::CPAN
=over 4
=item 1. Install CGI::Browse.
=item 2. Set script ownership (chown) and permissions (chmod) if necessary.
=item 3. Run the included browse.sql script against your database.
=item 4. Edit browse.cgi and change the database "mydb" to your database name.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Builder/Auth.pm view on Meta::CPAN
=item * Set File Permissions!
Ensure that the DB files are B<writable> by your web server. On many systems
the web server runs as a special user, which might be called 'apache', 'www',
or 'nobody'. This user B<must> be able to read and write your DB files. You may
have to C<chmod 777 filename> to get this to work. THIS IS THE MOST COMMON
PROBLEM.
=item * Set Directory Permissions
Ensure that the DB files actually exist after running your program. Your web
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Compile.pm view on Meta::CPAN
# share the same directory when forked
my $tmp_dir;
sub _eval {
my $code = \$_[1];
# we use a tmpdir chmodded to 0700 so that the tempfiles are secure
$tmp_dir ||= File::Spec->catfile(File::Spec->tmpdir, "cgi_compile_$$");
if (! -d $tmp_dir) {
mkdir $tmp_dir or die "Could not mkdir $tmp_dir: $!";
chmod 0700, $tmp_dir or die "Could not chmod 0700 $tmp_dir: $!";
}
my ($fh, $fname) = File::Temp::tempfile('cgi_compile_XXXXX',
UNLINK => 1, SUFFIX => '.pm', DIR => $tmp_dir);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/ContactForm.pm view on Meta::CPAN
Upload the CGI file in ASCII transfer mode to your C<cgi-bin>.
=item 2.
Set the file permission 755 (chmod 755).
=back
If that doesn't do it, there are many CGI tutorials for beginners
available on the web. This is one example:
view all matches for this distribution
view release on metacpan or search on metacpan
erecipes/perl/lib/CGI/Ex/Recipes/Install.pm view on Meta::CPAN
if ( -d $file ){ mkpath($file_dest) }
if ( !-d $file ){
copy( $file, $file_dest) or die "Copy failed: $!";
if($file_dest =~/\.(pl|cgi)$/) {
chmod 0755,$file_dest and change_shebang_sitepackage_and_siteroot($file_dest);
}elsif($file_dest =~/(httpd\.conf)$/){
my $fh = IO::File->new("< $file_dest");
my @lines;
( $fh->binmode and @lines = $fh->getlines and $fh->close ) || die $!;
foreach ( 0 .. @lines-1 ) {
erecipes/perl/lib/CGI/Ex/Recipes/Install.pm view on Meta::CPAN
}
}
#make (tmp|conf|logs|data|files) and below world writable so the server can write there
#TODO:think about a safer/smarter way
chmod 0777,$file_dest
if($file_dest =~/(tmp|conf|logs|data|files)/);
#TODO:REMEMBER to write a script which will change permissions as needed
#sleep 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
samples/benchmark/bench_conf_writers.pl view on Meta::CPAN
my %TESTS = ();
### do perl
my $dir = File::Temp->newdir();
chmod 0755, $dir;
my $tmpnam = "$dir/bench";
my $file = $tmpnam. '.pl';
$TESTS{pl} = sub {
$cob->write_ref($file, $str);
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Fast.pm view on Meta::CPAN
my $path = $ENV{FCGI_SOCKET_PATH} || $socket;
my $perm = $ENV{FCGI_SOCKET_PERM} || $socket_perm;
my $backlog = $ENV{FCGI_LISTEN_QUEUE} || $queue || 100;
my $socket = FCGI::OpenSocket( $path, $backlog );
if ($path !~ /^:/ && defined $perm) {
chmod $perm, $path or croak( "Couldn't chmod($path): $!" );
}
return FCGI::Request(
( $in_fh || \*STDIN ),
( $out_fh || \*STDOUT ),
( $err_fh || \*STDERR ),
view all matches for this distribution
view release on metacpan or search on metacpan
bin/cfm-install.pl view on Meta::CPAN
{
my $cgi_file = File::Spec->catfile($opt{dir}, "cgi", "fm.pl");
open my $fh, ">", $cgi_file or die "Could not open '$cgi_file' $!\n";
print $fh $CGI::FileManager::Templates::cgi;
chmod oct(755), $cgi_file;
}
#print <<MSG;
#You have to add users now. Please run:
view all matches for this distribution
view release on metacpan or search on metacpan
doc/FormMagick-FAQ.html view on Meta::CPAN
<P>You probably need to make your <CODE>session-tokens</CODE> directory writable and
executable by the web server. Either:</P>
<PRE>
chown www session-tokens
(assuming your webserver runs as the www user)
chmod 700 session-tokens</PRE>
<P>Or...</P>
<PRE>
chmod 777 session-tokens</PRE>
<P>Note that the latter allows anyone on the system to write to this
directory, and is a greater security risk than the former method.</P>
</BODY>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Framework.pm view on Meta::CPAN
print "Creating directory $_ ";
mkdir($_, 0755) || die "\n\n:Error: Failed to create $_ : $!\n\n";
print "\n";
}
print "Changing $sessions_dir mode ";
chmod(0777, $sessions_dir) || die "\n\nError: Failed to chmod $sessions_dir to 777: $!\n\n";
print "\n";
#
# Create the files
#
lib/CGI/Framework.pm view on Meta::CPAN
print "Creating file $filename ";
open(FH, ">$filename") || die "\n\nError: Failed to open $filename for writing: $!\n\n";
print FH $content;
close(FH);
print "Setting permission to ", sprintf("%o", $mode), " ";
chmod($mode, $filename) || die "\n\nError: Failed to set mode on $filename to $mode: $!\n\n";
print "\n";
}
print "\n\nDONE: Your stub project is now ready in $dir\n\n";
exit;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Kwiki/Backup/Rcs.pm view on Meta::CPAN
my ($class) = shift;
my $self = $class->SUPER::new(@_);
unless (-d RCS_DIR) {
mkdir RCS_DIR;
umask 0000;
chmod 0777, RCS_DIR;
$user_name = 'kwiki-install';
for my $page_id ($self->database->pages) {
$self->commit($page_id);
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/uploads.t view on Meta::CPAN
mkdir $testdir, 0400;
SKIP: {
skip "subdir '$testdir' could not be created", 3 unless (-d $testdir);
# See http://www.perlmonks.org/?node_id=587550 for a discussion of
# the futility of chmod and friends on MS Windows systems.
SKIP: {
skip "Not available on $^O", 2 if ($^O eq 'MSWin32' or $^O eq 'cygwin');
skip "Running as privileged user: $ENV{USER}", 2 unless $>;
is ($cgi->set_directory ($testdir), 0, 'Set directory (unwriteable)');
chmod 0200, $testdir;
is ($cgi->set_directory ($testdir), 0, 'Set directory (unreadable)');
}
rmdir $testdir and open my $td, '>', $testdir;
print $td "Test\n";
close $td;
view all matches for this distribution
view release on metacpan or search on metacpan
demo/make_test_data.pl view on Meta::CPAN
$dbh->do("CREATE INDEX idx_inventory_product ON inventory(product)");
$dbh->do("CREATE INDEX idx_inventory_owner ON inventory(owner)");
$dbh->commit();
$dbh->disconnect();
system("chmod -R ugo+rwX db");
view all matches for this distribution
view release on metacpan or search on metacpan
{
# Ensure Changelog.ini is writable.
if (-e 'Changelog.ini' && ! -w 'Changelog.ini')
{
$error = (chmod 0200, 'Changelog.ini' == 0) ? 'Could not make Changelog.ini writable' : '';
}
if (! $error)
{
eval
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
mydist: README README.html lib/CGI/SpeedyCGI.pm readable tardist
readable:
chown -R $(USER) .
chmod -R u+w,go-w,go+r .
README: src/SpeedyCGI.pm
cd src && $(PERL) -e "use Pod::Text; pod2text(-80)" <SpeedyCGI.pm >../README
README.html: src/SpeedyCGI.pm
view all matches for this distribution
view release on metacpan or search on metacpan
bin/cgi-wiki-kwiki-install view on Meta::CPAN
print "Installing CGI::Wiki::Kwiki...\n";
print " installing cgi script\n";
copy($script, $target) or die "Can't install CGI script - $!\n";
chmod(0755, $target) or die "Can't make CGI script executable - $!\n";
print " Installing templates to ./templates\n";
mkdir "templates";
opendir TEMPLATES, $templates or die "Can't open template source folder: $!\n";
for (grep { /\.(tt|css)$/ } readdir(TEMPLATES)) {
bin/cgi-wiki-kwiki-install view on Meta::CPAN
}
closedir(TEMPLATES);
print " setting up DB\n";
system($setup, qw( --type sqlite --name wikidb )) and die "Can't set up DB\n";
chmod(0666, "wikidb") or die "Can't make database writable by all users\n";
print "CGI::Wiki::Kwiki is now installed in the current directory\n";
print "Edit the script $target to set options\n";
view all matches for this distribution
view release on metacpan or search on metacpan
Path/Makefile view on Meta::CPAN
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
LD = cc
MV = mv
NOOP = $(SHELL) -c true
RM_F = rm -f
view all matches for this distribution
view release on metacpan or search on metacpan
=head2 Security
CGI::pWiki will offer users from outside to write files in the
document root of your webserver. It is therefore a possible
security hole. The minimal security is to constrain write access
by using the Unix C<chmod> command. e.g. :
mkdir /var/www/test.copyleft.de
echo "=location /open/index.wiki" /var/www/test.copyleft.de/index.wiki
mkdir /var/www/test.copyleft.de/open
touch /var/www/test.copyleft.de/open/index.wiki
chmod a+w /var/www/test.copyleft.de/open
chmod a+w /var/www/test.copyleft.de/open/index.wiki
This will create a document root for the test site, installs
a relocation of the index page, and creates an open area and
its index page, and makes it world writeable, while other
areas will stay read only.
A typical all public site for creating open content may want
to allow every directory to be writeable. Adopt the following
lines to migrate existing content.
find /var/www/test.copyleft.de/ -print | xargs sudo chown kraehe.www-data
find /var/www/test.copyleft.de/ -type d -print | xargs chmod 6775
find /var/www/test.copyleft.de/ ! -type d -print | xargs chmod 664
You may want to restrict edit access to the Wiki as a webmaster
by defining a directory directive :
<Directory /var/www/test.copyleft.de>
directory needs to be writeable by the webserver, as it contains the
shadow pages, if people change the content online.
mkdir -p /var/www/test.copyleft.de/pWiki
mkdir -p /var/lib/pWiki/test.copyleft.de/pWiki
chmod a+w /var/lib/pWiki/test.copyleft.de/pWiki
Browse at your fresh created test site and enter the URL :
http://test.copyleft.de/pWiki/index.wiki
view all matches for this distribution
view release on metacpan or search on metacpan
Session/Makefile view on Meta::CPAN
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
LD = gcc -B/usr/ccs/bin/
MV = mv
NOOP = $(SHELL) -c true
RM_F = rm -f
Session/Makefile view on Meta::CPAN
POD2MAN_EXE = /usr/local/bin/pod2man
POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \
-e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "Makefile";' \
-e 'print "Manifying $$m{$$_}\n";' \
-e 'system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\047t install $$m{$$_}\n";' \
-e 'chmod(oct($(PERM_RW))), $$m{$$_} or warn "chmod $(PERM_RW) $$m{$$_}: $$!\n";}'
manifypods : pure_all Session.pm
@$(POD2MAN) \
Session.pm \
$(INST_MAN3DIR)/CGI::Session.$(MAN3EXT)
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
view release on metacpan or search on metacpan
lib/CIPP/Compile/Parser.pm view on Meta::CPAN
unlink $self->get_err_copy_filename;
my $object_type = $self->get_object_type;
if ( $object_type eq 'cipp' ) {
chmod 0775, $self->get_out_filename;
} elsif ( $object_type eq 'cipp-inc' ) {
chmod 0664, $self->get_out_filename;
} elsif ( $object_type eq 'cipp-module' ) {
my $tmp_module_file = $self->get_out_filename;
my $prod_filename;
(undef, undef, $prod_filename) = $self->get_object_filenames;
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/My/PerlFunctions/Command/Summary.pm view on Meta::CPAN
binmode - prepare binary files for I/O
bless - create an object
break - exit a loop prematurely
caller - get context of the current subroutine call
chdir - change your current working directory
chmod - changes the permissions on a list of files
chomp - remove a trailing record separator from a string
chop - remove the last character from a string
chown - change the owership on a list of files
chr - get character this number represents
chroot - make directory new root for path lookups
view all matches for this distribution
view release on metacpan or search on metacpan
easyxs/ppport.h view on Meta::CPAN
check_type_and_open|5.009003||Viu
check_uni|5.003007||Viu
check_utf8|5.008000||Viu
check_utf8_print|5.013009||Viu
child_offset_bits|5.009003||Viu
chmod|5.005000||Viu
chsize|5.005000||Viu
ckDEAD|5.006000||Viu
ck_entersub_args_core|||iu
ck_entersub_args_list|5.013006|5.013006|
ck_entersub_args_proto|5.013006|5.013006|
easyxs/ppport.h view on Meta::CPAN
KEY_break|5.027008||Viu
KEY_caller|5.003007||Viu
KEY_catch|5.033007||Viu
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
easyxs/ppport.h view on Meta::CPAN
Perl_langinfo|5.027004|5.027004|n
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
easyxs/ppport.h view on Meta::CPAN
Perl_pp_aelemfast_lex|5.015000||Viu
Perl_pp_andassign|5.013009||Viu
Perl_pp_avalues|5.013009||Viu
Perl_pp_bind|5.013009||Viu
Perl_pp_bit_xor|5.013009||Viu
Perl_pp_chmod|5.013009||Viu
Perl_pp_chomp|5.013009||Viu
Perl_pp_connect|5.013009||Viu
Perl_pp_cos|5.013009||Viu
Perl_pp_custom|5.013009||Viu
Perl_pp_dbmclose|5.013009||Viu
view all matches for this distribution
view release on metacpan or search on metacpan
bin/create-modulino.pl view on Meta::CPAN
unlink "$modulino_path";
}
copy( $path, "$modulino_path" );
chmod oct('0755'), "$modulino_path";
if ($alias) {
symlink "$modulino_path", "$destdir$bindir/$alias";
}
view all matches for this distribution