Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

wrapper: provisional 10.7 "Lion" support

Update the wrapper code to not issue a warning about an "unsupported
new OS" when run on Lion.

This change is provisional because I have not tested it on a 10.7
machine. The evidence seems to indicate that the "10.6 method" will
also work on 10.7.

Specifically, The signature of _vprocmgr_move_subset_to_user matches
the one from 10.6 (see libvproc.c or vproc_priv.h in the launchd
source code).

    http://www.opensource.apple.com/release/mac-os-x-107/

Wikipedia's Darwin article says 10.7 is Darwin 11.0.0, so I assume
that is what uname reports for ustname.release.

    http://en.wikipedia.org/wiki/Darwin_(operating_system)
  • Loading branch information...
commit 8c5ea5fb417f8b5d3e717de8b0d4db86327e8519 1 parent 25a35a9
@ChrisJohnsen authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 reattach-to-user-namespace.c
View
11 reattach-to-user-namespace.c
@@ -41,7 +41,7 @@
#include "msg.h"
#if 0
-void * _vprocmgr_move_subset_to_user(uid_t target_user, const char *session_type, uint64_t flags); /* 10.6 */
+void * _vprocmgr_move_subset_to_user(uid_t target_user, const char *session_type, uint64_t flags); /* 10.6, 10.7 */
void * _vprocmgr_move_subset_to_user(uid_t target_user, const char *session_type); /* 10.5 */
#endif
@@ -82,14 +82,15 @@ int main(int argc, char *argv[]) {
if (os < 1050) {
warn("unsupported old OS, trying as if it were 10.5");
os = 1050;
- } else if (os > 1060) {
- warn("unsupported new OS, trying as if it were 10.6");
- os = 1060;
+ } else if (os > 1070) {
+ warn("unsupported new OS, trying as if it were 10.7");
+ os = 1070;
}
switch(os) {
case 1050:
case 1060:
+ case 1070:
{
static const char fn[] = "_vprocmgr_move_subset_to_user";
void *f;
@@ -109,7 +110,7 @@ int main(int argc, char *argv[]) {
void *(*func)(uid_t, const char *) = f;
r = func(getuid(), bg);
}
- else if (os == 1060) {
+ else if (os == 1060 || os == 1070) {
void *(*func)(uid_t, const char *, uint64_t) = f;
r = func(getuid(), bg, 0);
} else
Please sign in to comment.
Something went wrong with that request. Please try again.