The aftp_set_password call specifies the password for the connection to the AFTP server. This call can only be invoked prior to the establishment of a connection to the AFTP server. When a connection is open, the password cannot be changed. If a password is set, a user identifier also must be set using aftp_set_userid before connecting to the AFTP server. Use of this call sets the security type to AFTP_SECURITY_PROGRAM.
AFTP_ENTRY aftp_set_password(
IN AFTP_HANDLE_TYPE connection_id,
IN unsigned char AFTP_PTR password,
IN AFTP_LENGTH_TYPE length,
OUT AFTP_RETURN_CODE_TYPE AFTP_PTR return_code
);
{
AFTP_HANDLE_TYPE connection_id;
static unsigned char AFTP_PTR password = "MYPASS";
AFTP_RETURN_CODE_TYPE aftp_rc;
/*
* Before issuing the example call, you must have:
* a connection_id, use: aftp_create()
*
* You cannot have an open connection.
*/
/*
* Set the password for the AFTP connection.
*/
aftp_set_password(
connection_id,
password,
(AFTP_LENGTH_TYPE)strlen(password),
&aftp_rc);
if (aftp_rc != AFTP_RC_OK) {
fprintf(stderr, "Error setting AFTP password.\n");
}
}
None.