Patrick Boettcher > ARCv2 > Arc

Download:
ARCv2-1.05.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.05   Source  

NAME ^

Arc - Authenticated Remote Control v2

DESCRIPTION ^

ARC allows non-privileged users to run privileged commands on the server. The server decides if the user is allowed to run this command through ACL.

This file is a part of the Perl ARCv2 module suite. ARCv2 is a rewrite of ARC by R.Toebbicke, CERN, Switzerland in Perl.

ABSTRACT ^

From ARC by R. Toebbicke, modified by me: User requests are shipped from a client machine to a server using a SASL-authenticated socket connection. The purpose is to convey requests such as privileged commands (e.g. AFS, Crontab) to be executed on the server under appropriate privileges. Given that all privileges are confined to the server and the server can be programmed as to filter and check the command to be executed, the client machine can be less trusted than the server.

Because ARC-v1-Commands are written in perl anyway, implementing the client/server in perl makes sense. Platform-independence and "easy-to-read" source code are welcome too. This package provides two perl command line scripts (arcx, arcxd). They can be used for working with the ARC server from the command line, resp. to start the server.

SYNOPSIS ^

This is a abstract (known from c++) class. This is the base class which defines the namespace for the ARCv2 module suite.

Class VARIABLES ^

PUBLIC MEMBERS

logdestination

Description: Where should all the log output go to ('stderr','syslog')

Default value: 'syslog'

logfileprefix

Description: Prepended to every log entry

Default value: ""

loglevel

Description: loglevel is combination of bits (1=AUTH,2=USER,4=ERR,8=CMDDEBUG,16=VERBSIDE,32=DEBUG) see _Log method

Default value: 7

PROTECTED MEMBERS

_error

Description: contains the error message

Default value: undef

_syslog

Description: log to syslog or to STDERR

Default value: 1

PRIVATE MEMBERS

Class METHODS ^

PUBLIC METHODS

DESTROY ( )

Description: Destructor

IsError ( )

Description: User function to get the error msg.

Returns: the error message if any otherwise undef

Example:

unless (my $err = $arc->IsError()) { .. } else { print STDERR $err; }

Log ( $facility, ... (message) )

Description: Log function. Logs messages to 'logdestination' if 'loglevel' is is set appropriatly. loglevel behaviour has changed in the 1.0 release of ARCv2, the "Arc"-class can export LOG_AUTH (authentication information), LOG_USER (connection information), LOG_ERR (errors), LOG_CMD (ARCv2 addition internal command information), LOG_SIDE (verbose client/server-specific information), LOG_DEBUG (verbose debug information). It possible to combine the levels with or (resp. +) to allow a message to appear when not all loglevels are requested by the user. Commonly used for logging errors from application level.

Returns: always false

Example:

return $arc->Log(LOG_ERR,"Message");

new ( %hash, key => val, ... )

Description: Constructor. Initializes the object and returns it blessed. For all sub classes, please override _Init to check the parameter which are passed to the new function. This is necessary because you are not able to call the the new method of a parent class, when having a class name (new $class::SUPER::new, does not work.).

Returns: blessed object of the class

Example:

my $this = new Arc::Class ( key => value, key2 => value2 );

PROTECTED METHODS

_Debug ( ... (message) )

Description: Debug function. Logs messages with "DEBUG"

Returns: always false

Example:

$this->_Debug("hello","world"); # message will be "hello world"

_Init ( %hash, key => val, ... )

Description: Init function (initializes class context) Module dependent initialization, every subclass shall override it and call the _Init of its SUPER class. This method is called by the new method of Arc.

Returns: true, if all passed values are in their definition scope, otherwise false

Example:

see source code of any non-abstract sub class of Arc

_SetError ( ... (message) )

Description: SetError function. This function prepends the error message (@_) to an existing error message (if any) and logs the message with LOG_ERR facility. Use this function for setting an error from class level. Users should use IsError to get the message if a function failed.

Returns: always false

Example:

return $this->_SetError("User is not allowed to do this."); # breaks when an error occured

PRIVATE METHODS

SEE ALSO ^

Arc, Arc::Command, Arc::Connection, Arc::Connection::Server, Arc::Connection::Client, arcx, arcxd, Authen::SASL, Authen::SASL::Cyrus Net::Server::PreFork

AUTHOR ^

 Patrick Boettcher <patrick.boettcher@desy.de>

COPYRIGHT AND LICENSE ^

Copyright (c) 2003-5 Patrick Boettcher <patrick.boettcher@desy.de> and others. All rights reserved. Zeuthen, Germany, (old) Europe

 This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

 Special thanks go to:
DESY Zeuthen, in particular:

- Wolfgang Friebel for bleeding edge testing and heavy bug reporting (and the idea of reimplementing ARC).

- Waltraut Niepraschk and Andreas Haupt for their help and support during the development.

syntax highlighting: