ARCv2
view release on metacpan or search on metacpan
- Added the IP*PORT parameter to SASL *_new function, KERBEROS_V4
is possible now (depends on Authen::SASL::Cyrus 0.10)
- removed the CheckAcl method from the Command class, since there
is apparently no need for it.
0.03 Fri Jan 23 2004
- Documentation improvements (reimplemented members are hidden)
- Name for ARCv2 command line interface (arcx, arcxd) 01/23/2004
- Arc Extended
- Makefile.PL improvements
- default values for host, path and port during Makefile.PL
- first DESY Zeuthen production release.
0.02 Thu Jan 22 2004
- removed Config::IniFiles from Arc classes
- improved signal handling
- added client and server scripts, to be
able to use the client and start the server
from command line
- documentation
- structured internal variable access
Makefile.PL view on Meta::CPAN
use 5.008;
use ExtUtils::MakeMaker;
use strict;
use lib "scripts";
use PBConfig;
@config = (
[ "ConfigPath" , "s", "/etc/arcx", "Configuration path, where ARCv2 shall find its files." ],
[ "DefaultPort", "i", "4242", "Default port, client and server use this as default." ],
[ "DefaultHost", "s", "arcdsrv", "Default host, client uses this as default." ],
[ "DefaultPIDFile", "s", "/var/run/arcxd.pid", "Default PID file, server uses this as default" ],
);
$fn = "lib/Arc.pm";
$usage = \&Usage;
opt_parse;
# Checking values
make -C docs
This is a workaround until I'll have a better idea.
Then to install
perl Makefile.PL
make
make test
make install
It is possible to add default value argumenting it to perl Makefile.PL:
e.g.
perl Makefile.PL --ConfigPath=/etc/arcx --DefaultPort=4242 --DefaultHost=arcdserv
Maybe this makes rpm & deb handling easier.
COPYRIGHT AND LICENCE
Copyright (C) 2003-5 Patrick Boettcher
lib/Arc/Command.pod view on Meta::CPAN
my $pw = <>;
if ($pw ne "klaus") {
return $this->_SetError("Wrong password.");
}
}
In ARCv2 some standard commands are already implemented: C<Arc::Command::Get>,
C<Arc::Command::Put>, C<Arc::Command::Uptime>, C<Arc::Command::Whoami>,
C<Arc::Command::Test>.
By default, these classes are mapped to B<Command Names> as follows (in the
default arcxd.conf for arcxd):
uptime => Arc::Command::Uptime,
whoami => Arc::Command::Whoami,
copy => Arc::Command::Get,
cp => Arc::Command::Get,
get => Arc::Command::Get,
put => Arc::Command::Put,
test => Arc::Command::Test,
help => Arc::Command::Help,
B<Caution>: Especially take care of the C<Arc::Command::Get> and
C<Arc::Command::Put> in production environment. As ARCv2 will probably
run as root and by default the Get and Put command do NOT have an access
control, everyone can get or put any files from/to your ARCv2 server.
There are some member variables, which contain information about the
client. See 'Class VARIABLES' for a complete list of them. These values
are filled by Arc::Connection::Server, when the client wants to run a command.
=head1 Class VARIABLES
=head3 PUBLIC MEMBERS
lib/Arc/Connection/Server.pm view on Meta::CPAN
use Arc qw(LOG_AUTH LOG_USER LOG_ERR LOG_CMD LOG_SIDE LOG_DEBUG);
use Arc::Connection;
use MIME::Base64;
@Arc::Connection::Server::ISA = qw(Arc::Connection);
sub members
{
my $this = shift;
return { %{$this->SUPER::members},
_realm => "", # Name of the SASL realm, if the user is from the default realm, this is empty
logfileprefix => "server",
sasl_cb_getsecret => "", # Callback for SASL (if PLAIN (or equal) mechanisms are used). See Authen::SASL(::Cyrus).
sasl_cb_checkpass => 0, # Callback for SASL (if PLAIN (or equal) mechanisms are used). See Authen::SASL(::Cyrus).
sasl_mechanisms => undef, # array of allowed SASL mechanisms
commands => undef, # hash of assignment between B<Command Name> and B<Command Class>. See L<Arc::Command>
};
}
lib/Arc/Connection/Server.pm view on Meta::CPAN
}
return !$this->{_error};
}
sub _CheckCmd
{
my $this = shift;
my ($cmd, $perlcmd) = @_;
# Do nothing by default.
# This method is mearly here so a sub-class can override it.
return undef;
}
sub _SplitCmdArgs
{
my $this = shift;
my $para = shift;
return split(/\s+/,$para) if defined $para; # better splitting for array TODO
lib/Arc/Connection/Server.pod view on Meta::CPAN
=over 2
=back
=head3 PROTECTED MEMBERS
=over 2
=item _realm
B<Description>: Name of the SASL realm, if the user is from the default realm, this is empty
B<Default value>: ""
=back
=over 2
=item _authenticated I<inherited from Arc::Connection>
B<Description>: Are we authenticated
lib/arcx.pod view on Meta::CPAN
This file is a basic command line interface for the ARCv2.
=head1 SYNOPSIS
The command line interface arcx:
=over 4
=item arcx
Connect to the default host, on the default port and start the interactive
ARC-shell (Term::ReadLine).
=item arcx -h arcserver -p 1234 vos release scripts
Connection arcserver:1234 and run the ARCv2 command "vos" with the
parameters "release scripts"
=item cat /etc/passwd | arcx put /default/etc/passwd
Pipe the content of /etc/passwd through the encrypted connection and let
the server write the content to /default/etc/passwd.
=item arcx get /default/etc/passwd > /etc/passwd
Read the /default/etc/passwd on the server machine and write it locally
to /etc/passwd.
=back
=head1 USAGE
As usual a command line interface has some parameters to influence the behaviour.
The scheme looks like this:
lib/arcxd.pod view on Meta::CPAN
=item arcxd -P arcxd.pid
Let arcxd store the pid of the master process in arcxd.pid.
=back
=head1 USAGE
Some parameters can be supplied to this scripts. The most of them come from the configuration file.
By default arcxd fork itself into background. If you want to run arcx in the foreground set the -d option.
The scheme looks like this:
arcxd [-d <loglevel>] [-p <port>] [-F <config file>] [-v]
=head2 Parameter
=over 4
=item -d <loglevel>
Let the server put its log output to "stderr" and set the log level to <loglevel>. Also tells the server to do not fork into the background.
=item -p <port>
On which port the server shall listen on. (override the one from the configuration file and the default port). Change this for testing purposes.
=item -P <pid_file>
Where should the Net::Server store the PID of the master process.
=item -F <config file>
Specify the configuration file, to fill ARCv2 appropriately. Default is arcxd.conf in the default path $Arc::Default Path.
=item -v
The verbose option. If this option is set, arcxd is verbose in its context. This option does not influence the ARCv2 object. Use -d for it.
=back
=head1 CONFIGURATION FILE
=head2 Example:
scripts/PBConfig.pm view on Meta::CPAN
}
Getopt::Long::GetOptions(
$opt,
"help",
@go
);
&$usage() if $opt->{help};
# getting default values
foreach (@config) {
$opt->{$_->[0]} = $_->[2] unless defined $opt->{$_->[0]};
}
}
sub file_parse {
open(FS,"<$fn");
open(FD,">$fn.new");
my $c = 0;
scripts/PBConfig.pm view on Meta::CPAN
}
}
print FD $l unless $ins;
}
close(FS);
close(FD);
if ($c != scalar @config) {
#if (1) {
die "Could not find all hooks for setting default values in $fn.";
} else {
unlink("$fn");
rename("$fn.new","$fn");
}
}
sub opt_help
{
foreach (@config) {
my ($n);
scripts/arcx view on Meta::CPAN
$msg
$0 [-h <hostname>] [-p <port>] [-l <loglevel]
[-L <logdestination] [-n] [-v] [-S <service>]
[-F -f <history>] [-u|-U <username>] [-a|-A <authname>]
[-w|-W <password>] [-s <mech>] [-t <timeout in sec>]
[-r <string>] [-V] [-C <conffile>] [command [command-arguments]]
(Remark: Some parameters behave different in comparison to the old arc)
-h <hostname> specify the ARCv2 server
-p <port> port to connect (default: $Arc::DefaultPort)
-t <timeout> specify the timeout in seconds (default: 30 secs)
-0 use old protocol type (unencrypted protocol conn.)
-C <conffile> use <conffile> as source for server-command-mapping.
(default: $Arc::ConfigPath/arcx.conf)
-r <string> use this string as stdin value for the command
-S <service> name of the service used for arc auth (default: arc)
-s <mech> use <mech> as authentication mechanism for SASL
-n do nothing, just try to authenticate
-v be verbose
-U <username> username for authentication (dep. on SASL mechanism)
-u ask for username
-A <authz name> username for authorization (dep. SASL mechanism)
-a ask for authname
-W <password> password (dep. on SASL mechanism)
-w ask for password
-f <history> filename for command history (def: $ENV{HOME}/.archistory)
-F don't add commands to the history file
-l <loglevel> loglevel (see man Arc) (default: 0, error msgs will be on stderr)
-L <logdest> log destination (possible values: 'syslog' (def) or 'stderr')
-V display version information
$Arc::Copyright
$Arc::Contact
EOT
exit 1;
}
scripts/arcxd.init.d.solaris view on Meta::CPAN
ARCXD_PATH=/opt/products/perl/5.8.2/scripts
case "$1" in
'start')
ps -ef | grep "$ARCXD_PATH/arcxd" | grep -v grep > /dev/null 2>&1
if [ $? -eq 0 ]
then
echo "arcxd daemon already running."
echo "please check if there are running both"
echo " one with default port and one with port 4243"
exit 1
fi
if [ -x $ARCXD_PATH/arcxd ]
then
echo "Starting arcx service ..."
$ARCXD_PATH/arcxd
# for batch jobs
$ARCXD_PATH/arcxd -p 4243
( run in 0.627 second using v1.01-cache-2.11-cpan-0a6323c29d9 )