[CalendarServer-changes] [2905] PyOpenDirectory/branches/users/cdaboo/nothread-2903
source_changes at macosforge.org
source_changes at macosforge.org
Thu Aug 28 19:43:07 PDT 2008
Revision: 2905
http://trac.macosforge.org/projects/calendarserver/changeset/2905
Author: cdaboo at apple.com
Date: 2008-08-28 19:43:07 -0700 (Thu, 28 Aug 2008)
Log Message:
-----------
Version that allows main apis to be called from C/C++ without any Python dependency.
Modified Paths:
--------------
PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryService.cpp
PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryService.h
PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryServiceException.cpp
PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/PyOpenDirectory.xcodeproj/cyrusdaboo.mode1v3
PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/PyOpenDirectory.xcodeproj/cyrusdaboo.pbxuser
PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/test.cpp
Modified: PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryService.cpp
===================================================================
--- PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryService.cpp 2008-08-29 02:38:47 UTC (rev 2904)
+++ PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryService.cpp 2008-08-29 02:43:07 UTC (rev 2905)
@@ -25,7 +25,7 @@
#include "CFStringUtil.h"
-#include <Python.h>
+#include <Python/Python.h>
#include <stdlib.h>
#include <string.h>
@@ -111,6 +111,26 @@
}
}
+CFMutableArrayRef CDirectoryService::ListAllRecordsWithAttributes_NoThread(const char* recordType, CFArrayRef attributes)
+{
+ try
+ {
+ // Get attribute map
+ return _ListAllRecordsWithAttributes(recordType, NULL, attributes);
+ }
+ catch(CDirectoryServiceException& dserror)
+ {
+ dserror.SetPythonException();
+ return NULL;
+ }
+ catch(...)
+ {
+ CDirectoryServiceException dserror;
+ dserror.SetPythonException();
+ return NULL;
+ }
+}
+
// QueryRecordsWithAttribute
//
// Get specific attributes for one or more user records with matching attribute/value in the directory.
Modified: PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryService.h
===================================================================
--- PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryService.h 2008-08-29 02:38:47 UTC (rev 2904)
+++ PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryService.h 2008-08-29 02:43:07 UTC (rev 2905)
@@ -23,7 +23,7 @@
#include <CoreFoundation/CoreFoundation.h>
#include <DirectoryService/DirectoryService.h>
-#include <Python.h>
+#include <Python/Python.h>
class CFStringUtil;
@@ -37,9 +37,11 @@
CFMutableArrayRef QueryRecordsWithAttribute(const char* attr, const char* value, int matchType, bool casei, const char* recordType, CFArrayRef attributes);
CFMutableArrayRef QueryRecordsWithAttributes(const char* query, bool casei, const char* recordType, CFArrayRef attributes);
+ CFMutableArrayRef ListAllRecordsWithAttributes_NoThread(const char* recordType, CFArrayRef attributes);
+
bool AuthenticateUserBasic(const char* nodename, const char* user, const char* pswd, bool& result);
bool AuthenticateUserDigest(const char* nodename, const char* user, const char* challenge, const char* response, const char* method, bool& result);
-
+
private:
class StPythonThreadState
Modified: PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryServiceException.cpp
===================================================================
--- PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryServiceException.cpp 2008-08-29 02:38:47 UTC (rev 2904)
+++ PyOpenDirectory/branches/users/cdaboo/nothread-2903/src/CDirectoryServiceException.cpp 2008-08-29 02:43:07 UTC (rev 2905)
@@ -21,7 +21,7 @@
#include "CDirectoryServiceException.h"
-#include <Python.h>
+#include <Python/Python.h>
#include <stdlib.h>
#include <string.h>
Modified: PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/PyOpenDirectory.xcodeproj/cyrusdaboo.mode1v3
===================================================================
--- PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/PyOpenDirectory.xcodeproj/cyrusdaboo.mode1v3 2008-08-29 02:38:47 UTC (rev 2904)
+++ PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/PyOpenDirectory.xcodeproj/cyrusdaboo.mode1v3 2008-08-29 02:43:07 UTC (rev 2905)
@@ -197,7 +197,48 @@
<key>Notifications</key>
<array/>
<key>OpenEditors</key>
- <array/>
+ <array>
+ <dict>
+ <key>Content</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>AFA1E77F0CC54B9E00BD15FE</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>CDirectoryService.h</string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>AFA1E7800CC54B9E00BD15FE</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>CDirectoryService.h</string>
+ <key>_historyCapacity</key>
+ <integer>0</integer>
+ <key>bookmark</key>
+ <string>AFA1E7830CC565DE00BD15FE</string>
+ <key>history</key>
+ <array>
+ <string>AFA1E7760CC54A5A00BD15FE</string>
+ </array>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <true/>
+ </dict>
+ <key>Geometry</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 20}, {811, 731}}</string>
+ <key>PBXModuleWindowStatusBarHidden2</key>
+ <false/>
+ <key>RubberWindowFrame</key>
+ <string>831 64 811 772 0 0 1920 1178 </string>
+ </dict>
+ </dict>
+ </array>
<key>PerspectiveWidths</key>
<array>
<integer>-1</integer>
@@ -380,9 +421,9 @@
</array>
<key>TableOfContents</key>
<array>
- <string>AF02ACB10CBE789100F478B8</string>
+ <string>AFA1E7430CC538D700BD15FE</string>
<string>1CE0B1FE06471DED0097A5F4</string>
- <string>AF02ACB20CBE789100F478B8</string>
+ <string>AFA1E7440CC538D700BD15FE</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
</array>
@@ -516,7 +557,14 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
+ <string>AFA1E7820CC54B9E00BD15FE</string>
+ <string>AFA1E7490CC538D700BD15FE</string>
+ <string>AFA1E74A0CC538D700BD15FE</string>
+ <string>AFA1E74B0CC538D700BD15FE</string>
+ <string>1C78EAAD065D492600B07095</string>
+ <string>1CD10A99069EF8BA00B06720</string>
<string>AF275A0D0CAC0FEA005A6274</string>
+ <string>AFA1E77F0CC54B9E00BD15FE</string>
<string>/Volumes/Data/Users/cyrusdaboo/Documents/Development/Apple/eclipse/PyOpenDirectory/support/PyOpenDirectory.xcodeproj</string>
</array>
<key>WindowString</key>
@@ -558,8 +606,6 @@
<string>453pt</string>
</dict>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
@@ -599,7 +645,7 @@
<key>TableOfContents</key>
<array>
<string>AF275A0D0CAC0FEA005A6274</string>
- <string>AF02AC5C0CBE6A8000F478B8</string>
+ <string>AFA1E72A0CC5375C00BD15FE</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
@@ -613,8 +659,12 @@
<false/>
</dict>
<dict>
+ <key>FirstTimeWindowDisplayed</key>
+ <false/>
<key>Identifier</key>
<string>windowTool.debugger</string>
+ <key>IsVertical</key>
+ <true/>
<key>Layout</key>
<array>
<dict>
@@ -637,8 +687,8 @@
<string>yes</string>
<key>sizes</key>
<array>
- <string>{{0, 0}, {317, 164}}</string>
- <string>{{317, 0}, {377, 164}}</string>
+ <string>{{0, 0}, {577, 425}}</string>
+ <string>{{577, 0}, {691, 425}}</string>
</array>
</dict>
<key>VerticalSplitView</key>
@@ -653,8 +703,8 @@
<string>yes</string>
<key>sizes</key>
<array>
- <string>{{0, 0}, {694, 164}}</string>
- <string>{{0, 164}, {694, 216}}</string>
+ <string>{{0, 0}, {1268, 425}}</string>
+ <string>{{0, 425}, {1268, 450}}</string>
</array>
</dict>
</dict>
@@ -667,8 +717,6 @@
</dict>
<key>GeometryConfiguration</key>
<dict>
- <key>DebugConsoleDrawerSize</key>
- <string>{100, 120}</string>
<key>DebugConsoleVisible</key>
<string>None</string>
<key>DebugConsoleWindowFrame</key>
@@ -676,18 +724,34 @@
<key>DebugSTDIOWindowFrame</key>
<string>{{200, 200}, {500, 300}}</string>
<key>Frame</key>
- <string>{{0, 0}, {694, 380}}</string>
+ <string>{{0, 0}, {1268, 875}}</string>
+ <key>PBXDebugSessionStackFrameViewKey</key>
+ <dict>
+ <key>DebugVariablesTableConfiguration</key>
+ <array>
+ <string>Name</string>
+ <real>120</real>
+ <string>Value</string>
+ <real>85</real>
+ <string>Summary</string>
+ <real>461</real>
+ </array>
+ <key>Frame</key>
+ <string>{{577, 0}, {691, 425}}</string>
+ <key>RubberWindowFrame</key>
+ <string>21 239 1268 916 0 0 1920 1178 </string>
+ </dict>
<key>RubberWindowFrame</key>
- <string>321 238 694 422 0 0 1440 878 </string>
+ <string>21 239 1268 916 0 0 1920 1178 </string>
</dict>
<key>Module</key>
<string>PBXDebugSessionModule</string>
<key>Proportion</key>
- <string>100%</string>
+ <string>875pt</string>
</dict>
</array>
<key>Proportion</key>
- <string>100%</string>
+ <string>875pt</string>
</dict>
</array>
<key>Name</key>
@@ -697,22 +761,26 @@
<string>PBXDebugSessionModule</string>
</array>
<key>StatusbarIsVisible</key>
- <integer>1</integer>
+ <true/>
<key>TableOfContents</key>
<array>
<string>1CD10A99069EF8BA00B06720</string>
- <string>1C0AD2AB069F1E9B00FABCE6</string>
+ <string>AFA1E72B0CC5375C00BD15FE</string>
<string>1C162984064C10D400B95A72</string>
- <string>1C0AD2AC069F1E9B00FABCE6</string>
+ <string>AFA1E72C0CC5375C00BD15FE</string>
+ <string>AFA1E72D0CC5375C00BD15FE</string>
+ <string>AFA1E72E0CC5375C00BD15FE</string>
+ <string>AFA1E72F0CC5375C00BD15FE</string>
+ <string>AFA1E7300CC5375C00BD15FE</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.debugV3</string>
<key>WindowString</key>
- <string>321 238 694 422 0 0 1440 878 </string>
+ <string>21 239 1268 916 0 0 1920 1178 </string>
<key>WindowToolGUID</key>
<string>1CD10A99069EF8BA00B06720</string>
<key>WindowToolIsVisible</key>
- <integer>0</integer>
+ <false/>
</dict>
<dict>
<key>Identifier</key>
@@ -818,8 +886,12 @@
<string>MENUSEPARATOR</string>
</dict>
<dict>
+ <key>FirstTimeWindowDisplayed</key>
+ <false/>
<key>Identifier</key>
<string>windowTool.debuggerConsole</string>
+ <key>IsVertical</key>
+ <true/>
<key>Layout</key>
<array>
<dict>
@@ -827,7 +899,7 @@
<array>
<dict>
<key>BecomeActive</key>
- <integer>1</integer>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
@@ -838,18 +910,18 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {650, 250}}</string>
+ <string>{{0, 0}, {965, 560}}</string>
<key>RubberWindowFrame</key>
- <string>516 632 650 250 0 0 1680 1027 </string>
+ <string>905 211 965 601 0 0 1920 1178 </string>
</dict>
<key>Module</key>
<string>PBXDebugCLIModule</string>
<key>Proportion</key>
- <string>209pt</string>
+ <string>560pt</string>
</dict>
</array>
<key>Proportion</key>
- <string>209pt</string>
+ <string>560pt</string>
</dict>
</array>
<key>Name</key>
@@ -859,21 +931,21 @@
<string>PBXDebugCLIModule</string>
</array>
<key>StatusbarIsVisible</key>
- <integer>1</integer>
+ <true/>
<key>TableOfContents</key>
<array>
<string>1C78EAAD065D492600B07095</string>
- <string>1C78EAAE065D492600B07095</string>
+ <string>AFA1E7310CC5375C00BD15FE</string>
<string>1C78EAAC065D492600B07095</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.consoleV3</string>
<key>WindowString</key>
- <string>650 41 650 250 0 0 1280 1002 </string>
+ <string>905 211 965 601 0 0 1920 1178 </string>
<key>WindowToolGUID</key>
<string>1C78EAAD065D492600B07095</string>
<key>WindowToolIsVisible</key>
- <integer>0</integer>
+ <false/>
</dict>
<dict>
<key>Identifier</key>
Modified: PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/PyOpenDirectory.xcodeproj/cyrusdaboo.pbxuser
===================================================================
--- PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/PyOpenDirectory.xcodeproj/cyrusdaboo.pbxuser 2008-08-29 02:38:47 UTC (rev 2904)
+++ PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/PyOpenDirectory.xcodeproj/cyrusdaboo.pbxuser 2008-08-29 02:43:07 UTC (rev 2905)
@@ -9,8 +9,9 @@
8DD76F620486A84900D96B5E /* PyOpenDirectory */,
);
breakpoints = (
- AF0015620B8A24240045DAEE /* test.cpp:84 */,
- AF0015650B8A245A0045DAEE /* test.cpp:167 */,
+ AF0015620B8A24240045DAEE /* test.cpp:86 */,
+ AF0015650B8A245A0045DAEE /* test.cpp:169 */,
+ AFA1E7510CC5394E00BD15FE /* test.cpp:86 */,
);
codeSenseManager = AF155A2E0A501F7B007E1E6E /* Code sense */;
executables = (
@@ -63,20 +64,24 @@
PBXFileDataSource_Target_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 213805048;
- PBXWorkspaceStateSaveDate = 213805048;
+ PBXPerProjectTemplateStateSaveDate = 214250502;
+ PBXWorkspaceStateSaveDate = 214250502;
};
+ perUserProjectItems = {
+ AFA1E7760CC54A5A00BD15FE /* PBXBookmark */ = AFA1E7760CC54A5A00BD15FE /* PBXBookmark */;
+ AFA1E7830CC565DE00BD15FE /* PBXTextBookmark */ = AFA1E7830CC565DE00BD15FE /* PBXTextBookmark */;
+ };
sourceControlManager = AF155A2D0A501F7B007E1E6E /* Source Control */;
userBuildSettings = {
};
};
08FB7796FE84155DC02AAC07 /* test.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {926, 4270}}";
- sepNavSelRange = "{1948, 96}";
- sepNavVisRange = "{1144, 1674}";
+ sepNavIntBoundsRect = "{{0, 0}, {1364, 4046}}";
+ sepNavSelRange = "{2878, 0}";
+ sepNavVisRange = "{5847, 1115}";
sepNavVisRect = "{{0, 1574}, {1521, 647}}";
- sepNavWindowFrame = "{{436, 4}, {811, 828}}";
+ sepNavWindowFrame = "{{328, 127}, {811, 828}}";
};
};
8DD76F620486A84900D96B5E /* PyOpenDirectory */ = {
@@ -85,7 +90,7 @@
AF155A290A501F5C007E1E6E /* PyOpenDirectory */,
);
};
- AF0015620B8A24240045DAEE /* test.cpp:84 */ = {
+ AF0015620B8A24240045DAEE /* test.cpp:86 */ = {
isa = PBXFileBreakpoint;
actions = (
);
@@ -97,11 +102,12 @@
functionName = "main (int argc, const char * argv[])";
hitCount = 0;
ignoreCount = 0;
- lineNumber = 84;
- modificationTime = 196354514.472522;
- state = 1;
+ lineNumber = 86;
+ location = PyOpenDirectory;
+ modificationTime = 214256498.98183;
+ state = 2;
};
- AF0015650B8A245A0045DAEE /* test.cpp:167 */ = {
+ AF0015650B8A245A0045DAEE /* test.cpp:169 */ = {
isa = PBXFileBreakpoint;
actions = (
);
@@ -113,24 +119,24 @@
functionName = "AuthenticateUser(CDirectoryService* dir, const char* user, const char* pswd)";
hitCount = 0;
ignoreCount = 0;
- lineNumber = 167;
+ lineNumber = 169;
location = test.ob;
- modificationTime = 196354382.775839;
+ modificationTime = 214256498.981853;
state = 2;
};
AF02AC560CBE690500F478B8 /* CDirectoryServiceException.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1086, 831}}";
- sepNavSelRange = "{1235, 12}";
- sepNavVisRange = "{0, 1607}";
+ sepNavIntBoundsRect = "{{0, 0}, {1086, 868}}";
+ sepNavSelRange = "{1017, 0}";
+ sepNavVisRange = "{75, 1660}";
sepNavWindowFrame = "{{684, 53}, {1145, 959}}";
};
};
AF02AC570CBE690500F478B8 /* CDirectoryServiceException.h */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1086, 831}}";
- sepNavSelRange = "{1019, 0}";
- sepNavVisRange = "{0, 1300}";
+ sepNavSelRange = "{846, 0}";
+ sepNavVisRange = "{0, 1331}";
sepNavWindowFrame = "{{73, 219}, {1145, 959}}";
};
};
@@ -191,29 +197,29 @@
};
AF155A2F0A501F84007E1E6E /* CDirectoryService.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1221, 16198}}";
- sepNavSelRange = "{1433, 0}";
- sepNavVisRange = "{1187, 1367}";
+ sepNavIntBoundsRect = "{{0, 0}, {1207, 15820}}";
+ sepNavSelRange = "{5982, 0}";
+ sepNavVisRange = "{5521, 781}";
sepNavVisRect = "{{0, 0}, {1309, 1017}}";
- sepNavWindowFrame = "{{85, 73}, {1280, 828}}";
+ sepNavWindowFrame = "{{224, 186}, {1280, 828}}";
};
};
AF155A300A501F84007E1E6E /* CDirectoryService.h */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1106, 1008}}";
- sepNavSelRange = "{1618, 0}";
- sepNavVisRange = "{714, 1839}";
+ sepNavIntBoundsRect = "{{0, 0}, {1106, 1260}}";
+ sepNavSelRange = "{881, 0}";
+ sepNavVisRange = "{4, 1750}";
sepNavVisRect = "{{0, 123}, {752, 676}}";
- sepNavWindowFrame = "{{308, 256}, {811, 828}}";
+ sepNavWindowFrame = "{{831, 8}, {811, 828}}";
};
};
AF155A310A501F84007E1E6E /* PythonWrapper.cpp */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {992, 10668}}";
- sepNavSelRange = "{23897, 0}";
- sepNavVisRange = "{22724, 1929}";
+ sepNavIntBoundsRect = "{{0, 0}, {984, 10514}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRange = "{0, 1604}";
sepNavVisRect = "{{0, 0}, {1521, 647}}";
- sepNavWindowFrame = "{{89, 4}, {1043, 828}}";
+ sepNavWindowFrame = "{{764, 120}, {1043, 828}}";
};
};
AF155AFB0A502C09007E1E6E /* CFStringUtil.h */ = {
@@ -237,7 +243,7 @@
AF41D9AB0CBDBAE200AB863D /* CDirectoryServiceManager.cpp */ = {
uiCtxt = {
sepNavIntBoundsRect = "{{0, 0}, {1221, 700}}";
- sepNavSelRange = "{1010, 0}";
+ sepNavSelRange = "{0, 0}";
sepNavVisRange = "{0, 1196}";
sepNavWindowFrame = "{{558, 246}, {1280, 828}}";
};
@@ -250,4 +256,35 @@
sepNavWindowFrame = "{{677, 13}, {1280, 828}}";
};
};
+ AFA1E7510CC5394E00BD15FE /* test.cpp:86 */ = {
+ isa = PBXFileBreakpoint;
+ actions = (
+ );
+ breakpointStyle = 0;
+ continueAfterActions = 0;
+ countType = 0;
+ delayBeforeContinue = 0;
+ fileReference = 08FB7796FE84155DC02AAC07 /* test.cpp */;
+ functionName = "main (int argc, const char * argv[])";
+ hitCount = 1;
+ ignoreCount = 0;
+ lineNumber = 86;
+ location = PyOpenDirectory;
+ modificationTime = 214256500.5471;
+ state = 1;
+ };
+ AFA1E7760CC54A5A00BD15FE /* PBXBookmark */ = {
+ isa = PBXBookmark;
+ fRef = AF155A300A501F84007E1E6E /* CDirectoryService.h */;
+ };
+ AFA1E7830CC565DE00BD15FE /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = AF155A300A501F84007E1E6E /* CDirectoryService.h */;
+ name = "CDirectoryService.h: 26";
+ rLen = 0;
+ rLoc = 881;
+ rType = 0;
+ vrLen = 1750;
+ vrLoc = 4;
+ };
}
Modified: PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/test.cpp
===================================================================
--- PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/test.cpp 2008-08-29 02:38:47 UTC (rev 2904)
+++ PyOpenDirectory/branches/users/cdaboo/nothread-2903/support/test.cpp 2008-08-29 02:43:07 UTC (rev 2905)
@@ -22,10 +22,13 @@
#include <CoreFoundation/CoreFoundation.h>
#include <DirectoryService/DirectoryService.h>
+#include <Python.h>
#include "CDirectoryService.h"
#include "CFStringUtil.h"
+PyMODINIT_FUNC initopendirectory(void);
+
tDirReference gDirRef = NULL;
char* CStringFromCFString(CFStringRef str);
@@ -43,8 +46,8 @@
CDirectoryService* dir = new CDirectoryService("/Search");
+#if 1
#if 0
-#if 0
CFStringRef strings[2];
strings[0] = CFSTR(kDS1AttrDistinguishedName);
strings[1] = CFSTR(kDS1AttrGeneratedUID);
@@ -80,9 +83,8 @@
}
CFRelease(array);
#endif
-
AuthenticateUser(dir, "gooeyed", "test", "test-no");
- AuthenticateUser(dir, "gooeyed", "test", "test-yes");
+ //AuthenticateUser(dir, "gooeyed", "test", "test-yes");
#elif 0
CFStringRef keys[2];
keys[0] = CFSTR(kDS1AttrFirstName);
@@ -129,7 +131,7 @@
}
CFRelease(array);
-#elif 1
+#elif 0
const char* compoundtest = "(&(|(dsAttrTypeStandard:RealName=U2*)(dsAttrTypeStandard:RealName=X S*))(dsAttrTypeStandard:ServicesLocator=D9A8E41B-C591-4D6B-A1CA-B57FFB8EF2F5:F967C034-54B8-4E65-9B38-7A6CD2600268:calendar))";
CFStringRef strings[2];
@@ -151,12 +153,12 @@
CFRelease(array);
#else
- const char* u = "test";
+ const char* u = "cdaboo";
//const char* c = "nonce=\"1\", qop=\"auth\", realm=\"Test\", algorithm=\"md5\", opaque=\"1\"";
//const char* r = "username=\"test\", nonce=\"1\", cnonce=\"1\", nc=\"1\", realm=\"Test\", algorithm=\"md5\", opaque=\"1\", qop=\"auth\", uri=\"/\", response=\"4241f31ffe6f9c99b891f88e9c41caa9\"";
- const char* c = "WWW-Authenticate: digest nonce=\"1621696297327727918745238639\", opaque=\"121994e78694cbdff74f12cb32ee6f00-MTYyMTY5NjI5NzMyNzcyNzkxODc0NTIzODYzOSwxMjcuMC4wLjEsMTE2ODU2ODg5NQ==\", realm=\"Test Realm\", algorithm=\"md5\", qop=\"auth\"";
- const char* r = "Authorization: Digest username=\"test\", realm=\"Test Realm\", nonce=\"1621696297327727918745238639\", uri=\"/principals/users/test/\", response=\"e260f13cffcc15572ddeec9c31de437b\", opaque=\"121994e78694cbdff74f12cb32ee6f00-MTYyMTY5NjI5NzMyNzcyNzkxODc0NTIzODYzOSwxMjcuMC4wLjEsMTE2ODU2ODg5NQ==\", algorithm=\"md5\", cnonce=\"70cbd8f04227d8d46c0193b290beaf0d\", nc=00000001, qop=\"auth\"";
- AuthenticateUserDigest(dir, u, c, r, "GET");
+ const char* c = "Digest realm=\"/Search\", nonce=\"54039924814543640301021652121\"";
+ const char* r = "Digest username=\"cdaboo\", realm=\"/Search\", nonce=\"54039924814543640301021652121\", uri=\"/principals/\", response=\"2706ccfadd0b8a15dae33d831e4e2a27\"";
+ AuthenticateUserDigest(dir, "1D8B3915-4CA4-487E-B3CC-4822D80DFC97", u, c, r, "GET");
#endif
return 0;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080828/dcaa43c4/attachment-0001.html
More information about the calendarserver-changes
mailing list