ct_remote_pwd

Description

Defines or clears passwords to be used for server-to-server connections.

Syntax

CS_RETCODE ct_remote_pwd(connection, action,	                         servername, srvlen,
                          passwd, pwd_len);
CS_CONNECTION   *connection;
CS_INT          action;
CS_CHAR         *servername;
CS_INT          srvnamelen;
CS_CHAR         passwd;
CS_INT          pwd_len;

Parameters

connection

(I) Handle for this connection. This connection handle must already be allocated with ct_con_alloc.

Remote passwords can only be defined for a connection that is not open. Passwords defined after a connection is open are ignored.

action

(I) Action to be taken by this call. action is an integer variable that indicates the purpose of this call. action can be any of the following symbolic values:

Value

Meaning

CS_SET (34)

Sets the remote password.

CS_CLEAR (35)

Clears all remote passwords specified for this connection.

servername

(I) Name of the server for which the password is being defined. This is the name by which the server is known in the Server Path Table.

If action is CS_CLEAR, set servername to zeroes.

If servername is blank, the specified password is considered a “universal” password, to be used with any server that does not have a password explicitly specified for it.

srvnamelen

(I) Length, in bytes, of servername. To use the default “universal” password, assign CS_NULL_STRING to this argument.

passwd

(I) Password being installed for remote logins to the server named in servername.

If action is CS_CLEAR, set passwd to zeroes, and the password defaults to the one set for this connection in ct_con_props, if any.

passwd_len

(I) Length, in bytes, of passwd.

Returns

ct_remote_pwd returns one of the following values:

Value

Meaning

CS_SUCCEED (-1)

Results are available for processing.

CS_FAIL (-2)

The routine failed.

TDS_INVALID_PARAMETER (-4)

One or more of the ct_remote_pwd arguments contains an illegal value.

Likely causes for this code are:

  • Erroneous value for action. action cannot be CS_GET for ct_remote_pwd.

  • Erroneous value for a length argument. Length values cannot be negative numbers.

TDS_SOS (-257)

Memory shortage. The operation failed.

Usage

See also

Related functions