|
@@ -13,6 +13,7 @@
|
|
|
#include <syslog.h>
|
|
|
#include <poll.h>
|
|
|
#include <sys/wait.h>
|
|
|
+#include <ctype.h>
|
|
|
|
|
|
#include <faux/str.h>
|
|
|
#include <faux/conv.h>
|
|
@@ -338,6 +339,23 @@ static bool_t ktpd_session_process_auth(ktpd_session_t *ktpd, faux_msg_t *msg)
|
|
|
}
|
|
|
|
|
|
|
|
|
+static bool_t line_has_content(const char *line)
|
|
|
+{
|
|
|
+ const char *l = line;
|
|
|
+
|
|
|
+ if (faux_str_is_empty(line))
|
|
|
+ return BOOL_FALSE;
|
|
|
+
|
|
|
+ while (*l) {
|
|
|
+ if (!isspace(*l))
|
|
|
+ return BOOL_TRUE;
|
|
|
+ l++;
|
|
|
+ }
|
|
|
+
|
|
|
+ return BOOL_FALSE;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
static bool_t ktpd_session_process_cmd(ktpd_session_t *ktpd, faux_msg_t *msg)
|
|
|
{
|
|
|
char *line = NULL;
|
|
@@ -357,7 +375,8 @@ static bool_t ktpd_session_process_cmd(ktpd_session_t *ktpd, faux_msg_t *msg)
|
|
|
|
|
|
|
|
|
line = faux_msg_get_str_param_by_type(msg, KTP_PARAM_LINE);
|
|
|
- if (faux_str_is_empty(line)) {
|
|
|
+ if (!line_has_content(line)) {
|
|
|
+ faux_str_free(line);
|
|
|
|
|
|
|
|
|
ack = ktp_msg_preform(cmd, KTP_STATUS_NONE);
|