| Previous | Contents | Index | 
Process a popstore management command.
int POPSTORE_command_d (command, command_len, password_required, domain, domain_len user, user_len, password, password_len, usage, usage_len, out_info, out_info_len, context, output_proc) char *command; int command_len; int password_required char *domain; int domain_len; char *user; int user_len; char *password; int password_len; char *usage; int usage_len; char *out_info; int *out_info_len; void *context; int (*output_proc)();
The command to process. Used for input only.
commandLength in bytes of the command specified with
command_lencommand. Used for input only.Boolean flag indicating whether or not password authentication is required in order to process the command. Used for input only.
password_requiredName of the user domain associated with the user
domainuser. Supply a value ofNULLto indicate thedefaultdomain. Used for input only.Length in bytes of the user domain name,
domain_lendomain. Supply a value of zero to indicate thedefaultdomain. Used for input only.Name of the popstore user account to authenticate against when password authentication is required. Used for input only.
userLength in bytes of the username specified with
user_lenuser. Used for input only.User-supplied, plain text password to use when performing a password authentication. Used for input only.
passwordLength in bytes of the plain text password specified with
password_lenpassword. Used for input only.Usage description to be passed to site-supplied logging subroutines explaining the usage. Used for input only.
usageLength in bytes of the usage description specified with
usage_lenusage. Used for input only.Output buffer to receive post-processing information. Used for output only.
out_infoOn input, the maximum length in bytes of the buffer pointed at by
out_info_lenout_info. On output, the length in bytes of the information placed in theout_infobuffer. Used for input and output.Pointer to private client data to be passed to the client-supplied
contextoutput_procprocedure. Used for input only.Address of a client-supplied subroutine to receive command processing output. Used for input only.
output_proc
The management commands documented in Chapter 4 are processed by the POPSTORE_command_d subroutine. Sites wanting to produce their own management interfaces can do so by generating management commands in the URL format described in Chapter 4 and then invokingPOPSTORE_commandto process those commands. The commands should reference site-supplied formatting files which then format the command results in the desired format.2 When called,POPSTORE_command_dwill use the active privileges of the caller to access and manipulate the popstore. Thepassword_requiredargument can be used to implement a utility which itself has privileges but requires, for operation, that the user know the username and password of a popstore account with management privileges. When a non-zero value is supplied forpassword_required, values for theuser,user_len,password, andpassword_lenarguments must be supplied. The supplied plain text password will be authenticated against the specified account. If the password is correct and the account has theMANAGEusage flag set, then the indicated command will be processed. Otherwise, aPOPSTORE_AUTHFAILorPOPSTORE_NOMANAGEerror will be returned. Moreover, the account will only be allowed to perform management functions on other accounts within the same management group. Whenuseranduser_lenarguments are supplied, the operation to be undertaken will be restricted to accounts within the same management group and subgroups ofuser. This behavior is regardless the setting of thepassword_requiredargument. On return from callingPOPSTORE_command, theout_infobuffer will contain the name of the formatting file associated with either the processed command'son_successoron_errorparameter. If the command was successfully processed, then the buffer will contain the value specified with the command'son_successparameter. If the command was not successfully processed, then the value specified by theon_errorparameter will be returned. If you do not care to have this information returned, specify a null value forout_infoorout_info_lenor both. Theoutput_procprocedure is called repeatedly to received lines of output generated as a result of processing the command. The procedure takes the form
where the arguments to
int output_proc (context, data, data_len, is_eol, is_literal, is_error) void *context; char *data; int data_len; int is_eol; int is_literal; int is_error;output_procare as follows:Upon successful completion,
contextPointer to the private client data supplied as input to POPSTORE_command. dataData to output. This string can not be null terminated. data_lenLength in bytes of the data pointed at by data.is_eolWhen is_eolhas a non-zero value, theoutput_procprocedure can want to output an end-of-line after this batch of formatted data.is_literalWhen is_literalhas a non-zero value, theoutput_procprocedure should not apply any quoting to the output data. The output data is literal data which was contained within the formatting file.is_errorWhen is_errorhas a non-zero value, the output data is an error message relating to the processed command.output_procshould return the valuePOPSTORE_SUCCESS. In the event of an error, some value other thanPOPSTORE_SUCCESSshould be returned. A user-requested abort can be signified by returningPOPSTORE_ABORT.
POPSTORE_SUCCESS Normal, successful completion. POPSTORE_BADARG Null value received for the out_procargument.POPSTORE_ERRORS The command was parsed and executed; execution of the command resulted in some errors which were reported via the output_procprocedure.POPSTORE_AUTHFAIL Invalid password or username supplied. The command was not executed. POPSTORE_BADHEXVAL The command contained an illegal hexadecimal encoded character. The command was not executed. POPSTORE_CMDTOOLONG The command contained too many name=value pairs. The command was not executed. POPSTORE_CMDUNKOWN The command contained an unrecognized right-hand-side in a name=value pair. The command was not executed. POPSTORE_CMDUNKOWNL The command contained an unrecognized left-hand-side in a name=value pair. The command was not executed. POPSTORE_NOMANAGE Specified account lacks management privileges. The command was not executed. POPSTORE_PWDREQUIRED A username and password are required. The command was not executed. POPSTORE_VMERROR Insufficient virtual memory. The command was not executed. Any error returned by the output_procprocedure.Any other popstore error. 
| 2 This is precisely how the Web-based and command line oriented management utilities are implemented. | 
| Previous | Next | Contents | Index |