diff options
author | des <des@FreeBSD.org> | 2002-01-20 19:52:25 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-01-20 19:52:25 +0000 |
commit | 9f6167dc5a9010eb2cb906a6d661c6e76abb3c08 (patch) | |
tree | 03a49454524af79f7a0d2b6833858bb448d054d0 | |
parent | ca68430b0dbcdd956d954a39866c906a3aed1302 (diff) | |
download | FreeBSD-src-9f6167dc5a9010eb2cb906a6d661c6e76abb3c08.zip FreeBSD-src-9f6167dc5a9010eb2cb906a6d661c6e76abb3c08.tar.gz |
Mark uploads as O_WRONLY, not O_RDONLY.
PR: misc/34043
MFC after: 2 weeks
-rw-r--r-- | lib/libfetch/ftp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 64d37b2..36e95c3 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -911,7 +911,7 @@ FILE * _ftp_request(struct url *url, const char *op, struct url_stat *us, struct url *purl, const char *flags) { - int cd; + int cd, oflag; /* check if we should use HTTP instead */ if (purl && strcasecmp(purl->scheme, SCHEME_HTTP) == 0) { @@ -945,9 +945,13 @@ _ftp_request(struct url *url, const char *op, struct url_stat *us, /* just a stat */ if (strcmp(op, "STAT") == 0) return (FILE *)1; /* bogus return value */ + if (strcmp(op, "STOR") == 0 || strcmp(op, "APPE") == 0) + oflag = O_WRONLY; + else + oflag = O_RDONLY; /* initiate the transfer */ - return _ftp_transfer(cd, op, url->doc, O_RDONLY, url->offset, flags); + return _ftp_transfer(cd, op, url->doc, oflag, url->offset, flags); } /* |