From c25717e3bfe9397829b8aac32a966f746fc3c4f5 Mon Sep 17 00:00:00 2001 From: Apple Date: Thu, 10 Jan 2002 22:57:07 +0000 Subject: [PATCH] Security-30.1.tar.gz --- AppleCSP/CVSVersionInfo.txt | 2 +- AppleCSPDL/CVSVersionInfo.txt | 2 +- AppleDL/CVSVersionInfo.txt | 2 +- AppleX509CL/CVSVersionInfo.txt | 2 +- AppleX509TP/CVSVersionInfo.txt | 2 +- CVSVersionInfo.txt | 6 +++--- Network/ftp-protocol.cpp | 16 +++++++++++++--- Network/ftp-protocol.h | 9 +++++---- Network/http-protocol.cpp | 1 + Network/transfer.cpp | 1 + SecureTransport/CVSVersionInfo.txt | 2 +- SecurityASN1/CVSVersionInfo.txt | 2 +- SecuritySNACCRuntime/CVSVersionInfo.txt | 2 +- .../Authorization/trampolineClient.cpp | 1 + SecurityServer/CVSVersionInfo.txt | 2 +- cdsa/CVSVersionInfo.txt | 2 +- cdsa/cdsa_utilities/bufferfifo.cpp | 10 ++++++++++ cdsa/cdsa_utilities/bufferfifo.h | 1 + cdsa/cdsa_utilities/streams.h | 9 +++++++-- 19 files changed, 52 insertions(+), 22 deletions(-) diff --git a/AppleCSP/CVSVersionInfo.txt b/AppleCSP/CVSVersionInfo.txt index 076788a3..63f75973 100644 --- a/AppleCSP/CVSVersionInfo.txt +++ b/AppleCSP/CVSVersionInfo.txt @@ -1,5 +1,5 @@ # Created and modified by checkpoint; do not edit # $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:47 mb Exp $ -# $Name: Security-29 $ +# $Name: Security-30~1 $ ProjectName: AppleCSP ProjectVersion: 16 diff --git a/AppleCSPDL/CVSVersionInfo.txt b/AppleCSPDL/CVSVersionInfo.txt index 52cd7d48..36e4beae 100644 --- a/AppleCSPDL/CVSVersionInfo.txt +++ b/AppleCSPDL/CVSVersionInfo.txt @@ -1,5 +1,5 @@ # Created and modified by checkpoint; do not edit # $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:51 mb Exp $ -# $Name: Security-29 $ +# $Name: Security-30~1 $ ProjectName: AppleCSPDL ProjectVersion: 15 diff --git a/AppleDL/CVSVersionInfo.txt b/AppleDL/CVSVersionInfo.txt index 08547aba..ac5fcb26 100644 --- a/AppleDL/CVSVersionInfo.txt +++ b/AppleDL/CVSVersionInfo.txt @@ -1,5 +1,5 @@ # Created and modified by checkpoint; do not edit # $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:52 mb Exp $ -# $Name: Security-29 $ +# $Name: Security-30~1 $ ProjectName: AppleDL ProjectVersion: 13 diff --git a/AppleX509CL/CVSVersionInfo.txt b/AppleX509CL/CVSVersionInfo.txt index aa290af3..1cf34734 100644 --- a/AppleX509CL/CVSVersionInfo.txt +++ b/AppleX509CL/CVSVersionInfo.txt @@ -1,5 +1,5 @@ # Created and modified by checkpoint; do not edit # $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:52 mb Exp $ -# $Name: Security-29 $ +# $Name: Security-30~1 $ ProjectName: AppleX509CL ProjectVersion: 3 diff --git a/AppleX509TP/CVSVersionInfo.txt b/AppleX509TP/CVSVersionInfo.txt index 75e0c334..6053b5b9 100644 --- a/AppleX509TP/CVSVersionInfo.txt +++ b/AppleX509TP/CVSVersionInfo.txt @@ -1,5 +1,5 @@ # Created and modified by checkpoint; do not edit # $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:53 mb Exp $ -# $Name: Security-29 $ +# $Name: Security-30~1 $ ProjectName: AppleX509TP ProjectVersion: 3 diff --git a/CVSVersionInfo.txt b/CVSVersionInfo.txt index 4b0e0ddb..fd712e66 100644 --- a/CVSVersionInfo.txt +++ b/CVSVersionInfo.txt @@ -1,5 +1,5 @@ # Created and modified by checkpoint; do not edit -# $Id: CVSVersionInfo.txt,v 1.23 2001/10/16 02:20:35 mb Exp $ -# $Name: Security-29 $ +# $Id: CVSVersionInfo.txt,v 1.22.4.2 2002/01/10 22:57:07 perry Exp $ +# $Name: Security-30~1 $ ProjectName: Security -ProjectVersion: 29 +ProjectVersion: 30~1 diff --git a/Network/ftp-protocol.cpp b/Network/ftp-protocol.cpp index 9e2a87fc..cef9777b 100644 --- a/Network/ftp-protocol.cpp +++ b/Network/ftp-protocol.cpp @@ -40,10 +40,11 @@ // Only stream mode is supported. // No EBCDIC support. // +#include + #include "ftp-protocol.h" #include "netparameters.h" - namespace Security { namespace Network { @@ -104,6 +105,10 @@ void FTPProtocol::FTPConnection::startCommand() printfe("RMD %s", mOperationPath.c_str()); state = directCommandSent; return; + case removeFile: + printfe("DELE %s", mOperationPath.c_str()); + state = directCommandSent; + return; case genericCommand: printfe("%s", mOperationPath.c_str()); state = directCommandSent; @@ -361,7 +366,9 @@ void FTPProtocol::FTPConnection::transit(Event event, char *input, size_t length mDataPath.connectionDone(); break; case 452: - fail(input, ENOSPC); + mDataPath.close(); + state = idle; + fail(input, dskFulErr); break; default: // transfer failed // (ignore any error in mDataPath - prefer diagnostics from remote) @@ -509,6 +516,7 @@ void FTPProtocol::FTPTransfer::start() void FTPProtocol::FTPTransfer::abort() { + observe(Observer::aborting); setError("aborted"); connectionAs().abort(); } @@ -529,7 +537,9 @@ Transfer::ResultClass FTPProtocol::FTPTransfer::resultClass() const InetReply reply(errorDescription().c_str()); if (reply / 10 == 53) // 53x - authentication failure return authorizationFailure; - // when in doubt, blame the remote + if (errorDescription() == "aborted") + return abortedFailure; + // when in doubt, blame the remote return remoteFailure; } case finished: diff --git a/Network/ftp-protocol.h b/Network/ftp-protocol.h index 287da2e4..151ec5b8 100644 --- a/Network/ftp-protocol.h +++ b/Network/ftp-protocol.h @@ -53,10 +53,11 @@ public: // FTP-specific operation codes enum { downloadDirectory = protocolSpecific, // get filename list (NLST) - downloadListing, // get host-specific listing (LIST) - makeDirectory, // make a directory (MKD) - removeDirectory, // remove a directory (RMD) - genericCommand // issue generic FTP command + downloadListing, // get host-specific listing (LIST) + makeDirectory, // make a directory (MKD) + removeDirectory, // remove a directory (RMD) + removeFile, // remove a file (DELE) + genericCommand // issue generic FTP command }; private: diff --git a/Network/http-protocol.cpp b/Network/http-protocol.cpp index 53e7806d..203c39dc 100644 --- a/Network/http-protocol.cpp +++ b/Network/http-protocol.cpp @@ -434,6 +434,7 @@ void HTTPProtocol::HTTPTransfer::start() void HTTPProtocol::HTTPTransfer::abort() { + observe(Observer::aborting); setError("aborted"); connectionAs().abort(); } diff --git a/Network/transfer.cpp b/Network/transfer.cpp index eeb6f7ca..c74f9137 100644 --- a/Network/transfer.cpp +++ b/Network/transfer.cpp @@ -138,6 +138,7 @@ void Transfer::fail() // void Transfer::abort() { + observe(Observer::aborting); if (isDocked()) mConnection->retain(false); // indeterminate state; don't keep it fail(); diff --git a/SecureTransport/CVSVersionInfo.txt b/SecureTransport/CVSVersionInfo.txt index 43df79bf..10854607 100644 --- a/SecureTransport/CVSVersionInfo.txt +++ b/SecureTransport/CVSVersionInfo.txt @@ -1,5 +1,5 @@ # Created and modified by checkpoint; do not edit # $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:58 mb Exp $ -# $Name: Security-29 $ +# $Name: Security-30~1 $ ProjectName: SecureTransport ProjectVersion: 3 diff --git a/SecurityASN1/CVSVersionInfo.txt b/SecurityASN1/CVSVersionInfo.txt index 7ee7abb9..8f550aba 100644 --- a/SecurityASN1/CVSVersionInfo.txt +++ b/SecurityASN1/CVSVersionInfo.txt @@ -1,5 +1,5 @@ # Created and modified by checkpoint; do not edit # $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:59 mb Exp $ -# $Name: Security-29 $ +# $Name: Security-30~1 $ ProjectName: SecurityASN1 ProjectVersion: 6 diff --git a/SecuritySNACCRuntime/CVSVersionInfo.txt b/SecuritySNACCRuntime/CVSVersionInfo.txt index 38480462..25337447 100644 --- a/SecuritySNACCRuntime/CVSVersionInfo.txt +++ b/SecuritySNACCRuntime/CVSVersionInfo.txt @@ -1,5 +1,5 @@ # Created and modified by checkpoint; do not edit # $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:14:04 mb Exp $ -# $Name: Security-29 $ +# $Name: Security-30~1 $ ProjectName: SecuritySNACCRuntime ProjectVersion: 6.1 diff --git a/SecurityServer/Authorization/trampolineClient.cpp b/SecurityServer/Authorization/trampolineClient.cpp index 73af87d6..456f9420 100644 --- a/SecurityServer/Authorization/trampolineClient.cpp +++ b/SecurityServer/Authorization/trampolineClient.cpp @@ -79,6 +79,7 @@ OSStatus AuthorizationExecuteWithPrivileges(AuthorizationRef authorization, fclose(mbox); return errAuthorizationInternal; } + fflush(mbox); // make text representation of the temp-file descriptor char mboxFdText[20]; diff --git a/SecurityServer/CVSVersionInfo.txt b/SecurityServer/CVSVersionInfo.txt index 43fe21d6..1d7b32dd 100644 --- a/SecurityServer/CVSVersionInfo.txt +++ b/SecurityServer/CVSVersionInfo.txt @@ -1,5 +1,5 @@ # Created and modified by checkpoint; do not edit # $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:14:00 mb Exp $ -# $Name: Security-29 $ +# $Name: Security-30~1 $ ProjectName: SecurityServer ProjectVersion: 17.1 diff --git a/cdsa/CVSVersionInfo.txt b/cdsa/CVSVersionInfo.txt index 5057f9e2..71ae997c 100644 --- a/cdsa/CVSVersionInfo.txt +++ b/cdsa/CVSVersionInfo.txt @@ -1,5 +1,5 @@ # Created and modified by checkpoint; do not edit # $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:53 mb Exp $ -# $Name: Security-29 $ +# $Name: Security-30~1 $ ProjectName: cdsa ProjectVersion: 21 diff --git a/cdsa/cdsa_utilities/bufferfifo.cpp b/cdsa/cdsa_utilities/bufferfifo.cpp index d5818d9f..0765261c 100644 --- a/cdsa/cdsa_utilities/bufferfifo.cpp +++ b/cdsa/cdsa_utilities/bufferfifo.cpp @@ -37,6 +37,14 @@ BufferFifo::~BufferFifo() } } +void BufferFifo::clearBuffer() +{ + while (!mBuffers.empty()) { + delete mBuffers.front(); + mBuffers.pop(); + } + mSize = 0; +} // // This is the put function of a Sink. We store the data in at most two buffers: @@ -45,6 +53,8 @@ BufferFifo::~BufferFifo() // void BufferFifo::consume(const void *data, size_t size) { + mSize += size; + // step 1: fill the rearmost (partially filled) buffer if (size > 0 && !mBuffers.empty()) { Buffer *current = mBuffers.back(); diff --git a/cdsa/cdsa_utilities/bufferfifo.h b/cdsa/cdsa_utilities/bufferfifo.h index 170c163b..61764e5c 100644 --- a/cdsa/cdsa_utilities/bufferfifo.h +++ b/cdsa/cdsa_utilities/bufferfifo.h @@ -54,6 +54,7 @@ public: // Sink implementation void consume(const void *data, size_t size); + void clearBuffer(); private: typedef queue< Buffer *, list > BufferQueue; diff --git a/cdsa/cdsa_utilities/streams.h b/cdsa/cdsa_utilities/streams.h index b1740b81..2085deae 100644 --- a/cdsa/cdsa_utilities/streams.h +++ b/cdsa/cdsa_utilities/streams.h @@ -74,9 +74,15 @@ protected: // class Sink { public: + Sink() : mSize(0) {} virtual ~Sink() { } virtual void consume(const void *data, size_t length) = 0; virtual void setSize(size_t expectedSize); + size_t getSize() {return mSize;} + +protected: + size_t mSize; + }; @@ -154,7 +160,7 @@ public: // class MemorySink : public Sink { public: - MemorySink() : mBuffer(NULL), mSize(0), mMax(0) { } + MemorySink() : mBuffer(NULL), mMax(0) { } ~MemorySink() { free(mBuffer); } void consume(const void *data, size_t length); @@ -170,7 +176,6 @@ private: private: void *mBuffer; // buffer base - size_t mSize; // currently used size_t mMax; // currently allocated }; -- 2.45.2