Previous | Next | Contents | Index |
Update a field in an existing account.FORMAT
int POPSTORE_user_update (user_context, item_list errmsg, errmsg_len, errmsg_max) POPSTORE_user_context *user_context; POPSTORE_item_list *item_list; char *errmsg; int *errmsg_len; int errmsg_max; |
User context to update. Used for input and output.
user_context
Item list describing the updates to perform. Used for input only.
item_list
Address of character array that
errmsg
POPSTORE_user_update
can put an error message into if the password change fails.Address of an integer that
errmsg_len
POPSTORE_user_update
can write the length of the error message that it put intoerrmsg
.The size of the array that
errmsg_max
errmsg
points to.
One or more fields in a popstore profile file can be changed by calling POPSTORE_user_update. The fields to update and the new values to use are described using an array of item descriptors, each of which specifies an action and provides the information needed to perform that action. The list of item descriptors is terminated with an entry with the POPSTORE_SET_END item code. The list of item descriptors is referred to as an item list. When the item list is successfully processed, both the on-disk and in-memory profile is updated and the POPSTORE_SUCCESS item code is returned.6 Should an error occur while processing the item list, no updates are made to the underlying user profile file, and POPSTORE_user_end returns an error status. Depending upon the nature of the error, the in-memory profile data can have been changed. Note that the username field can not be changed with POPSTORE_user_update. Use POPSTORE_user_copy_d withdo_rename
=1 to change the username field for an existing account. Moreover, the MANAGE usage flag can not be set or cleared without first calling POPSTORE_manage to authorize such activity. Theitem_list
argument is a pointer to an array of one or more item descriptors whose type is given by thePOPSTORE_item_list
structure shown below:
The interpretation of the three fields in an item descriptor is as follows:
typedef struct { int item_code; void *item_address
; int item_length; } POPSTORE_item_list;ThePOPSTORE_item_list item descriptor fields
A signed, longword integer containing a user-supplied symbolic code specifying an action to be taken by PMDF_user_update. A description of each item code follows this list of item descriptor fields.
item_code
A pointer to the value to use in updating the profile field indicated by the associated
item_address
item_code
. Not all actions require that a value be supplied for theitem_address
field.A signed, longword integer containing the user-supplied length of the data pointed at by
item_length
item_address
. Not all actions require that anitem_length
be specified.item_code
values accepted by POPSTORE_user_update are as follows:POPSTORE_user_update item codes
POPSTORE_SET_CHAIN
This item code can be used to direct the item list processing to another item list. The value of theitem_address
field should be a pointer to another POPSTORE_item_list structure. Theitem_length
field is ignored.POPSTORE_SET_END
The end of the item list is indicated by this item code. Theitem_address
anditem_length
fields are ignored.POPSTORE_SET_FLAGS_DELETE
Set the DELETE usage flag. Theitem_address
anditem_length
fields are ignored.POPSTORE_SET_FLAGS_DISMAIL
Set the DISMAIL usage flag. Theitem_address
anditem_length
fields are ignored.POPSTORE_SET_FLAGS_DISUSER
Set the DISUSER usage flag. Theitem_address
anditem_length
fields are ignored.POPSTORE_SET_FLAGS_LOCKPWD
Set the LOCKPWD usage flag. Theitem_address
anditem_length
fields are ignored.POPSTORE_SET_FLAGS_MANAGE
Set the MANAGE usage flag. Theitem_address
anditem_length
fields are ignored. A prior call to POPSTORE_manage must be made in order to permit setting the MANAGE flag.POPSTORE_SET_FLAGS_NO_DELETE
Clear the DELETE usage flag. Theitem_address
anditem_length
fields are ignored.POPSTORE_SET_FLAGS_NO_DISMAIL
Clear the DISMAIL usage flag. Theitem_address
anditem_length
fields are ignored.POPSTORE_SET_FLAGS_NO_DISUSER
Clear the DISUSER usage flag. Theitem_address
anditem_length
fields are ignored.POPSTORE_SET_FLAGS_NO_LOCKPWD
Clear the LOCKPWD usage flag. Theitem_address
anditem_length
fields are ignored.POPSTORE_SET_FLAGS_NO_MANAGE
Clear the MANAGE usage flag. Theitem_address
anditem_length
fields are ignored. A prior call to POPSTORE_manage must be made in order to permit clearing the MANAGE flag.POPSTORE_SET_GROUP_NAME
Set the value of the group field. The value of theitem_address
field must point to a string value. The value of theitem_length
field must be the length in bytes of the string value. That length can not exceed POPSTORE_MAX_GROUP_LEN bytes.POPSTORE_SET_LAST_BILLING
Set the value for the last billing time field. The value of theitem_address
field must point to atime_t
value expressing the last billing time as the number of seconds since 1 January 1970. Theitem_length
field is ignored.POPSTORE_SET_LAST_CONNECT
Set the value of the last connect time field. The value of theitem_address
field must point to atime_t
value expressing the last connect time as the number of seconds since 1 January 1970. Theitem_length
field is ignored.POPSTORE_SET_LAST_DISCONNECT
Set the value of the last disconnect time field. The value of theitem_address
field must point to atime_t
value expressing the last disconnect time as the number of seconds since 1 January 1970. Theitem_length
field is ignored.POPSTORE_SET_LAST_PWD_CHANGE
Set the value of the last password change time field. The value of theitem_address
field must point to atime_t
value expressing the last password change time as the number of seconds since 1 January 1970. Use a value of zero to indicate that the account password is pre-expired. Theitem_length
field is ignored.POPSTORE_SET_MESSAGE_COUNT
Set the value of the message count field. If the value, V, is less than the count of currently stored messages, M, then the first M-V stored messages will be deleted. The value of theitem_address
field must point to auint32
value denoting the new message count. Theitem_length
field is ignored.POPSTORE_SET_NOOP
This signifies an item descriptor which should be ignored. Theitem_address
anditem_length
fields are ignored.POPSTORE_SET_OVERDRAFT
Set the overdraft storage quota. The value of theitem_address
field must point to auint32
value expressing the overdraft storage quota in units of bytes. Theitem_length
field is ignored.POPSTORE_SET_OWNER
Set the value of the owner field. The value of theitem_address
field must point to a string value. The value of theitem_length
field must be the length in bytes of the string value. That length can not exceed POPSTORE_MAX_OWN_LEN bytes.POPSTORE_SET_PASSWORD
Set the value of the password field. The value of theitem_address
field must point to a string value. The value of theitem_length
field must be the length in bytes of the string value. That length can not exceed POPSTORE_MAX_PWD_LEN bytes.POPSTORE_SET_PAST_BLOCK_DAYS
Set the past block days accounting field. The value of theitem_address
field must point to auint32
value expressing the new past block days value to use. Theitem_length
field is ignored. Note that when the past block days field is set, the past block days remainder field is set to a value of zero.POPSTORE_SET_PRIVATE
Set the value of the site-defined private data field. The value of theitem_address
field must point to a string value. The value of theitem_length
field must be the length in bytes of the string value. That length can not exceed POPSTORE_MAX_PRIV_LEN bytes.POPSTORE_SET_QUOTA
Set the primary storage quota. The value of theitem_address
field must point to auint32
value expressing the primary storage quota in units of bytes. Theitem_length
field is ignored.POPSTORE_SET_TOTAL_CONNECT
Set the elapsed total connect time. The value of theitem_address
field must point to auint32
value expressing the elapsed total connect time in units of seconds. Theitem_length
field is ignored.
POPSTORE_SUCCESS Normal, successful completion. POPSTORE_BADITMCOD Unrecognized item code specified. No changes made to the on-disk or in-memory user information. POPSTORE_BADLENGTH Length of a string value is less than zero. No changes made to the on-disk or in-memory user information. POPSTORE_CMDBADVAL Attempt made to set the message count to a value exceeding the count of currently stored messages. No changes made to the on-disk or in-memory user information. POPSTORE_FILOPNERR Unable to open the profile file for reading and writing. No changes made to the on-disk or in-memory user information. POPSTORE_INSUFPRIV The process lacks SYSLCK privilege (OpenVMS only). No changes made to the on-disk or in-memory user information. POPSTORE_LCKOPNERR Unable to obtain lock information for the profile file. No changes made to the on-disk or in-memory user information. POPSTORE_LOCKERROR Unable to obtain a lock for the profile file. No changes made to the on-disk or in-memory user information. POPSTORE_NOPRIVILEGE Process is not allowed to set or clear the MANAGE usage flag without a prior call to POPSTORE_manage. No changes made to the on-disk or in-memory user information. POPSTORE_NULLCONTEXT user_context
is null. No changes made to the on-disk or in-memory user information.POPSTORE_NULLPROFILE user_context->profile
context is null. No changes made to the on-disk or in-memory user information.POPSTORE_PWDLOCKED Cannot change the password; password is locked. No changes made to the on-disk or in-memory user information. POPSTORE_READERROR An error occurred while reading data from the profile file. No changes made to the on-disk or in-memory user information. POPSTORE_SEEKERROR An error occurred while seeking to a location in the profile file. No changes made to the on-disk or in-memory user information. POPSTORE_TOOLONG Length of string value exceeds permitted length. No changes made to the on-disk or in-memory user information. POPSTORE_WRITERROR An error occurred while writing data to the profile file. No changes made to the on-disk profile information; in-memory user information has been changed.
6 The in-memory profile is that
pointed at by
|
Previous | Next | Contents | Index |