aboutsummaryrefslogtreecommitdiff
path: root/src/system.c
Commit message (Collapse)AuthorAgeFilesLines
* System calls fixup (#38)Joseph Hunkeler2024-08-281-28/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix up shell() behavior * Removes dead code after execl() * Return the return value of execl() immediately * Output redirection fix: if f_stderr and redirect_stderr were both set, stderr was not redirected * Move the file handles into the child process * Bash now executes with --norc to avoid clobbering environment variables. This mimics /bin/sh behavior. * Fix test script environment * shell() already provides a temporary script. Not jumping into another sub-shell should preserve help preserve the top-level environment. * Try a different approach using declare -f * Revert "Try a different approach using declare -f" This reverts commit ea8ec855c3c6870d29c55afe3787afb2c05026a1. * Revert "Fix test script environment" This reverts commit 0a4efe972a78378eba5c5fbc6819c39b3cc6c9cb. * Change script permissions: 0700 * Force conda reactivation in test script * Switch to the usual environment reactivation method
* Rebrand OhMyCal (OMC) as STASIS (#7)Joseph Hunkeler2024-06-211-4/+4
|
* Unit tests (#6)Joseph Hunkeler2024-06-201-25/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial commit of unit tests [WIP] * Address shortcomings and bugs flushed out by unit tests * Enable unit testing in CI workflow * Enable verbose ctests * Handle lack of __FILE_NAME__ define * Only podman support `run --arch` argument * Skip docker build testing if CI system cannot pull an image * Remove errant call to puts() * Identify local repo user * Fix missing xmllint * NULL terminate arrays * Fix filename assignment in is_url mode * Break loop when expected lines are exhausted * strcmp_array expects NULL terminated array. Iterating by size in this case passes NULL to strcmp leading to an invalid read * Remove debug printf statements * Disable a few warnings for tests * Workaround for ctest junit xml truncation * Update checkout@v4 * Prevent false-positive result * Return zero on error * Fix strlist_remove function * Value argument can be constant * Fix test to match changes to startswith and endswith * Add test_ini.c * Fix redaction code to accept NULL pointers in array * And let the caller specify the length of the array of strings to redact. * Redactions now occur directly on authentication strings rather than their command line arguments * Fix BUILD_TESTING_DEBUG * Adds missing -D argument
* Fix realloc handlerJoseph Hunkeler2024-04-101-2/+1
|
* Remove commented codeJoseph Hunkeler2024-03-221-1/+0
|
* BugfixJoseph Hunkeler2024-03-141-5/+6
| | | | | | * When the result string grew larger than the initial_size, the function would return NULL even if realloc succeeded * Replaces fgets with fread to ensure all data returned by the program is consumed. * The line buffer is zeroed for each iteration
* Use do/while in guard_* macros to make them behave more like functionsJoseph Hunkeler2024-03-101-1/+1
|
* xmkstemp allow setting file modeJoseph Hunkeler2024-03-041-1/+1
| | | | * add usage comment function
* Fixes several memory leaksJoseph Hunkeler2024-02-261-0/+2
|
* Refactor std output stream to use f_std{out,err}Joseph Hunkeler2024-02-061-6/+6
|
* Refactor std{out,err} to f_std{out,err}Joseph Hunkeler2024-02-061-4/+4
| | | | * Bare stdout and stderr, even as struct members, tend to conflict with numerous libc implementations.
* General improvementsJoseph Hunkeler2024-01-301-78/+5
| | | | | | | | | | | * Fix segfault related to Delivery.storage.tmpdir not being initialized properly * Add delivery_format_str() to make delivery rules easier to maintain * Test configurations can accept their own runtime variables * When no conda package or python packages are to be installed, indicate that state by printing "N/A" in output summary * Change shell_safe() accept a string instead of an array * Add support for artifactory client certs key/path * Initial pass at defining an artifactory repo destination (not fully implemented yet) * Add missing line feeds to error messages during ini config initialization
* Use TMPDIR, and fail when script cannot be executed within that filesystemJoseph Hunkeler2023-11-201-1/+9
|
* Add shell_output() and use xmkstemp()Joseph Hunkeler2023-11-201-8/+36
|
* Rebrand for the last timeJoseph Hunkeler2023-11-201-0/+1
| | | | | * Shorten OHMYCAL to OMC * Rename ohmycal.h to omc.h
* Close dangling file descriptorJoseph Hunkeler2023-10-311-1/+8
| | | | * Only remove temporary script file if it exists
* Initial commitJoseph Hunkeler2023-10-261-0/+201