tcl-extensions

Check-in [900a6cd0d8]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:printf error!
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | tclssh
Files: files | file ages | folders
SHA1:900a6cd0d8d77de23a1c78d7d9e978a586cc374b
User & Date: aspect 2015-11-12 12:23:32
Context
2015-11-12
12:23
printf error! Leaf check-in: 900a6cd0d8 user: aspect tags: tclssh
12:17
keyfile, pubkeyfile as separate args check-in: f199fc11a7 user: aspect tags: tclssh
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclssh2.c.

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
...
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
#include <errno.h>
#include <stdio.h>
#include <ctype.h>

#include <tcl.h>


#define dprint(s,...) printf(s,##__VA_ARGS__)

static int SshSetOptionProc(ClientData instanceData, Tcl_Interp *interp, const char* optionName, const char* value);
static int SshGetOptionProc(ClientData instanceData, Tcl_Interp *interp, const char* optionName, Tcl_DString *dsPtr);
static int SshInputProc( ClientData clientData, char* buf, int bufSize, int* errorCodePtr);
static int SshOutputProc( ClientData clientData, const char* buf, int toWrite, int* errorCodePtr);
static int SshBlockModeProc( ClientData clientData, int mode);
static int SshClose2Proc( ClientData clientData, Tcl_Interp* interp, int flags);
................................................................................
    }

    /** attempt authentication */
    char *errMsg;
    int err;

    if (auth_methods & 4) {
dprint("Attempting key auth using %s, %s\n", keyfile);
        if ((err = libssh2_userauth_publickey_fromfile(state->session, username, pubkeyfile, keyfile, password))) {
            libssh2_session_last_error(state->session, &errMsg, NULL, 0);
            Tcl_AppendResult(interp, "Authentication by publickey failed", errMsg, NULL);
            return TCL_ERROR;
        }
    } else if (auth_methods & 2) {
dprint("Attempting interactive auth using %s\n", keyfile);







|







 







|







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
...
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
#include <errno.h>
#include <stdio.h>
#include <ctype.h>

#include <tcl.h>


#define dprint(s,...) printf(s,##__VA_ARGS__);fflush(stdout);

static int SshSetOptionProc(ClientData instanceData, Tcl_Interp *interp, const char* optionName, const char* value);
static int SshGetOptionProc(ClientData instanceData, Tcl_Interp *interp, const char* optionName, Tcl_DString *dsPtr);
static int SshInputProc( ClientData clientData, char* buf, int bufSize, int* errorCodePtr);
static int SshOutputProc( ClientData clientData, const char* buf, int toWrite, int* errorCodePtr);
static int SshBlockModeProc( ClientData clientData, int mode);
static int SshClose2Proc( ClientData clientData, Tcl_Interp* interp, int flags);
................................................................................
    }

    /** attempt authentication */
    char *errMsg;
    int err;

    if (auth_methods & 4) {
dprint("Attempting key auth using %s, %s\n", pubkeyfile, keyfile);
        if ((err = libssh2_userauth_publickey_fromfile(state->session, username, pubkeyfile, keyfile, password))) {
            libssh2_session_last_error(state->session, &errMsg, NULL, 0);
            Tcl_AppendResult(interp, "Authentication by publickey failed", errMsg, NULL);
            return TCL_ERROR;
        }
    } else if (auth_methods & 2) {
dprint("Attempting interactive auth using %s\n", keyfile);