[CalendarServer-changes] [15398] CalendarServer/trunk/support
source_changes at macosforge.org
source_changes at macosforge.org
Tue Dec 15 11:25:58 PST 2015
Revision: 15398
http://trac.calendarserver.org//changeset/15398
Author: sagen at apple.com
Date: 2015-12-15 11:25:57 -0800 (Tue, 15 Dec 2015)
Log Message:
-----------
Rather than exec Python, have the wrapper use Py_Main with an embedded interpreter; add back the app-group plist
Modified Paths:
--------------
CalendarServer/trunk/support/Apple.make
CalendarServer/trunk/support/python-wrapper.c
Added Paths:
-----------
CalendarServer/trunk/support/appgroup.plist
Modified: CalendarServer/trunk/support/Apple.make
===================================================================
--- CalendarServer/trunk/support/Apple.make 2015-12-15 18:19:54 UTC (rev 15397)
+++ CalendarServer/trunk/support/Apple.make 2015-12-15 19:25:57 UTC (rev 15398)
@@ -64,7 +64,7 @@
build-wrapper: $(BuildDirectory)/python-wrapper
$(BuildDirectory)/python-wrapper: $(Sources)/support/python-wrapper.c
- $(CC) $(Sources)/support/python-wrapper.c -o $(BuildDirectory)/python-wrapper
+ $(CC) -I /usr/include/python2.7 -l python2.7 -sectcreate __TEXT __info_plist $(Sources)/support/appgroup.plist $(Sources)/support/python-wrapper.c -o $(BuildDirectory)/python-wrapper
install:: install-python
install-python:: build
Added: CalendarServer/trunk/support/appgroup.plist
===================================================================
--- CalendarServer/trunk/support/appgroup.plist (rev 0)
+++ CalendarServer/trunk/support/appgroup.plist 2015-12-15 19:25:57 UTC (rev 15398)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Application-Group</key>
+ <array>
+ <string>com.apple.identity.export</string>
+ <string>com.apple.server</string>
+ </array>
+</dict>
+</plist>
+
Modified: CalendarServer/trunk/support/python-wrapper.c
===================================================================
--- CalendarServer/trunk/support/python-wrapper.c 2015-12-15 18:19:54 UTC (rev 15397)
+++ CalendarServer/trunk/support/python-wrapper.c 2015-12-15 19:25:57 UTC (rev 15398)
@@ -9,6 +9,7 @@
#include <string.h>
#include <unistd.h>
#include <pwd.h>
+#include <Python.h>
const char * const allowedUsernames[] = {
"_calendar",
@@ -80,9 +81,10 @@
prependToPath("PATH", bin);
prependToPath("PYTHONPATH", site);
- // Launch real python
- argv[0] = python;
- return execvp(python, (char* const*)argv);
+ Py_Initialize();
+ Py_Main(argc, (char **)argv);
+ Py_Finalize();
+ return 0;
} else {
printf("You are not allowed to run this executable.\n");
return 1;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20151215/7f2b48e4/attachment.html>
More information about the calendarserver-changes
mailing list