mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
feat: add support for sftp extension "home-directory"
Signed-off-by: Debanga Sarma <deb737@proton.me> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Debanga Sarma
parent
4edd0669fd
commit
b500c2f0cf
@@ -1144,6 +1144,27 @@ LIBSSH_API int sftp_server_version(sftp_session sftp);
|
||||
*/
|
||||
LIBSSH_API char *sftp_expand_path(sftp_session sftp, const char *path);
|
||||
|
||||
/**
|
||||
* @brief Get the specified user's home directory
|
||||
*
|
||||
* This calls the "home-directory" extension. You should check if the extension
|
||||
* is supported using:
|
||||
*
|
||||
* @code
|
||||
* int supported = sftp_extension_supported(sftp, "home-directory", "1");
|
||||
* @endcode
|
||||
*
|
||||
* @param sftp The sftp session handle.
|
||||
*
|
||||
* @param username username of the user whose home directory is requested.
|
||||
*
|
||||
* @return On success, a newly allocated string containing the
|
||||
* absolute real-path of the home directory of the user.
|
||||
* NULL on error. The caller needs to free the memory
|
||||
* using ssh_string_free_char().
|
||||
*/
|
||||
LIBSSH_API char *sftp_home_directory(sftp_session sftp, const char *username);
|
||||
|
||||
#ifdef WITH_SERVER
|
||||
/**
|
||||
* @brief Create a new sftp server session.
|
||||
|
||||
Reference in New Issue
Block a user