aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2010-08-25Initial attempt at fixing problems with SIGCHLD being blockedseebs
in processes started under pseudo.
2010-08-20Handle insane boundary condition for regcomp()/regexec()seebs
For reasons that may never be known, the /usr/bin/find on RHEL5 contains its own local copies of regcomp() and regexec(). Thus, when pseudo makes calls to these functions, it gets the local copies in the binary instead of the ones in libc. But wait! That's not all. There's also the fascinating detail that, for reasons unknown, these local copies have an incompatible API, such that: regexec(pattern, list, 1, pmatch, 0); can write to more than one element of pmatch, and since that's a local array of one member, that means that they can crush something on the stack, such that a couple of function calls later you get a segfault in Nothing In Particular. So. We try to grab the real regcomp/regexec from libc, using dlsym, and if we can't, we fall back on whatever the defaults were. Inexplicably, this code actually made pseudo crash less often on at least one target. This is madness within madness, and I really have no idea why on earth /usr/bin/find, on a Linux system, would have its own local copies of regcomp/regexec, let alone why it would have copies that had substantially different semantics.
2010-08-17Draft one effort at making unlink more robust and fixing an obviousseebs
bug in the speculative-unlink operation. The intent is to mark and then confirm or cancel the delete. This removes the quirk where we tried to stash old database entries, which didn't handle directories anyway; "rmdir non-empty-directory" is a bit too common a case to dismiss as unthinkable.
2010-08-16A few minor fixes:seebs
Fixed a couple of allocation issues, corrected an off-by-one error in environment setup.
2010-08-16Fix ld_preload/ld_library_path mixupMark Hatle
Fix an obvious ld_preload/ld_library_path mixup in pseudo_util.c Signed-off-by: Richard Purdie <richard.purdie@intel.com> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-08-12Whoops, const really does mean read-only on some targets.seebs
2010-08-12Fix for libpseudo.so when using $(SUFFIX), correct a note in guts/README.seebs
2010-08-11Document new variables.Peter Seebach
2010-08-11Enable local variable cacheMark Hatle
Add local variable cache via get_value and set_value. The local cache is setup at constructor time (or soon after). Rewrite the pseudo_setupenv and pseudo_dropenv routines, add a new pseudo_setupenvp and pseudo_dropenvp as well to handle the execve cases. We can now successfully use /usr/bin/env -i env and get pseudo values back!
2010-08-11Add convenience rules for building individual pseudo components.Mark Hatle
Add rules for 'pseudo', 'pseudodb', 'pseudolog' and 'libpseudo'.
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-08-11Change the no pid to a debug message, instead of diagnostic.Mark Hatle
2010-08-11Fix off by 4 error..Mark Hatle
We can potentially under allocate memory due.
2010-08-06Fix an exec program with an empty environmentMark Hatle
If the environment has been cleared (in an execve for instance), we need to seed the environment with the PSEUDO_PREFIX, PSEUDO_BINDIR, PSEUDO_LIBDIR, and PSEUDO_LOCALSTATEDIR values.
2010-08-04Add new environment values to allow easy override of default locationsMark Hatle
Add PSEUDO_BINDIR, PSEUDO_LIBDIR, and PSEUDO_LOCALSTATEDIR to allow for more easy customization of PSEUDO components at run-time. If these are not set they will be automatically generated based on the existing PSEUDO_PREFIX path. PSEUDO_BINDIR = PSEUDO_PREFIX /bin PSEUDO_LIBDIR = PSEUDO_PREFIX /lib PSEUDO_LOCALSTATEDIR = PSEUDO_PREFIX /var/pseudo Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-08-04Allow CFLAGS to be set in the environment.Mark Hatle
CFLAGS is set by many autobuilder systems. In these environments we may need both the internal flags pseudo expects and the autobuilder flags. Adjust the Makefile accordingly. Based on code from Richard Purdie 2010-03-18 in Poky Linux. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-08-04Fix parallel buildsMark Hatle
Add a missing dependency from pseudo_wrapfuncs.h to wrappers. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-08-04Fix the MakefileMark Hatle
When generating binaries for the bin directory, they were not properly configured to generate the bin dir. Also sync up and generate the lib dir and localstatedir as well... Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-07-30Update the changelog.Konrad Scherer
2010-07-30Linking a file now does not unlink the contents of a fileKonrad Scherer
CQ: WIND00225366 When moving a directory, pseudo performs the following sequence: stat old, unlink new, link old and then rename. When linking a file, pseudo first makes sure the file does not already exist in the database and does an unlink. So the full sequence was stat old, unlink new, link old ( unlink old, unlink contents of old, relink old ), rename. The fix removes the unlinking of the contents of old.
2010-07-30Add basic test harness to test pseudoKonrad Scherer
CQ: WIND00225366 A simple test harness that runs all the scripts in the test directory. Each test script is run inside pseudo and uses exit status to report back whether the test was successful. The script uses the build executables, not the installed ones and each test run starts with an empty database.
2010-07-30Configure script now checks for sqlite3 version.Konrad Scherer
CQ: WIND000225366 Pseudo requires functionality in sqlite3 only available in version 3.6.x. The configure script now checks if sqlite headers are installed and checks that the version is at least 3.6.x.
2010-07-30Added .gitignore to clean up git statusKonrad Scherer
CQ: WIND00225366 The .gitignore file tells git to ignore all the temporary files that are created by the build.
2010-06-29Whoops, remove a couple of extra debugging messages.Peter Seebach
2010-06-29Fix suffix handling so the right thing happens when usingPeter Seebach
libpseudo-foo.so.
2010-06-28Remove PSEUDO_SUFFIX from sourcePeter Seebach
The PSEUDO_SUFFIX thing is an installation quirk to allow our build system to tag libpseudo.so with a checksum of the host libc. However, we reuse a prebuilt pseudo server with the new pseudo libraries; this means that encoding the suffix in the environment hackery is a Bad Idea. Update version number to 0.3, since this seems to wrap up a hunk of development effort.
2010-06-21Add mkstemp64(). Also, check in the man page for the NOSYMLINKEXPPeter Seebach
feature.
2010-06-02Provide a hook to disable symlink "fixing".Peter Seebach
In fakechroot, which pseudo tries to match the functionality of, the default behavior when creating a symlink with an absolute target is to prepend the chroot path, so that underlying syscalls will get the right file. It is necessary to be able to disable this behavior to create target filesystems in some cases. To that end, support a new environment variable, PSEUDO_NOSYMLINKEXP, which disables that behavior.
2010-05-17Add getxattr/lgetxattr. Note that we don't need to supportPeter Seebach
fgetxattr, since it doesn't use a path name.
2010-05-04Finish fixing execve()Peter Seebach
execve() needs to use -1 for both fd and dirfd; the 0 dirfd was causing various spurious warnings, as well as misidentifying "exec" as "execat" in client logs.
2010-04-30Improve PSEUDO_DEBUG_FILE.Peter Seebach
The PSEUDO_DEBUG_FILE feature is enhanced, and is now also used by the pseudo server.
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-30Cleanup of pdb_historyPeter Seebach
pdb_history was overloaded as a delete function. Separated this out into a query-builder and a pair of functions to use it, which makes it cleaner.
2010-04-27Document PSEUDO_DEBUG_FILE.Peter Seebach
2010-04-27Fix -P in pseudolog.Peter Seebach
2010-04-27Fix link(), improve startup performance.Peter Seebach
Stop vacuuming the logs database under normal usage -- it's expensive and slow, and not useful. Make link(2) "correctly" (following Linux, rather than POSIX) link to a symlink rather than to the file the symlink links to.
2010-04-26Handle execve() betterPeter Seebach
You can't use setenv() to modify the environment that will be passed to a child process through execve()... Also, fix the setupenv() to use PSEUDO_SUFFIX if defined. Use execve() to spawn child processes, so we can use setupenv() and dropenv().
2010-04-26Allow specification of debug output file.Peter Seebach
This includes allowing %s (program name) and %d (pid).
2010-04-26Remove obsolete symlink stuff from fxstatat.Peter Seebach
2010-04-26Don't report inode or path mismatches on OP_EXEC.Peter Seebach
We don't canonicalize OP_EXEC names (because they don't want to be adapted for the chroot environment -- maybe we should be doing that anyway, but right now we're not), so mismatches with them are meaningless. So are mismatches with the inode 0 reported for something that we never tried to stat.
2010-04-26Handle rename(3) across devices.Peter Seebach
When you rename across devices, inode can change. Until now, pseudo had no tools for handling a change in inode, but this is clearly a legitimate case.
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-26Report on deletions more carefully.Peter Seebach
2010-04-26Set flags explicitly for open*Peter Seebach
The *at() functions take a flags argument which, if set, says not to follow symlinks. By default, this is passed to pseudo_root_path. But the open() functions take a flags argument which is unrelated, and should not be used by default.
2010-04-26Add sanity checkPeter Seebach
It is possible for the database to get out of sync with the filesystem. Detecting this after the fact can be hard. Provide a hook for requesting a check. Also merge in some LD_LIBRARY_PATH fixes.
2010-04-26Strip trailing / from chroot directory name before sending it to the server.Peter Seebach
2010-04-26Updates/improvements for loggingPeter Seebach
Send program name (program_invocation_name from glibc) along with the tag. Along the way, restructure the fds/pids/tags arrays to be an array of client structures in pseudo_server, and add the message type to the set of things logged -- logging that a message was a ping is more useful than appending the text "ping" to it. Add support for type and program to pseudolog. Add deletion to pseudolog. Handle usage message formatting when there's an odd number of known specifiers for pseudolog. Conflicts: ChangeLog.txt pseudo_server.c
2010-04-26Miscellaneous fixes:Peter Seebach
* Add lckpwdf/ulckpwdf to guts/README * Remove arguments from function pointer arguments. While in theory the compar function pointer has always taken "const struct dirent **", some systems (many) have declared it instead as taking "const void *". For now, just omit the types; a pointer to function taking unknown arguments is a compatible type, and we never call the functions, we just pass them to something else. * Handle readlinkat() on systems without *at functions * Fix pseudo_etc_file (spotted by "fortify") When O_CREAT can be a flag, 0600 mode is needed. While we're at it, remove a bogus dummy open. * Fix mkdtemp() Was returning the address of the internal buffer rather than the user-provided buffer. Also fixed a typo in an error message. * Don't call fgetgrent_r() with a null FILE *. * A couple of other typo-type fixes.
2010-04-26Update documentation for chroot, passwd functionality.Peter Seebach