Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Mar 30, 2011
  1. standardize static strings

    authored
    Since I never change the characters or reassign the pointers, they
    might as well all be static, const char arrays.
Commits on Mar 29, 2011
  1. test: const-ize (struct cmd).func

    authored
    cmd_func is also redefined as the function type itself instead of
    a pointer to a function; we can now use it to declare the functions.
  2. test: clean up struct cmd strings

    authored
    There is no good reason to have the strings be arrays. The compiler
    would probably warn if the strings got too big, but it might not
    warn if there the only thing that would fit was the trailing '\0'.
    
        char foo[8] = "abcdefgh";  /* might not be '\0' terminated */
  3. test: delete junk typedef

    authored
  4. test: internal functions should be static

    authored
    Nothing else uses the object file, but we might as well make our
    "private" functions static.
  5. Crank up and fix warnings

    authored
Commits on Mar 26, 2011
  1. LICENSE: Simplified BSD

    authored
  2. add usage/help

    authored
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.
Commits on Mar 18, 2011
  1. 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).
Commits on Mar 17, 2011
  1. Notes and code to test daemon(3) and pbpaste

    authored
    This is aimed at trying to come up with a working patch to get
    pasteboard access inside tmux.
    
    There are lots of combinations present in the code.
    
    I have just been commenting out what I did not want at the time.
    
    I need to test some of this still on 10.4 (at least daemon(3), since
    the other vproc stuff may not be available there).
Something went wrong with that request. Please try again.