CTBREMOTEPWD

Description

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

Syntax

%INCLUDE CTPUBLIC;
 
 DCL
     01 CONNECTION    FIXED BIN(31) INIT(0);
     01 RETCODE          FIXED BIN(31) INIT(0);
     01 ACTION              FIXED BIN(31) INIT(1);
     01 SERVERNAMECHAR(30);
     01 SRV_LEN           FIXED BIN(31);
     01 SRV_BLANKSTRIP    FIXED BIN(31);
     01 PASSWDCHAR(30);
     01 PWD_LEN           FIXED BIN(31);
     01 PWD_BLANKSTRIP    FIXED BIN(31);
 
CALL CTBREMOT (CONNECTION, RETCODE, ACTION, SERVERNAME, SRV_LEN, SRV_BLANKSTRIP, PASSWD, PWD_LEN, PWD_BLANKSTRIP);

Parameters

CONNECTION

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

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

RETCODE

(O) Variable where the result from an executed function returns. Its value is one of the codes listed under “Returns,” in this section.

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 zeroes, the specified password will be considered a “universal” password, to be used with any server that does not have a password explicitly specified for it.

SERVERNAME_LEN

(I) Length, in bytes, of SERVERNAME. To use the default “universal” password, assign CS_ NULL_ STRING to this argument. To indicate that the value is terminated at the last non-blank character, assign CS_TRUE to SRVBLANKSTRIP.

SRVBLANKSTRIP

(I) Blank stripping indicator. Indicates whether the value in the buffer is terminated at the last non-blank character. Assign this argument one of the following symbolic values:

Value

Meaning

CS_TRUE (1)

Trailing blanks are stripped. The value in the buffer ends at the last non-blank character.

CS_FALSE (0)

Trailing blanks are not stripped. They are included in the value.

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 CTBCONPROPS, if any.

PASSWD_LEN

(I) Length, in bytes, of PASSWD. To indicate that the value is terminated at the last non-blank character, assign CS_TRUE to PWDBLANKSTRIP.

PWDBLANKSTRIP

(I) Blank termination indicator. Indicates whether the value of the password is terminated at the last non-blank character.

Assign this argument one of the following symbolic values:

Value

Meaning

CS_TRUE (1)

Trailing blanks are stripped. The value in the buffer ends at the last non-blank character.

CS_FALSE (0)

Trailing blanks are not stripped. They are included in the value.

Returns

CTBREMOTEPWD 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 CTBREMOTEPWD arguments contains an illegal value.

Likely causes for this code are:

  • Erroneous value for ACTION. ACTION cannot be CS_GET for CTBREMOTEPWD.

  • 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: