Skip to content

sftp request does not complete with authentication failure in multi mode #357

Closed
@tstack

Description

@tstack

When executing an sftp request with the multi interface, it doesn't seem to complete if the request fails due to an authentication error. It seems easy enough to reproduce with the hiperfifo example. After starting hiperfifo, I send the url "sftp://s@localhost/var/l", which results in the following output:

Creating named pipe "hiper.fifo"
Now, pipe some URL's into > hiper.fifo
Adding easy 0x7fe5a9807800 to multi 0x7fe5a9405350 (sftp://s@localhost/var/l)
multi_timer_cb: Setting timeout to 1 ms

  • Trying 127.0.0.1...
    Progress: sftp://s@localhost/var/l (0/0)
    Progress: sftp://s@localhost/var/l (0/0)
    socket callback: s=7 e=0x7fe5a9807800 what=OUT Adding data: OUT
    multi_timer_cb: Setting timeout to 1 ms
    REMAINING: 1
  • Connected to localhost (127.0.0.1) port 22 (#0)
    Progress: sftp://s@localhost/var/l (0/0)
    Progress: sftp://s@localhost/var/l (0/0)
    socket callback: s=7 e=0x7fe5a9807800 what=IN Changing action from OUT to IN
    REMAINING: 1
    multi_timer_cb: Setting timeout to 1 ms
    REMAINING: 1
    Progress: sftp://s@localhost/var/l (0/0)
    multi_timer_cb: Setting timeout to 198 ms
    REMAINING: 1
    Progress: sftp://s@localhost/var/l (0/0)
    REMAINING: 1
    Progress: sftp://s@localhost/var/l (0/0)
    REMAINING: 1
    Progress: sftp://s@localhost/var/l (0/0)
    REMAINING: 1
  • SSH MD5 fingerprint: 89dcc2863281ded6467103a7a3d69ba1
    Progress: sftp://s@localhost/var/l (0/0)
    REMAINING: 1
  • SSH authentication methods available: publickey,keyboard-interactive
  • Using SSH public key file '(nil)'
  • Using SSH private key file '/Users/stack/.ssh/id_rsa'
    Progress: sftp://s@localhost/var/l (0/0)
    REMAINING: 1
  • SSH public key authentication failed: Username/PublicKey combination invalid
    Progress: sftp://s@localhost/var/l (0/0)
    socket callback: s=7 e=0x7fe5a9807800 what=REMOVE
    REMAINING: 1
  • No identity would match
    Progress: sftp://s@localhost/var/l (0/0)
    REMAINING: 1
    ^C

Note that the last message is "No identity would match", but the REMAINING count is still one. So, the request is still active. Compare this to the output of curl against the same url:

  • Trying 127.0.0.1...
  • Connected to localhost (127.0.0.1) port 22 (#0)
  • SSH MD5 fingerprint: 89dcc2863281ded6467103a7a3d69ba1
  • SSH host check: 0, key: AAAAB3NzaC1yc2EAAAABIwAAAQEAs19QFrigpKqUboN8oDhfhqIfZZoqB0Kk9fene3zqivp7bdYwRNV4y6BcEt5vEL42zw0Mo2goMn18luPxSEWg+e7VdBaRL/qrYK6PYevCzvKkqr83zorUq1zeOJNSY+dURCZbR6wIH32Ksf1iiok5EiUXTzdYDnyohGbk1QXGrAVrMqDfrAI0e3L1Y3O55ePHicz38cZtAdj9Zkl4rOn9Ok/4gbLQ4FUtQnqzEAbHNXlWgeDmM1URdc+b6i7F2wbaeHCkbsRLikjWIx5OH8MrAtplRwV6nNd2iXWE5CIOxUXPt8Tt084HeggIdQrkUePTRhtO0IZY35wdkOEZELEYrQ==
  • SSH authentication methods available: publickey,keyboard-interactive
  • Using SSH public key file '(nil)'
  • Using SSH private key file '/Users/stack/.ssh/id_rsa'
  • SSH public key authentication failed: Username/PublicKey combination invalid
  • No identity would match
  • Authentication failure
  • Closing connection 0
    curl: (67) Authentication failure

Note the "Authentication failure" message that shows up here, but not in multi mode. So, it seems like the final state transition is not happening. It also looks like the problem does not occur in all multi-mode interfaces, it might just be when using curl_multi_socket_action(). I tried to write a test program that used curl_multi_wait()/curl_multi_perform() and that seemed to work.

Activity

self-assigned this
on Jul 30, 2015
added a commit that references this issue on Oct 19, 2015
422076b
locked as resolved and limited conversation to collaborators on May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @tstack@bagder

      Issue actions

        sftp request does not complete with authentication failure in multi mode · Issue #357 · curl/curl