]> git.saurik.com Git - apple/security.git/commitdiff
Security-30.1.tar.gz mac-os-x-1013 mac-os-x-1014 mac-os-x-1015 v30.1
authorApple <opensource@apple.com>
Thu, 10 Jan 2002 22:57:07 +0000 (22:57 +0000)
committerApple <opensource@apple.com>
Thu, 10 Jan 2002 22:57:07 +0000 (22:57 +0000)
19 files changed:
AppleCSP/CVSVersionInfo.txt
AppleCSPDL/CVSVersionInfo.txt
AppleDL/CVSVersionInfo.txt
AppleX509CL/CVSVersionInfo.txt
AppleX509TP/CVSVersionInfo.txt
CVSVersionInfo.txt
Network/ftp-protocol.cpp
Network/ftp-protocol.h
Network/http-protocol.cpp
Network/transfer.cpp
SecureTransport/CVSVersionInfo.txt
SecurityASN1/CVSVersionInfo.txt
SecuritySNACCRuntime/CVSVersionInfo.txt
SecurityServer/Authorization/trampolineClient.cpp
SecurityServer/CVSVersionInfo.txt
cdsa/CVSVersionInfo.txt
cdsa/cdsa_utilities/bufferfifo.cpp
cdsa/cdsa_utilities/bufferfifo.h
cdsa/cdsa_utilities/streams.h

index 076788a3dfca8db8efad6949b3a3b0000e80af2f..63f759730a7bee8b9b292344dd068dc6c1154675 100644 (file)
@@ -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
index 52cd7d484fa7bd908d908a27ac3540c2c3e874d6..36e4beaef616c7714148e04dd026bd2005d651e4 100644 (file)
@@ -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
index 08547abacd5bbdcb6e4c867b840b8deb13d4ce30..ac5fcb263023be39627b2062968461f8cefe5a62 100644 (file)
@@ -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
index aa290af3c96d9ad17c1d6c6e7bd9f97a93067c87..1cf34734f83efc524de0de1ec29284aaeb22de27 100644 (file)
@@ -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
index 75e0c33473ffcae278a02af44be118d6d63c47cb..6053b5b99d0257ad833a99bbabb03e90a383403e 100644 (file)
@@ -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
index 4b0e0ddb04bb849a2a25c14af2b000a7099c99ce..fd712e667e60516446127f5693192b3f89181989 100644 (file)
@@ -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
index 9e2a87fc14b7c6a216cb48b054ecb2bffded191a..cef9777b2e83e40d985417aba693b08913f4b834 100644 (file)
 // Only stream mode is supported.
 // No EBCDIC support.
 //
+#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacErrors.h>
+
 #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<FTPConnection>().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:
index 287da2e4b57ce9c6ba25997d5e4dcd02e7f15064..151ec5b8e7686a670969256d5ac8820557577abf 100644 (file)
@@ -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:
index 53e7806d33fa5403f90a1742882973205be185a7..203c39dcdc94733f41861afb57c382628cfe7afb 100644 (file)
@@ -434,6 +434,7 @@ void HTTPProtocol::HTTPTransfer::start()
 
 void HTTPProtocol::HTTPTransfer::abort()
 {
+    observe(Observer::aborting);
     setError("aborted");
     connectionAs<HTTPConnection>().abort();
 }
index eeb6f7ca2f09090cb70a3e44520aef0e1ccebe9c..c74f91376da481fb4ab861edc32a43a66a8c946b 100644 (file)
@@ -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();
index 43df79bf2ec58e76667ce5c83df6a5f367218a6d..108546076ac4ddd3e5d525e2a4282263990b4eaa 100644 (file)
@@ -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
index 7ee7abb9830edf49797db33a0ffcc63c270c8c5e..8f550abab3dd394208afa8d17ac26781400aeb18 100644 (file)
@@ -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
index 3848046242212b8198e1e553743e1993b3454ea1..2533744789afdfe80ce40220128e324c6a8147e3 100644 (file)
@@ -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
index 73af87d62be12e737d205a0c0e99f1aff930b68e..456f94201568d146c827cac44ad84fc07b4f67c0 100644 (file)
@@ -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];
index 43fe21d64a9594403f6758780b1043f6f1f53ca1..1d7b32ddc31e1e27b3935f0a3112621b2388b0a2 100644 (file)
@@ -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
index 5057f9e2579ae74574d72e51c1c3cf44721ba5f8..71ae997cdfa4fa1da9a18ba64a0bd35104976fbf 100644 (file)
@@ -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
index d5818d9fd8e10fc0f4a0a1c99cf0e85c4a2b7104..0765261cfe598721b8bf3547087c695ba6a02794 100644 (file)
@@ -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();
index 170c163b18d960efb1a50cb421d8cb07d3942044..61764e5c42eb4bbf07bd957f6eee92d669ad74ad 100644 (file)
@@ -54,6 +54,7 @@ public:
     
     // Sink implementation
     void consume(const void *data, size_t size);
+    void clearBuffer();
 
 private:
     typedef queue< Buffer *, list<Buffer *> > BufferQueue;
index b1740b818ccf8d66d2011e2c57871baad79db725..2085deae1217713924a1c5fdf70e8101adeaee2f 100644 (file)
@@ -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
 };