ct_remote_pwd

Description

Define or clear passwords to be used for server-to-server connections.

Syntax

CS_RETCODE ct_remote_pwd(connection, action,
                  server_name, snamelen, password,
                  pwdlen)
 
CS_CONNECTION   *connection;
CS_INT                     action;
CS_CHAR                 *server_name;
CS_INT                      snamelen;
CS_CHAR                 *password;
CS_INT                      pwdlen;

Parameters

connection

A pointer to a CS_CONNECTION structure. A CS_CONNECTION structure contains information about a particular client/server connection.

It is illegal to define remote passwords for a connection that is open.

action

One of the following symbolic values:

Value of action

Result

CS_SET

Sets the remote password

CS_CLEAR

Clears all remote passwords specified for this connection by setting them to NULL.

server_name

A pointer to the name of the server for which the password is being defined. *server_name is the name given to the server in an interfaces file.

If server_name is NULL, the specified password will be considered a universal password, to be used with any server that does not have a password explicitly specified.

If action is CS_CLEAR, server_name must be NULL.

snamelen

The length, in bytes, of *server_name. If *server_name is null-terminated, pass snamelen as CS_NULLTERM.

If action is CS_SET and server_name is NULL, pass snamelen as 0 or CS_UNUSED.

If action is CS_CLEAR, snamelen must be CS_UNUSED.

password

A pointer to the password being installed for remote logins to the *server_name server.

If action is CS_CLEAR, password must be NULL.

pwdlen

The length, in bytes, of *password. If *password is null-terminated, pass pwdlen as CS_NULLTERM.

If action is CS_SET and password is NULL, pass pwdlen as 0 or CS_UNUSED.

If action is CS_CLEAR, pwdlen must be CS_UNUSED.

Returns

ct_remote_pwd returns the following values:

Return value

Meaning

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

CS_BUSY

An asynchronous operation is already pending for this connection. See “Asynchronous programming”.

Usage

See also

ct_con_props, ct_connect