AgeCommit message (Collapse)AuthorFilesLines
2010-12-02Major shift: Fix execl*(), allow enabling/disabling pseudo withSEEBS_FORK_HACKPeter Seebach14-160/+343
an environment variable across fork(). This does a couple of things. One is, move the fork/vfork and execl* functions out of the standard wrapper environment. Having done that, the execl*() wrappers are rewritten so they can use real_execv*() when running in antimagic mode. This allows us to run pseudo entirely in antimagic mode. Which is handy, because we also add support for enabling/disabling antimagic mode in the child process on a fork, using an additional hook for this in the pseudo_client_init() routine. The redone fork() wrapper now calls pseudo_client_init() in the child process after a successful fork even if it's in antimagic mode already. This is not yet well-tested.
2010-12-02The pseudo_db.c file created tables (operations, etc.) in the logsPeter Seebach2-74/+3
database to preserve the meaning of log messages in old databases in case of renumbering... but these tables were never used, and the tables used to create them were, in fact, out of date and inconsistent with the range of operations now supported. Remove the vestigial remains of the never-implemented feature. Also, update .gitignore to stop git from complaining about some more generated files.
2010-12-02Major shift: All the id_t types have been reworked so that theyPeter Seebach17-366/+378
are generated from text files and templates, making it now (we hope) impossible for the list of strings to get out of sync with the enum.
2010-11-18Messing with makewrappers: Move templating code out (for planned usePeter Seebach4-103/+105
in an incoming "maketables".)
2010-11-17Add "Futures.txt" for notes about planned work.Peter Seebach2-0/+38
2010-11-17First pass of some cleanups -- support moving a tracked directory fromPeter Seebach5-48/+359
one device to another, for instance.
2010-10-25Clean up makewrappers a bit.Peter Seebach3-89/+139
2010-10-12Remove tabs from makewrappers.Peter Seebach2-221/+222
2010-10-12Was missing copyright in new makewrappers.Peter Seebach2-0/+19
2010-10-11Major change: Replace the shell-based makewrappers with a PythonPeter Seebach8-466/+600
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-10-11Add the other *xattr() wrappers (all ENOTSUP) for consistency.Peter Seebach15-15/+148
Note that this replaces an existing getxattr() wrapper which canonicalized pathnames for use in a chroot() environment. The need for that to work in some possible future may require us to revisit this.
2010-10-06Add the fsetxattr wrapper to return ENOTSUPMark Hatle3-0/+20
Current versions of gnu coreutils 'cp' were attempting to set permissions using fsetxattr. As a workaround, we need to return ENOTSUP so that it falls back to using fchmod, which pseudo does know how to wrap. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-09-16The exec*() functions were inconsistent about the name of their firstPeter Seebach7-13/+33
argument -- which turns out to be a problem, as this controls the canonicalization. The upshot is that some invocations of symlinks were corrupting $0.
2010-09-15In the WR Linux build system, we build host tools (including pseudo)Peter Seebach3-2/+21
in one place, but then often reuse them in other project directories. As a result, the --with-sqlite path is no longer the right path to use for RPATH later in the program's life. In the past, we were using chrpath to change the path to something more suitable, but this doesn't work if the new path is longer. Instead, allow an explicit --with-rpath setting which our build system can use. The logic is: * If you don't specify --with-sqlite or --with-rpath, you get no -Wl,-R * If you specify an empty path in --with-rpath, or --without-rpath, you get no -Wl,-R * If you specify --with-rpath with a non-empty path, you get -Wl,-R<path> * If you specify --with-sqlite, but not --with-rpath, you get -Wl,-R$(SQLITE)/lib
2010-09-08Fix mkfifoat() to not always failPeter Seebach2-1/+5
mknodat() uses a dev_t * argument, not a dev_t argument, so the 0 passed into wrap___xmknodat() by wrap_mkfifoat() is an invalid argument rather than an unused but valid zero. Change mkfifoat to create a dummy dev_t and pass its address.
2010-09-02Add -Wl,-R$(SQLITE)/lib so we can find libsqlite3 if it wasn'tPeter Seebach2-1/+3
in the default location.
2010-09-02Wait, the man page says we give ERANGE for that, not ENAMETOOLONG.Peter Seebach2-2/+5
... Also, make that error message a debugging message, since that's a normal and legitimate use case.
2010-09-01A couple more int/size_t mismatch fixes.Peter Seebach4-4/+9
2010-08-31Fix an error message which was mostly-harmless but still clearly aPeter Seebach2-1/+5
flaw in the code. Yes, Virginia, your printf arguments must match their format strings, and size_t is not the same thing as int.
2010-08-27We got bitten AGAIN by hard-coded lengths in memcmp, so we've swappedPeter Seebach3-6/+13
that for a macro that does it correctly. Why not just use strcmp, you ask? Because we aren't doing a string compare, we're looking for a prefix.
2010-08-26The logic for updating LD_LIBRARY_PATH had a bug; if you hadseebs2-15/+22
an LD_LIBRARY_PATH that included the pseudo library directory and some other directories, the other directories would get wiped out. Also a couple of whitespace rationalizatoins.
2010-08-26While looking at a possible 64/32-bit clash (there wasn't one afterseebs2-1/+6
all) noticed, that offsets.c was busted. Fixed.
2010-08-26Almost had it! The problem is that because the save ofseebs2-2/+5
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 blockedseebs6-2/+20
in processes started under pseudo.
2010-08-20Handle insane boundary condition for regcomp()/regexec()seebs2-4/+31
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 obviousseebs12-103/+273
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:seebs6-11/+53
Fixed a couple of allocation issues, corrected an off-by-one error in environment setup.
2010-08-16Fix ld_preload/ld_library_path mixupMark Hatle2-1/+4
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.seebs2-5/+6
2010-08-12Fix for libpseudo.so when using $(SUFFIX), correct a note in guts/README.seebs3-2/+10
2010-08-11Document new variables.Peter Seebach3-1/+32
2010-08-11Enable local variable cacheMark Hatle13-280/+455
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 Hatle1-0/+8
Add rules for 'pseudo', 'pseudodb', 'pseudolog' and 'libpseudo'.
2010-08-11Enable execl, execle, execlp, execv, and execvp wrappersMark Hatle10-7/+194
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 Hatle1-1/+1
2010-08-11Fix off by 4 error..Mark Hatle1-1/+1
We can potentially under allocate memory due.
2010-08-06Fix an exec program with an empty environmentMark Hatle2-1/+57
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 Hatle12-105/+270
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 Hatle2-6/+10
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 Hatle2-1/+4
Add a missing dependency from pseudo_wrapfuncs.h to wrappers. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2010-08-04Fix the MakefileMark Hatle1-19/+24
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 Scherer1-0/+7
2010-07-30Linking a file now does not unlink the contents of a fileKonrad Scherer2-20/+43
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 Scherer3-12/+80
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 Scherer1-0/+16
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 Scherer1-0/+9
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 Seebach2-12/+2
2010-06-29Fix suffix handling so the right thing happens when usingPeter Seebach3-31/+104
2010-06-28Remove PSEUDO_SUFFIX from sourcePeter Seebach4-5/+9
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 Seebach5-0/+64