Globals


Annotated List
Files
Globals
Hierarchy
Index

sysadm/AppContext.h

sysadm/AssocFactory.h

sysadm/Association.h

sysadm/AttrBundle.h

sysadm/AttrEvent.h

sysadm/AttrListener.h

sysadm/Attribute.h

sysadm/Authenticator.h

sysadm/ByteStreamConnection.h

sysadm/Category.h

sysadm/CategoryErrorEvent.h

sysadm/CategoryErrorListener.h

sysadm/CategoryFactory.h

sysadm/CategoryListener.h

sysadm/ChildAttrAssoc.h

sysadm/ChildCategoryListener.h

sysadm/ClustersAssocWithMachine.h

sysadm/CollectionOf.h

sysadm/CollectionOfI.h

sysadm/CollectionsI.h

sysadm/CollectionsP.h

sysadm/Command.h

sysadm/ComputedAssoc.h

sysadm/Connection.h

sysadm/DictionaryOf.h

sysadm/DictionaryOfI.h

sysadm/DictionaryOfTempl.h

sysadm/ExampleCategory.h

sysadm/FileBasedCategory.h

sysadm/Hashable.h

sysadm/HashableI.h

sysadm/Item.h

sysadm/Log.h

sysadm/LogFilter.h

sysadm/LogListener.h

sysadm/MachinesAssocWithCluster.h

sysadm/NotificationFilter.h

sysadm/OrderedCollectionOf.h

sysadm/OrderedCollectionOfI.h

sysadm/OrderedFileName.h

sysadm/Packet.h

sysadm/PacketListener.h

sysadm/ParentAttrAssoc.h

sysadm/ParentCategoryListener.h

sysadm/RemoteShellConnection.h

sysadm/ResultEvent.h

sysadm/ResultListener.h

sysadm/RhinoExample.h

sysadm/SaParam.h

sysadm/SocketConnection.h

sysadm/String.h

sysadm/auth.h

sysadm/authproto.h

sysadm/io.h

sysadm/privdefs.h

sysadm/privilege.h

sysadm/salog.h

sysadm/salogI.h

sysadm/sysadm.h

 BEGIN_NAMESPACE (sysadm)

#include <sysadm/Association.h>

SaASSOC_REF_DEF should be used in c++ files defining classes which are accessed via AssocFactory. For example:

#include "ClustersAssocWithMachine.h" ... SaASSOC_REF_DEF(ClustersAssocWithMachine); ... ClustersAssocWithMachine::ClustersAssocWithMachine( Category& parentCategory, const String& parentSelector, Category& childCategory) { ... };

 BEGIN_NAMESPACE (sysadm)

#include <sysadm/CategoryListener.h>

SaCATEGORY_REF_DEF should be used in c++ files defining classes which are accessed via CategoryFactory. For example:

#include "ExampleCategory.h" ... SaCATEGORY_REF_DEF(ExampleClass); ... ExampleCategory::ExampleCategory() { ... } ...

 SaASSOC_REF_DECL (ClustersAssocWithMachine)

#include <sysadm/ClustersAssocWithMachine.h>

ClustersAssocWithMachine objects are accessed through their corresponding AssocRefs.

template <class Type> inline void  RemoveAndDestroyContentsOf ( CollectionOf<Type> *collectionAlias )

#include <sysadm/CollectionOf.h>

This version uses the delete operator on each of the elements.

template <class Type> inline void  RemoveAndDeleteContentsOf (CollectionOf<Type> * collectionAlias)

#include <sysadm/CollectionOf.h>

This version is identical to the RemoveAndDestrtoyContentsOf, only the name is different.

template <class Type> inline void  RemoveAndDeleteArrayContentsOf (CollectionOf<Type> *collectionAlias)

#include <sysadm/CollectionOf.h>

This version uses the delete[] operator on each of the elements.

template <class Type> inline void  RemoveAndFreeContentsOf ( CollectionOf<Type> * collectionAlias)

#include <sysadm/CollectionOf.h>

This version uses the free() function on each of the elements.

 SaCATEGORY_REF_DECL (ExampleCategory)

#include <sysadm/ExampleCategory.h>

ExampleCategory objects are accessed through their corresponding ObjRefs.

 BEGIN_NAMESPACE (sysadm)

#include <sysadm/FileBasedCategory.h>

File description:

Line 1: A sequence of name-type pairs. The name and the type are separated by the '!' character, and the pairs are separated by the ':' character. The names will be the keys of the attributes in the items, and the type is the type of data. Legal names consist of characters that are not '!' or '!'. Legal types are 'S' for String, 'L' for Long, 'B' for boolean, and 'D' for Double. As an example, the line

name!S:type!S:cluster!S:machine!S:group!S:defined!S:state!L:error!L

might be the first line in the ResourceCategory.data file.

The rest of the lines: A selector string followed by a sequence of attribute values separated by the ':' character. The values will be turned into attribute values with the type specified on Line 1. For strings and selectors, non ':' character are valid. For Booleans, valid entries are 'T' and 'F'. Longs and Doubles are converted by using atol and atof respectively. For example, the line

res1:resource 1:type 1:cluster 1:machine 2:group 1:machine 1:6:0

might specify a particular item. Notice that there is one more field in the item line than in the description line (Line 1). This is because the first field ("res1" in this case) is the selector for the item.

Use a '#' character as the first character of a line for a comment line.

 SaASSOC_REF_DECL (MachinesAssocWithCluster)

#include <sysadm/MachinesAssocWithCluster.h>

MachinesAssocWithCluster objects are accessed through their corresponding AssocRefs.

template <class Type> inline void  RemoveAndDestroyContentsOf ( OrderedCollectionOf<Type> *collectionAlias )

#include <sysadm/OrderedCollectionOf.h>

Convenience function to remove and delete each object in a ordered collection. It's not a member function of OrderedCollectionOf because then OrderedCollection of const objects would not work right.

typedef struct _SaParam SaParam

#include <sysadm/SaParam.h>

If SaParamParseArgs() sees this argument, it will read arguments from file descriptor 0 in addition to the command line.

extern SaParamSaParamCreate (void)

#include <sysadm/SaParam.h>

Creating and destroying parameters. SaParamCreate() returns NULL if malloc() fails.

extern int  SaParamSet (SaParam *param, const char *key, const char *value)

#include <sysadm/SaParam.h>

Getting and setting parameters. SaParamSet() returns 0 if successful, -1 if malloc() fails. SaParamGet() returns NULL if there is no value for "key".

extern int  SaParamSetHidden (SaParam *param, const char *key, const char *value)

#include <sysadm/SaParam.h>

SaParamSetHidden is used to hide sensitive parameters from log files. If SaParamSetHidden(param, "key", "value") is called, then the SaExecArgs routines will pass the parameter for "key" via stdin rather than on the command line.

extern int  SaParamSend (SaParam *param, int fd)

#include <sysadm/SaParam.h>

Sending and receiving parameters. SaParamSend() returns 0 if successful, -1 if it cannot write to fd. Both methods return -1 if malloc() fails.

extern int  SaParamParseArgs (SaParam *param, int argc, char *argv[])

#include <sysadm/SaParam.h>

Parse command line arguments of the form "key=value" into key/value pairs. In any key/value pair, if "value" is the empty string then subsequent calls to SaParamGet() for that key will return NULL. If the argument SaPARAM_INPUT_ARG is encountered, key value pairs are read from file descriptor 0 as well by calling SaParamReceive().

Returns 0 if successful, -1 if memory is exhausted, if read fails, or if an unrecognized argument is encountered.

extern SaParamExecArgsSaParamExecArgsCreate (SaParam *param, const char *const *env, ...)

#include <sysadm/SaParam.h>

Pass arguments to another command via exec().

SaParamExecArgsCreate() breaks "params" into two chunks. The first chunk is returned by SaParamExecArgsGet() and should be passed to the execv() system call as its second parameter. The second chunk should be sent to the command's standard input by calling SaParamExecArgsSend().

The dividing line between the two chunks is the point at which the size of the arguments + the size of the environment reaches the maximum size supported by the kernel. If all of the parameters fit on the command line, the second chunk will be empty.

Any parameters that were set with SaParamSetHidden() are passed in the second chunk, regardless of whether the args fit.

The "env" argument to SaParamExecArgsCreate() is the environment which will be used for the new command, and is used to calculate the maximum argument size. The arguments following "env" are the initial arguments for the command; SaParamExecArgsCreate() will append the arguments corresponding to "param". The last argument to SaParamExecArgsCreate() should be NULL.

extern SaParamExecArgsSaParamExecArgsCreateV (SaParam *param, int argc, const char *const *argv, const char *const *env)

#include <sysadm/SaParam.h>

SaPramExecArgsCreateV() takes arguments in argc, argv form instead of as varargs.

extern char *const * SaParamExecArgsGet (SaParamExecArgs *args)

#include <sysadm/SaParam.h>

SaParamExecArgsGet() returns the first chunk in a form suitable for passing to execv(). The return value is owned by libsysadmParam and should not be modified or freed by the caller. The return value remains valid until SaParamExecArgsDestroy() is called.

SaParamExecArgsSend() sends the second chunk over "fd". "fd" is assumed to the write end of a pipe which is the command's standard input.

SaParamExecArgsSendNeeded() can be used to determine whether a call to SaParamExecArgsSend() is necessary. If SaParamExecArgsSendNeeded() returns 0, then there is no need to call SaParamExecArgsSend() (although it doesn't hurt).

extern size_t  SaParamGetEnvSize (const char *const *env)

#include <sysadm/SaParam.h>

Utility function for measuring the size of an environment.

extern SaParamIterSaParamIterCreate (SaParam *param)

#include <sysadm/SaParam.h>

Iterating over the keys.

bool  StringToBool ( const String& str, bool& retVal )

#include <sysadm/String.h>

handles t/f, true/false, on/off, 1/0

String  StringFromBool ( bool val )

#include <sysadm/String.h>

Converts to "True" or "False"

String  StringFromFile (const char * fileName)

#include <sysadm/String.h>

Reads in the contents of a file and returns a String with the contents. If there is a problem opening the file or reading it, NUL will be returned, and errno is set to indicate the error.

SaAuthSaAuthOpen (const char *authScheme, SaAuthType authType)

#include <sysadm/auth.h>

Open the dso corresponding to authScheme, and create a corresponding SaAuth structure.

void  SaAuthClose (SaAuth *auth)

#include <sysadm/auth.h>

Close the dso corresponding to auth.

const char * SaAuthGetName (SaAuth *auth)

#include <sysadm/auth.h>

Get the name of an an authentication scheme. This returns the same string ("same" meaning strcmp will be equal) that was passed to SaAuthOpen.

void  SaAuthInitWidgets (SaAuth *auth)

#include <sysadm/auth.h>

Initialize widgets for SaPrivDialog just prior to the dialog being displayed. Only valid if SaAuthOpen() was called with SaAuthSender.

void  SaAuthSendParams (SaAuth *auth, int infd, int outfd)

#include <sysadm/auth.h>

Send authentication parameters. To support challenge/response interactions, outfd should be used to send responses and infd should be used to receive challenges. Only valid if SaAuthOpen() was called with SaAuthSender.

bool  SaAuthCheckParams (SaAuth *auth, int infd, int outfd)

#include <sysadm/auth.h>

Check authentication parameters sent by SaAuthSendParams. Use infd to get responses sent by SaAuthSendParams, and outfd to send challenges. Only valid if SaAuthOpen() was called with SaAuthReceiver.

typedef struct _auth AUTH

#include <sysadm/authproto.h>

When writing an auth dso, define "struct _auth" to contain whatever data you need to keep track of during execution. This is here to avoid the need for global variables.

typedef enum AuthType

#include <sysadm/authproto.h>

If Open is called with AUTH_SENDER, a call to Createidgets followed by a call to InitWidgets followed by a call to SendParams is to be expected. If Open is called with AUTH_RECEIVER, a call to CheckParams is to be expected.

void  InitWidgets (AUTH *auth)

#include <sysadm/authproto.h>

This gets called right before the SaPrivDialog dialog box is displayed, either for the first time or a subsequent time. It gives the auth dso a chance to initialize its widgets.

void  SendParams (AUTH *auth, int infd, int outfd)

#include <sysadm/authproto.h>

Send authentication parameters as specified by the widgets that were created by CreateWidgets. If further interaction is necessary here, it's OK to bring up a subsequent dialog.

bool  CheckParams (AUTH *auth, int intfd, int outfd)

#include <sysadm/authproto.h>

Check that the parameters sent by SendParams are valid. Return B_TRUE if they're valid, B_FALSE if they're not. This function should test isatty(infd); it's possible CheckParams is interacting with the user through a tty as opposed to through motif widgets. In this case, prompts should be printed to the user (via /dev/tty) and then echo should be turned off when the user types sensitive stuff.

If !isatty(infd), then infd and outfd should be file descriptors for communicating with a GUI program, and SendParams will be at the other end of the socket.

void  Close (AUTH *auth)

#include <sysadm/authproto.h>

Called when authentication dso is no longer needed. Any memory pointed to by auth should be freed, widgets should be destroyed, file descriptors should be closed, etc.

extern ssize_t  SaRead (int fd, void *buf, size_t n)

#include <sysadm/io.h>

Like read(2), but retries when interrupted.

extern ssize_t  SaReadFully (int fd, void *buf, size_t n)

#include <sysadm/io.h>

Like read(2), but keeps retrying until all bytes are read or an error occurs.

extern ssize_t  SaWrite (int fd, const void *buf, size_t n)

#include <sysadm/io.h>

Like write(2), but retries when interrupted.

extern ssize_t  SaWriteFully (int fd, const void *buf, size_t n)

#include <sysadm/io.h>

Like write(2), but keeps retrying until all bytes are written or an error occurs.

typedef enum --

#include <sysadm/privdefs.h>

checkpriv(1M) prints one of these values (converted to ASCII decimal) if its exit status is SaPRIVOK and it was passed the "-reason" argument.

bool  SaHasPrivInDB (const char *user, const char * const *privs, unsigned int nPrivs)

#include <sysadm/privilege.h>

The difference between SaHasPrivInDB and SaCheckPriv: SaHasPrivInDB simply does the lookup in the privilege database to see if the requested privileges are OK.

SaCheckPriv also considers things like whether the current user happens to be root or maybe there's no root password (in which case everybody is privileged), as well as default privileges and privileged users.

bool  SaIsDefaultPrivilege (const char *privilege)

#include <sysadm/privilege.h>

Callers of SaCheckPriv don't need to worry about default privileges and privileged users; SaCheckPriv takes of checking that. These are here for clients who care about the difference (such as rmpriv).

bool  SaPrivilegesAreEnabled (void)

#include <sysadm/privilege.h>

SaPrivilegesAreEnabled returns B_FALSE if privileges are chkconfig'd off.

void  SaPrivCheckFile (const char *fileName)

#include <sysadm/privilege.h>

SaPrivCheckFile() makes sure that "fileName" and the directory it's in are owned by root and only writable by root. If the directory is owned or writable by a user other than root SaPrivCheckFile exits. The privilege admin commands use this to defend themselves against hackers.

bool  SaPrivAuthenticate (const char *authScheme)

#include <sysadm/privilege.h>

SaPrivAuthenticate() does authentication handshaking over stdin and stdout.

void  SaPrivFixUmask (void)

#include <sysadm/privilege.h>

SaPrivFixUmask sets the umask to a reasonable value.

void  SaPrivValidatePrivName (const char* privName)

#include <sysadm/privilege.h>

Verify a privilege name. This function exits if "privName" is bogus. If SaPrivVerifyPrivName thinks the user is trying to spoof us, it exits with no error message.

typedef struct _SaLog SaLog

#include <sysadm/salog.h>

Opaque handle for logging API.

typedef enum SaLogStatus

#include <sysadm/salog.h>

Return status of functions

typedef enum --

#include <sysadm/salog.h>

Error codes

extern const char * _SaLogFile

#include <sysadm/salogI.h>

These are here for testing purposes. Test programs can set these variables to control which files are used for logging.


Generated by: rusty@irem on Mon Sep 18 18:07:52 2000, using kdoc 2.0a36.