Skip to content

[1.0] Various fixes to fopen mode handling in SFTP Stream - #713

Merged
bantu merged 4 commits into
phpseclib:1.0from
bantu:SFTPStreamTest
Jul 4, 2015
Merged

bantu merged 4 commits into
phpseclib:1.0from
bantu:SFTPStreamTest

Conversation

@bantu

@bantu bantu commented Jun 24, 2015

Copy link
Copy Markdown
Member

This reproduces owncloud/core#17027 (comment)

The following table was extracted from the description on http://php.net/manual/de/function.fopen.php

/*
* mode[0]  create  failOnExists  pos  truncate
*    r        n         n         l       n
*    w        y         n         l       y
*    a        y         n         r       n
*    x        y         y         l       y (implied by create and failOnExists)
*    c        y         n         l       n
*/

@bantu bantu changed the title Add SFTPStreamTest::testFopenFcloseCreatesFile() Various fixes to fopen mode handling SFTP Stream Jun 25, 2015
@bantu bantu changed the title Various fixes to fopen mode handling SFTP Stream Various fixes to fopen mode handling in SFTP Stream Jun 25, 2015
@bantu

bantu commented Jun 25, 2015

Copy link
Copy Markdown
Member Author

Added fixes to this PR and updated the description.

@terrafrost

Copy link
Copy Markdown
Member

Looks good to me!

bantu added a commit to bantu/phpseclib that referenced this pull request Jul 3, 2015
Various fixes to fopen mode handling in SFTP Stream

* bantu/SFTPStreamTest:
  Explicitly set size to 0 when creating or truncating.
  mode[0] of 'c' is not supposed to truncate.
  Need to create the file when it does not exist and mode[0] is not 'r'.
  Add SFTPStreamTest::testFopenFcloseCreatesFile()

Conflicts:
	tests/Functional/Net/SFTPLargeFileTest.php
@bantu bantu changed the title Various fixes to fopen mode handling in SFTP Stream [1.0] Various fixes to fopen mode handling in SFTP Stream Jul 3, 2015
bantu added a commit that referenced this pull request Jul 4, 2015
[1.0] Various fixes to fopen mode handling in SFTP Stream

* bantu/SFTPStreamTest:
  Explicitly set size to 0 when creating or truncating.
  mode[0] of 'c' is not supposed to truncate.
  Need to create the file when it does not exist and mode[0] is not 'r'.
  Add SFTPStreamTest::testFopenFcloseCreatesFile()
@bantu
bantu merged commit d71da6b into phpseclib:1.0 Jul 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants