400 Commits

Author SHA1 Message Date
Wolfgang Hommel
4c2ff5e559 Merge pull request #11 from dfong/master
bug in reading faketimerc
2012-11-28 10:11:52 -08:00
don fong
cd267e8dd5 whitespace fix
replace tabs with spaces to match surrounding code
2012-11-27 14:01:12 -08:00
don fong
bd1de99d3a bug in reading faketimerc
if the faketimerc file begins with an empty line, then the inner
loop that trims trailing eol chars could possibly step backward
past the beginning of the buffer (line).  if the byte just
preceding line also happened to contain a '\n' or '\r',
it could be clobbered.
2012-11-27 13:38:48 -08:00
Wolfgang Hommel
471e2a5620 Fixed 2012-11-24 19:40:10 +01:00
Wolfgang Hommel
037552cfed fixed a bug reported by goofansu 2012-11-23 21:03:39 +01:00
Wolfgang Hommel
dab8698a03 Merge pull request #8 from domo141/d3ff79a
Implementation of implicit '-f'
2012-09-10 22:24:07 -07:00
Tomi Ollila
d3ff79a0aa src/faketime: implicit '-f' for $offset that is faketime-known relative
When $offset arg looks like the relative value described in README
section "4d) Using offsets for relative dates", set USEDIRECT variable
even when '-f' option is not present. Without the '-f' the $offset would
be useless so this is convenience feature for the user. Using '-f' in
command line to explicitly set USEDIRECT is retained.
2012-09-09 20:36:37 +03:00
Wolfgang Hommel
532f0dc65d Merge pull request #7 from domo141/topic-wsc1
whitespace cleanup
2012-08-30 09:48:22 -07:00
Tomi Ollila
b648b7712d whitespace cleanup
Used (emacs) M-x untabify for whole faketime.c as the prevailing
style in that file used spaces for indentation.

Used M-x delete-trailing-whitespace to all files that had either
trailing whitespace or empty lines at the end of file to remove
those.
2012-08-30 10:46:58 +03:00
Wolfgang Hommel
d8053c280c Reorder linker flags as suggested by Lukas Fleischer v0.9.1 2012-02-05 00:07:54 +01:00
Wolfgang Hommel
b067cdce2b Initialize INSTALL as suggested by Lukas Fleischer 2012-02-05 00:05:46 +01:00
Wolfgang Hommel
dac5d28af2 Updated documentation for the upcoming 0.9 release v0.9 2012-01-11 22:37:21 +01:00
Wolfgang Hommel
84f61b75b3 Updated todo list to reflect OSX improvements
The Mac OS X 10.7 Lion issues have been fixed. Updated
the todo list accordingly and outlined the next steps.
2012-01-11 22:35:14 +01:00
Wolfgang Hommel
ec89c44011 Added feature to exec external command after x sec
This feature makes libfaketime execute an arbitrary system
command, such as a shell script, after a program has been
running for X seconds or has made Y time-related function
calls.
It is controlled by three environment variables.
FAKETIME_SPAWN_TARGET is the full path + file name +
command line arguments to the user-specified system
command.
FAKETIME_SPAWN_SECONDS is the number of seconds (after
program start / program's first time function call) after
which FAKETIME_SPAWN_TARGET will be executed.
FAKETIME_SPAWN_NUMCALLS can be used as an alternative
to ..._SECONDS.
2012-01-11 22:23:09 +01:00
Wolfgang Hommel
837e2c7e62 Added new feature to limit libfaketime activity
These changes add a new feature that can be used to limit
libfaketime's activity period, and prepares for the upcoming
0.9 release.
Four new environment variables can optionally be set:
FAKETIME_START_AFTER_SECONDS, FAKETIME_STOP_AFTER_SECONDS,
FAKETIME_START_AFTER_NUMCALLS, and FAKETIME_START_AFTER_NUMCALLS.
libfaketime will only return faked timestamps if the program's
runtime is between FAKETIME_START_AFTER_SECONDS and
FAKETIME_STOP_AFTER_SECONDS seconds. For example, a program
may be started with the real current time, and after 60
seconds, it will start to receive faked timestamps, e.g.,
one year in the future. The other pair of environment
variables limits libfaketime's activity based on the number
of time-related system calls of the started program,
instead of its run-time in seconds.
Using this new feature will break applications that cannot
handle larger sudden changes in timestamps, so use it with
care.
2012-01-08 22:41:54 +01:00
Wolfgang Hommel
e72d8e0419 Fixed build issues as suggested by Paul Wouters
- Updates COPYING file (fixed wrong FSE address)
- Avoid overwriting CFLAGS and LDFLAGS in src/Makefile
2011-11-28 19:40:00 +01:00
Wolfgang Hommel
4acfdddc89 Minor changes
Minor changes to README.OSX
2011-10-19 23:03:53 +02:00
Wolfgang Hommel
0a1c887a8a Fixed issues on Mac OS X 10.7 Lion
- Changed interception of internal syscalls on OSX
  and malloc arena treatment
- Adapted the faketime wrapper shell script to set
  the appropriate environment variables on OSX and
  use gdate instead of date
- Added README.OSX to explain the OSX-specific
  aspects of compiling and using libfaketime
2011-10-19 21:03:41 +02:00
Wolfgang Hommel
18adec4fae Added TODO item about libfaketime on OS X 10.7 (Lion)
libfaketime appears not to work on OS X 10.7 (Lion). It does not fake th
e time and sporadically causes a segfault.
2011-07-30 11:19:16 +02:00
Wolfgang Hommel
f07939d948 Minor adaptions for Mac OS X 2011-07-30 10:58:12 +02:00
Wolfgang Hommel
68ccdb74b5 Described recent changes and next steps 2011-07-30 10:50:19 +02:00
wolfcw
a5896e3dcb Merge pull request #3 from dfong/master
eliminate use of dc
2011-07-26 14:33:53 -07:00
don fong
54bc41ffaf compute pow() with shell only, in case we don't have bc, dc, perl 2011-07-26 12:54:42 -07:00
wolfcw
9099c4ab85 Merge pull request #2 from dfong/master
new framework for functional tests
2011-07-25 22:15:25 -07:00
don fong
ea15324e30 add support for new framework for functional tests 2011-07-25 17:04:09 -07:00
Lukas Fleischer
e4cfb671dd NEWS: Add note on MacOS port
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-07-15 15:50:03 +02:00
Lukas Fleischer
ab66fd5237 NEWS: Fix trailing whitespace
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-07-15 15:50:03 +02:00
Lukas Fleischer
86f738b25e Restructure meta files
* Move "COPYING" and "Changelog" from "meta/" to the top-level source
  directory. No need to have a separate directory for two small text
  files. Also, it's common practice to put these there.

* Makefile: Merge "meta/Makefile".

* Rename "Changelog" to "NEWS". The file containing a summary of changes
  between two releases in generally called "NEWS". The name "ChangeLog"
  should only be used for a detailed log of every commit.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-07-15 15:49:58 +02:00
wolfcw
f2ba5c7750 Merge pull request #1 from dbrashear/master
I ported libfaketime to MacOS.
2011-07-09 09:47:29 -07:00
Derrick Brashear
74852f1682 add multi-architecture support
extra -arch flags should do it.
2011-07-08 08:19:29 -04:00
Derrick Brashear
3c24c524b3 macos: pass one gettimeofday unmodified
needed to avoid a malloc recursion; dyld calls the libSystem
initializer, which calls malloc as the first caller; that uses
the arc4 randomizer, which calls gettimeofday... the call to fake_time
calls strptime_l, _strptime0, gmtsub, and boom, back at malloc.

pass one gettimeofday call to let the malloc succeed.
2011-07-05 10:46:34 -04:00
Derrick Brashear
eb59447a6d libfaketime macos port
port libfaketime to macos and dyld.
1) _ftpl_time calls gettimeofday since real time() does so. needed
   to avoid double adjustment.
2) reduce call stack: use time tptr and call fake_time instead of
   calling time for faking other time calls.
3) provide MacOS makefile and README notes.
4) make posix realtime calls under ifdef; define for base port but not
MacOS.
2011-07-05 09:05:38 -04:00
Wolfgang Hommel
ed25084970 Modified documentation and changelog based on the recent changes 2011-05-22 00:21:04 +02:00
Wolfgang Hommel
2a384f70ba fixed one more hard-coded path
changed the Makefile echo output so it also uses the prefix
environment variables just like the install calls.
2011-05-22 00:05:24 +02:00
Lukas Fleischer
4991c61b77 Overwrite existing man pages when running make install.
Add "-f" option to gzip(1) invocation to avoid user prompts if
compressed man pages already exist in the target directory.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 22:07:49 +02:00
Lukas Fleischer
b6ca32ed23 Use install(1) instead of mkdir(1) and cp(1) in Makefiles.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 22:07:10 +02:00
Lukas Fleischer
bb9b292a41 Use a separate Makefile for meta files.
* Create separate "install" and "uninstall" targets for meta files.

* Add meta file targets to the shortcut Makefile.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 22:02:14 +02:00
Lukas Fleischer
9763cdebd2 Use a separate Makefile for man pages.
* Create separate "install" and "uninstall" targets for man pages.

* Add man page targets to the shortcut Makefile.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 21:43:24 +02:00
Lukas Fleischer
8c6c487b24 Tell the compiler to be C99 compliant, enable all warnings.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 21:43:23 +02:00
Lukas Fleischer
5fa942b4cf Cast time_t to unsigned integer when using printf().
Suppress compiler warnings when using "-Wformat".

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 21:43:23 +02:00
Lukas Fleischer
d2108361c0 timetest.c: Add "sys/time.h" include (required for gettimeofday()).
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 21:43:23 +02:00
Lukas Fleischer
403d240444 Add shortcut Makefile.
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 21:43:23 +02:00
Lukas Fleischer
9b62bb4f38 Test suite Makefile overhaul.
* Use variables for compiler and linker flags.

* Use variables for source/object files and binaries.

* Use proper targets instead of phony targets to build the timetest
  program.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 21:43:23 +02:00
Lukas Fleischer
52c30f866d Source Makefile overhaul.
* Use variables for compiler and linker flags.

* Use variables for source/object files, library names and sonames.

* Use proper targets instead of phony targets to build the shared
  libraries.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-05-10 21:43:21 +02:00
Lukas Fleischer
cf0ccef687 Move test suite to a separate subdirectory.
* Move test suite related stuff from "src/" to "test/".

* Fix "test.sh" to search for libfaketime libraries in the right place.

* Split up Makefile into two separate Makefiles (one for the main
  program and one for the test suite).

Test cases should go in another directory for the sake of clean code
separation. This will also facilitate the creation of proper Makefiles.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-04-27 18:50:40 +02:00
Lukas Fleischer
9234f5df86 Add ".PHONY" target to the Makefile.
This is required for targets that do not directly refer to files.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-04-26 17:29:22 +02:00
Lukas Fleischer
cd0667a7a6 Add an uninstall target to the Makefile.
This is especially advantageous if libfaketime is built from source as
there isn't another convenient way to do a clean uninstall.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-04-26 17:25:55 +02:00
Lukas Fleischer
46f6bd5b9b Use "$DESTDIR" and "$PREFIX" in the Makefile.
This is a standard used by almost all open source projects and allows
installing to different locations than the default location (which is
especially useful for packagers, e.g.) Switch to installing to
"/usr/local" by default, also. "/usr" should never be used as default
prefix.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-04-26 17:22:12 +02:00
Lukas Fleischer
5bbb393e07 Add ".gitignore".
Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2011-04-26 17:17:16 +02:00
Wolfgang Hommel
a6ce767de9 git repository based on v0.8 v0.8 2011-04-24 19:55:43 +02:00