Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Jun 25, 2011
  1. @trevor

    resolve make error when llvm doesn't have powerpc

    trevor authored
    % make
    cc -Wall -Wextra -ansi -pendantic -arch i386 -arch ppc -arch x86_64 -mmacosx-version-min=10.5   -c -o test.o test.c
    llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin10-llvm-gcc-4.2': execvp: No such file or directory
    lipo: can't figure out the architecture type of: /var/folders/MT/MTdESo89GBCaGM7Hevp5+E+++TI/-Tmp-//ccG0JJrt.out
    make: *** [test.o] Error 255
Commits on Mar 29, 2011
  1. Crank up and fix warnings

    authored
Commits on Mar 26, 2011
  1. Makefile: universal compilation

    authored
    Set the minimum Mac OS X version to 10.5.
    
    It is possible to compile these programs on Mac OS X 10.4, however
    none of the useful private API functions are available there.
Commits on Mar 25, 2011
Commits on Mar 24, 2011
  1. test: runtime configurable actions

    authored
    Now we can test various combinations and orders of likely functions by changing the command-line parameters.
    
    Summary of following examples:
    
      To retain access to the per-user bootstrap namespace (tested by
      accessing the pasteboard with the pbpaste command), we always need
      to make a private API:
    
        Use the system daemon(3) and _vprocmgr_move_subset_to_user
    
          The system daemon(3) forces the forked process into the "root
          bootstrap namespace" where it can not access the per-user
          pasteboard service. We need to reattach to it to get access to
          the pasteboard.
    
        Use our own daemon() and _vprocmgr_detach_from_console
    
          Our own daemon() can prevent us from leaving the per-user
          bootstrap namespace, but we need to "detach" (move into the
          Background "bootstrap session") to make sure we retain access
          to the per-user bootstrap namespace after our initial session
          starter has exited (e.g. logging out of the GUI session, or
          logging out of an SSH session -- a non-"detached" process
          started as a child of either one will lose access to the
          per-user bootstrap namespace).
    
    Examples:
    
      pbpaste after system daemon(3)
      (i.e. minimal reproduction of stock tmux problem)
    
        ./test daemon=sys system=pbpaste
    
      Failure: pbpaste returns 1 -- it failed to access the pasteboard
    
      Reattaching to the per-user bootstrap namespace:
    
        ./test daemon=sys move-to-user=10.6 system=pbpaste
    
      Success: pbpaste returns 0, we see the pasteboard contents
    
      Using our own daemon():
    
        ./test daemon=ours system=pbpaste
    
      Success: pbpaste returns 0, we see the pasteboard contents.
    
      Using our own daemon() in an SSH connection that sticks around
      for a short while (long enough for pbpaste to run):
    
        cp /dev/null /tmp/f &&
        ssh localhost `pwd`/test \
          daemon=ours
          system=pbpaste 2\> /tmp/f \; sleep 1 &&
        { cat /tmp/f; tail -f /tmp/f; }
    
      Success: pbpaste returns 0, we see the pasteboard contents.
    
      Using our own daemon() in an SSH connection that exits before
      we run pbpaste:
    
        cp /dev/null /tmp/f &&
        ssh localhost `pwd`/test \
          daemon=ours \
          msg=sleeping... sleep=1 msg='done\ sleeping' \
          system=pbpaste 2\> /tmp/f &&
        { cat /tmp/f; tail -f /tmp/f; }
    
      Failure: pbpaste returns 1; When the SSH connection dies its
               children lose access to the per-user bootstrap namespace
               required to use the pasteboard.
    
      Using our own daemon() then "detaching from the console" in an SSH
      connection that exits before we run pbpaste:
    
      (Apple patched the "detach from console" into screen for Mac OS X v10.6;
       screen does not use daemon(), but using our own daemon that does
       not pull us into the root bootstrap namespace is, for our
       purposes, nearly equivalent to not using the system version.)
    
        cp /dev/null /tmp/f &&
        ssh localhost `pwd`/test \
          daemon=ours \
          detach \
          msg=sleeping... sleep=1 msg='done\ sleeping' \
          system=pbpaste 2\> /tmp/f &&
        { cat /tmp/f; tail -f /tmp/f; }
    
      Success: pbpaste return 0, we see the pasteboard contents.
    
      Using the system daemon(3), then reattaching to the per-user
      bootstrap namespace:
    
        cp /dev/null /tmp/f &&
        ssh localhost `pwd`/test \
          daemon=sys \
          move-to-user=10.6 \
          msg=sleeping... sleep=1 msg='done\ sleeping' \
          system=pbpaste 2\> /tmp/f &&
        { cat /tmp/f; tail -f /tmp/f; }
    
      Success: pbpaste return 0, we see the pasteboard contents.
  2. wrapper: extract die, etc. into msg.c

    authored
    These functions will be reused shortly in the test program.
    
    Replace the hacky die_errno macro with a proper function.
Commits on Mar 18, 2011
  1. wrapper: join user namespace, exec program

    authored
    Something like this is an alternative to patching tmux.
    
    Users can use it to run individial program reattached to the
    user namespace where the resulting processes can use the
    pasteboard.
  2. SessionCreate from Security framework

    authored
    None of the variations of the attribute bits from AuthSession.h
    seemed to have any useful impact. Some of them did seem to
    create a new session (using "launchctl bslist" instead of "bpaste"
    showed it, I think).
Something went wrong with that request. Please try again.