aboutsummaryrefslogtreecommitdiffstats
path: root/makewrappers
AgeCommit message (Collapse)Author
2012-02-06fix spaces/tabs in python againPeter Seebach
2012-02-06Fix *at() function interface holesPeter Seebach
1. Fix *at() where dirfd is obtained through dirfd(DIR *). The dirfd(DIR *) interface allows you to get the fd for a DIR *, meaning you can use it with openat(), meaning you can need its path. This causes a segfault. Also fixed the base_path code not to segfault in that case, but first fix the underlying problem. 2. Implement renameat() After three long years, someone tried to use this. This was impossibly hard back when pseudo was written, because there was only one dirfd provided for. Thing is, now, the canonicalization happens in wrapfuncs, so a small tweak to makewrappers to recognize that oldpath should use olddirfd if it exists is enough to get us fully canonicalized paths when needed.
2011-06-09Fix realpath(name, NULL) when PSEUDO_DISABLED=1Peter Seebach
On some Linux systems, dlsym("realpath", RTLD_NEXT) prefers for reasons of its own to give a symbol that is also known as old_realpath, which fails and yields EINVAL when called with a null pointer as the second argument. This can be avoided, on some systems, by using dlvsym() to request the GLIBC_2.3 version of the symbol. The wrapper logic is enhanced to allow for specifying versions, although this currently only works for Linux (Darwin has no dlvsym, apparently?). The test case is a trivial program which calls realpath(name, NULL) run with PSEUDO_DISABLED=1.
2011-04-04Whitespace changes.Peter Seebach
2011-03-25Merge in ports workPeter Seebach
This is a spiffied-up rebase of a bunch of intermediate changes, presented as a whole because it is, surprisingly, less confusing that way. The basic idea is to separate the guts code into categories ranging from generic stuff that can be the same everywhere and specific variants. The big scary one is the Darwin support, which actually seems to run okay on 64-bit OS X 10.6. (No other variants were tested.) The other example given is support for the old clone() syscall on RHEL 4, which affects some wrlinux use cases. There's a few minor cleanup bits here, such as a function with inconsistent calling conventions, but nothing really exciting.
2010-12-07This is a merge of several commits from a tree which turned out toPeter Seebach
be out of sync in a very inconvenient way. Changes include: * Some whitespace fixes, also move the pseudo_variables definition into pseudo_util.c since it's not used anywhere else. * Further improvements in the fork() support: We now recognize both positive and negative forms of PSEUDO_DISABLED, so we can distinguish between "it was removed from the environment by env -i" (restore the old value) and "it was intentionally turned off" (the new value wins). * clone(2) support. This is a little primitive, and programs might still fail horribly due to clone's semantics, but at least it's there and passes easy test cases. Plus a big patch from Mark Hatle: Cleanup fork/clone and PSEUDO_DISABLED guts/fork.c: * cleanup function and make it more robust * be sure to call pseudo_setupenv prior to pseudo_client_reset to match exec behavior pseudo_wrappers.c: * fix mismatched type in execl_to_v call via typecast * Simplify fork call via single call to wrap_fork() * be sure to save pseudo_disabled * be sure to call pseudo_setupenv prior to pseudo_client_reset to match exec behavior tests: * Add a test of whether pseudo can be disabled/enabled on a fork. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-11-18Messing with makewrappers: Move templating code out (for planned usePeter Seebach
in an incoming "maketables".)
2010-10-25Clean up makewrappers a bit.Peter Seebach
2010-10-12Remove tabs from makewrappers.Peter Seebach
2010-10-12Was missing copyright in new makewrappers.Peter Seebach
2010-10-11Major change: Replace the shell-based makewrappers with a PythonPeter Seebach
one. There's a long story here, but to abbreviate it: The shell script was annoying at best to maintain and starting to show signs of not really being the right tool for the job. For various reasons, we have some other Python stuff in our build system, so we picked Python as the language we were already using for other stuff. We think this works with anything reasonably recent (around Python 2.4 through 2.6). There's a little bit of cleanup, also, of the wrapper templates.
2010-08-26Almost had it! The problem is that because the save ofseebs
pseudo_saved_sigmask occurred outside of the check against antimagic, calls to wrapped functions made by the internals of a wrapper resulted on overwriting pseudo_saved_sigmask, so we restored the already-blocked sigmask. This could result in programs getting their sigmask permanently changed to block various signals, most crucially SIGCHLD. We now stash the value immediately before calling a wrapper, and never stash it if we're not calling a wrapper. Now the anti-magic stuff happening inside wrappers isn't trashing the signal mask. YAY!
2010-08-25Initial attempt at fixing problems with SIGCHLD being blockedseebs
in processes started under pseudo.
2010-08-11Enable execl, execle, execlp, execv, and execvp wrappersMark Hatle
We wrap all of the execs so that we can ensure the environment is properly configured prior to the exec running. handle ... for the new execl* wrappers Add a test for the new execl* ... handling.
2010-04-30Miscellaneous cleanup.Peter Seebach
Address a couple of compiler warnings, add a couple of signals to the list of caught signals, etcetera.
2010-04-26Avoid signalling during mutex operations.Peter Seebach
remake(1) can try to close a file from a signal handler. Since any entrance to a pseudo-emulated function requires the mutex, this can result in a deadlock. Solution: Suspend SIGCHLD (and a couple of other signals likely to result in filesystem operations) for the duration of the lock.
2010-04-26Reduce race condition for unlinks.Peter Seebach
If multiple clients are active at once, the following could occur: * Client #1 unlinks file A * Client #2 creates file B, which reuses A's inode * Client #2 sends request to server * Client #1 sends request to server * Processing client #2's request creates a mismatch warning for file A/B. * Processing client #1's request creates a mismatch warning too. Note that this can happen even if Client #2 sends its request later, as there's no intrinsic guarantee of the order in which requests are processed; any SINGLE client is presumably executing operations in order, but multiple clients aren't. Fixing this in rmdir, unlink, and rename.
2010-04-05Shuffle some code around.Peter Seebach
Migrate the stable part of the wrapper code (not machine-generated) out of makewrappers, to make it easier to maintain.
2010-03-30Fix copyright information.Peter Seebach
Corporate policy is that each module should have a copyright notice.
2010-03-29Add password/group call emulation.Peter Seebach
This is a first pass at handling password/group calls, allowing the use of custom password/group files. In particular, when chroot()ed to a particular directory, pseudo picks files in that directory by default, to improve support for the typical use case where pseudo uses chroot() only to jump into a virtual target filesystem.
2010-03-26Updates: Enable additional warnings, fix a number of things.Peter Seebach
None of them seem to have been genuine problems, but it's prettier now, and some were questionable.
2010-03-24Prep for chroot handling:Peter Seebach
* Improve makewrappers handling of function pointer arguments. * Regenerate wrappers when makewrappers is touched. * Move path resolution from pseudo_client_op into wrapper functions. * Eliminate dependency on PATH_MAX. * Related cleanup, such as tracking CWD better, and using the tracked value for getcwd().
2010-03-16initial public releasePeter Seebach