Lines Matching refs:sshp
964 struct SSHPROTO *sshp) in sftp_quote() argument
990 char *tmp = aprintf("257 \"%s\" is current directory.\n", sshp->path); in sftp_quote()
1048 memset(&sshp->quote_attrs, 0, sizeof(LIBSSH2_SFTP_ATTRIBUTES)); in sftp_quote()
1111 struct SSHPROTO *sshp, in sftp_upload_init() argument
1126 int rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshp->path, in sftp_upload_init()
1127 curlx_uztoui(strlen(sshp->path)), in sftp_upload_init()
1158 libssh2_sftp_open_ex(sshc->sftp_session, sshp->path, in sftp_upload_init()
1159 curlx_uztoui(strlen(sshp->path)), in sftp_upload_init()
1191 (strlen(sshp->path) > 1))) { in sftp_upload_init()
1392 struct SSHPROTO *sshp, in sftp_quote_stat() argument
1416 &sshp->quote_attrs); in sftp_quote_stat()
1431 sshp->quote_attrs.gid = strtoul(sshc->quote_path1, NULL, 10); in sftp_quote_stat()
1432 sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_UIDGID; in sftp_quote_stat()
1433 if(sshp->quote_attrs.gid == 0 && !ISDIGIT(sshc->quote_path1[0]) && in sftp_quote_stat()
1440 sshp->quote_attrs.permissions = strtoul(sshc->quote_path1, NULL, 8); in sftp_quote_stat()
1441 sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_PERMISSIONS; in sftp_quote_stat()
1443 if(sshp->quote_attrs.permissions == 0 && in sftp_quote_stat()
1450 sshp->quote_attrs.uid = strtoul(sshc->quote_path1, NULL, 10); in sftp_quote_stat()
1451 sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_UIDGID; in sftp_quote_stat()
1452 if(sshp->quote_attrs.uid == 0 && !ISDIGIT(sshc->quote_path1[0]) && in sftp_quote_stat()
1477 sshp->quote_attrs.atime = (unsigned long)date; in sftp_quote_stat()
1479 sshp->quote_attrs.mtime = (unsigned long)date; in sftp_quote_stat()
1481 sshp->quote_attrs.flags = LIBSSH2_SFTP_ATTR_ACMODTIME; in sftp_quote_stat()
1496 struct SSHPROTO *sshp, in sftp_download_stat() argument
1500 int rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshp->path, in sftp_download_stat()
1501 curlx_uztoui(strlen(sshp->path)), in sftp_download_stat()
1626 struct SSHPROTO *sshp, in sftp_readdir() argument
1631 sshp->readdir_filename, CURL_PATH_MAX, in sftp_readdir()
1632 sshp->readdir_longentry, CURL_PATH_MAX, in sftp_readdir()
1633 &sshp->readdir_attrs); in sftp_readdir()
1640 sshp->readdir_filename[readdir_len] = '\0'; in sftp_readdir()
1644 sshp->readdir_filename, in sftp_readdir()
1653 result = Curl_dyn_add(&sshp->readdir, sshp->readdir_longentry); in sftp_readdir()
1656 if((sshp->readdir_attrs.flags & LIBSSH2_SFTP_ATTR_PERMISSIONS) && in sftp_readdir()
1657 ((sshp->readdir_attrs.permissions & LIBSSH2_SFTP_S_IFMT) == in sftp_readdir()
1659 Curl_dyn_init(&sshp->readdir_link, CURL_PATH_MAX); in sftp_readdir()
1660 result = Curl_dyn_addf(&sshp->readdir_link, "%s%s", sshp->path, in sftp_readdir()
1661 sshp->readdir_filename); in sftp_readdir()
1696 struct SSHPROTO *sshp = data->req.p.ssh; in ssh_statemachine() local
2053 sshp->readdir_filename, CURL_PATH_MAX); in ssh_statemachine()
2059 sshp->readdir_filename[rc] = '\0'; in ssh_statemachine()
2060 sshc->homedir = strdup(sshp->readdir_filename); in ssh_statemachine()
2094 result = Curl_getworkingpath(data, sshc->homedir, &sshp->path); in ssh_statemachine()
2124 result = sftp_quote(data, sshc, sshp); in ssh_statemachine()
2153 result = sftp_quote_stat(data, sshc, sshp, block); in ssh_statemachine()
2165 &sshp->quote_attrs); in ssh_statemachine()
2368 rc = libssh2_sftp_stat_ex(sshc->sftp_session, sshp->path, in ssh_statemachine()
2369 curlx_uztoui(strlen(sshp->path)), in ssh_statemachine()
2386 if(sshp->path[strlen(sshp->path)-1] == '/') in ssh_statemachine()
2394 result = sftp_upload_init(data, sshc, sshp, block); in ssh_statemachine()
2403 if(strlen(sshp->path) > 1) { in ssh_statemachine()
2404 sshc->slash_pos = sshp->path + 1; /* ignore the leading '/' */ in ssh_statemachine()
2417 infof(data, "Creating directory '%s'", sshp->path); in ssh_statemachine()
2426 rc = libssh2_sftp_mkdir_ex(sshc->sftp_session, sshp->path, in ssh_statemachine()
2427 curlx_uztoui(strlen(sshp->path)), in ssh_statemachine()
2466 libssh2_sftp_open_ex(sshc->sftp_session, sshp->path, in ssh_statemachine()
2467 curlx_uztoui(strlen(sshp->path)), in ssh_statemachine()
2484 Curl_dyn_init(&sshp->readdir, CURL_PATH_MAX * 2); in ssh_statemachine()
2489 result = sftp_readdir(data, sshc, sshp, block); in ssh_statemachine()
2499 Curl_dyn_ptr(&sshp->readdir_link), in ssh_statemachine()
2501 Curl_dyn_len(&sshp->readdir_link), in ssh_statemachine()
2502 sshp->readdir_filename, in ssh_statemachine()
2507 Curl_dyn_free(&sshp->readdir_link); in ssh_statemachine()
2510 result = Curl_dyn_addf(&sshp->readdir, " -> %s", sshp->readdir_filename); in ssh_statemachine()
2522 result = Curl_dyn_addn(&sshp->readdir, "\n", 1); in ssh_statemachine()
2525 Curl_dyn_ptr(&sshp->readdir), in ssh_statemachine()
2526 Curl_dyn_len(&sshp->readdir)); in ssh_statemachine()
2529 Curl_dyn_free(&sshp->readdir); in ssh_statemachine()
2533 Curl_dyn_reset(&sshp->readdir); in ssh_statemachine()
2556 libssh2_sftp_open_ex(sshc->sftp_session, sshp->path, in ssh_statemachine()
2557 curlx_uztoui(strlen(sshp->path)), in ssh_statemachine()
2579 result = sftp_download_stat(data, sshc, sshp, block); in ssh_statemachine()
2602 Curl_safefree(sshp->path); in ssh_statemachine()
2656 result = Curl_getworkingpath(data, sshc->homedir, &sshp->path); in ssh_statemachine()
2685 SCP_SEND(sshc->ssh_session, sshp->path, data->set.new_file_perms, in ssh_statemachine()
2753 sshp->path, &sb); in ssh_statemachine()
2758 sshp->path, &sb); in ssh_statemachine()
3471 struct SSHPROTO *sshp = data->req.p.ssh; in ssh_done() local
3480 Curl_safefree(sshp->path); in ssh_done()
3481 Curl_dyn_free(&sshp->readdir); in ssh_done()