![]() |
TrustCore SDK NanoSSH API reference
version 7.0
|
Functions | |
MOC_EXTERN sbyte4 | SSH_sftpSetHomeDirectory (sbyte4 connectionInstance, sbyte *pHomeDirectory) |
Define an SFTP client's default home directory. More... | |
MOC_EXTERN sbyte4 | SSH_sftpSetMemberOfGroups (sbyte4 connectionInstance, ubyte4 memberGroups) |
Set an individual SFTP user's permissions. More... | |
MOC_EXTERN sbyte4 SSH_sftpSetHomeDirectory | ( | sbyte4 | connectionInstance, |
sbyte * | pHomeDirectory | ||
) |
This function defines an SFTP client's default home directory. The function must be called during the SSH authentication phase.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_FTP_SERVER__
__ENABLE_MOCANA_SSH_SERVER__
connectionInstance | Connection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection(). |
pHomeDirectory | Pointer to string identifier for the user's home directory. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sftp.c
MOC_EXTERN sbyte4 SSH_sftpSetMemberOfGroups | ( | sbyte4 | connectionInstance, |
ubyte4 | memberGroups | ||
) |
This function sets an individual SFTP user's permissions, granting or restricting read, write, and delete access to files and directories. The function should be called from within a custom authentication upcall.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_FTP_SERVER__
__ENABLE_MOCANA_SSH_SERVER__
connectionInstance | Connection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection(). |
memberGroups | Sum of bitmasks specifying desired file and directory access. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.sftp.c