X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=command.c;h=9b279f7d5eb142f61a76fc0ae3d780da93400c5e;hb=36ba180901dd97003208ee6c51b0795cf351cb03;hp=f9bace34146e28ccaf7b0632e0fa34ede51de8aa;hpb=02dd632ab2a6696aff7b6c6d108069704cfe871a;p=paraslash.git diff --git a/command.c b/command.c index f9bace34..9b279f7d 100644 --- a/command.c +++ b/command.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1997-2012 Andre Noll + * Copyright (C) 1997-2013 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -259,6 +259,14 @@ __printf_3_4 int send_sb_va(struct stream_cipher_context *scc, int band, return send_sb(scc, msg, ret, band, false); } +/** + * Send an error message to a client. + * + * \param cc Client info. + * \param err The (positive) error code. + * + * \return The return value of the underlying call to send_sb_va(). + */ int send_strerror(struct command_context *cc, int err) { return cc->use_sideband? @@ -896,6 +904,11 @@ static int parse_auth_request(char *buf, int len, struct user **u, } } } + if (*use_sideband == false) { /* sideband is mandatory */ + PARA_ERROR_LOG("client did not request sideband\n"); + ret = -E_BAD_FEATURE; + goto out; + } PARA_DEBUG_LOG("received auth request for user %s (sideband = %s)\n", username, *use_sideband? "true" : "false"); *u = lookup_user(username); @@ -984,7 +997,7 @@ __noreturn void handle_connect(int fd, const char *peername) /* send Welcome message */ ret = write_va_buffer(fd, "This is para_server, version " PACKAGE_VERSION ".\n" - "Features: sideband,foo\n" + "Features: sideband\n" ); if (ret < 0) goto net_err;