Improve ssh_get_issue_banner().

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@489 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
Andreas Schneider
2009-04-16 08:49:39 +00:00
parent 2bbb005980
commit c8269682fc

View File

@@ -568,16 +568,22 @@ int ssh_connect(SSH_SESSION *session) {
return 0; return 0;
} }
/** this is the banner showing a disclaimer to users who log in, /**
* typically their right or the fact that they will be monitored * @brief Get the issue banner from the server.
* \brief get the issue banner from the server *
* \param session ssh session * This is the banner showing a disclaimer to users who log in,
* \return NULL if there is no issue banner, else a string containing it. * typically their right or the fact that they will be monitored.
*
* @param session The SSH session to use.
*
* @return A newly allocated string with the banner, NULL on error.
*/ */
char *ssh_get_issue_banner(SSH_SESSION *session){ char *ssh_get_issue_banner(SSH_SESSION *session) {
if(!session->banner) if (session == NULL || session->banner == NULL) {
return NULL; return NULL;
return string_to_char(session->banner); }
return string_to_char(session->banner);
} }
/** \brief disconnect from a session (client or server) /** \brief disconnect from a session (client or server)