]> Kevux Git Server - fll/log
fll
3 months agoBugfix: The uid_t and gid_t should be initialized to -1 and not 0.
Kevin Day [Sat, 8 Feb 2025 21:48:37 +0000 (15:48 -0600)]
Bugfix: The uid_t and gid_t should be initialized to -1 and not 0.

4 months agoBugfix: f_signal_close() should be setting signal id to -1 and not 0.
Kevin Day [Thu, 23 Jan 2025 04:45:22 +0000 (22:45 -0600)]
Bugfix: f_signal_close() should be setting signal id to -1 and not 0.

The signal id is a file descriptor and a non-valid file descriptor is -1 instead of 0.

4 months agoBugfix: The IKI and EKI specifications do not require escaping inside of Content.
Kevin Day [Sat, 11 Jan 2025 16:38:29 +0000 (10:38 -0600)]
Bugfix: The IKI and EKI specifications do not require escaping inside of Content.

This is an oops on my part.
I thought I was correcting something that I missed and I ended up causing a problem.
I think this problem was introduced in this commit: e1c95441efc531bb27117aa9aa6067436d5b17da.

4 months agoBugfix: Specification files need proper escaping for example code.
Kevin Day [Fri, 10 Jan 2025 05:28:35 +0000 (23:28 -0600)]
Bugfix: Specification files need proper escaping for example code.

The IKI/EKI need to be properly escaped inside the example so that when the specification file itself is processed, the examples do not get substituted.

The examples that have what would be valid FSS Basic Lists also need to be escaped for the same reason.

4 months agoCleanup: Comments in examples in specifications must be escaped.
Kevin Day [Fri, 10 Jan 2025 01:27:22 +0000 (19:27 -0600)]
Cleanup: Comments in examples in specifications must be escaped.

These comments are intended to be printed so that they can be shown as an example.
Escape them.

5 months agoUpdate: Clarify precedence of the --name, --at, and --line for IKI Read.
Kevin Day [Sun, 5 Jan 2025 16:33:21 +0000 (10:33 -0600)]
Update: Clarify precedence of the --name, --at, and --line for IKI Read.

Add description of the order of operations, or precedence, for the `--name`, `--at`, and the `--line` parameters.

5 months agoUpdate: IKI Read design and logic to be consistency with 0.7 logic.
Kevin Day [Thu, 2 Jan 2025 04:19:21 +0000 (22:19 -0600)]
Update: IKI Read design and logic to be consistency with 0.7 logic.

This fixes some logic problems and oversights regarding IKI Read.

Several of the "problems" are really just functionality that is operating inconsistently with the FSS Read programs.
The logic is updated to be more reasonable and to better hand fail cases without throwing as many errors.

The logic is back ported, but much of the design is different between the 0.6 and 0.7 code.
Rather than re-design the 0.6, I sort of wedged the logic changes in place.
I'm not particularly happy about this but I think this is good enough.

A lot of the changes made have been done sporadically in random moments of time that I have had available on my holiday.
The code quality is likely not up to my usual.

The newly added unit tests are being used to direct the correctness of the program.
The only problem being that the unit tests are newly added and are themselves not well reviewed.

I am hoping to focus on the 0.7 development this year of 2025.
This means my focus on some of the 0.6 code is going to be waning.

I don't expect much changes on the 0.6 code anyway and the changes to the IKI Read are an exceptional case.

5 months agoUpdate: Change --substitute short parameter from -s to -S for iki_read.
Kevin Day [Tue, 10 Dec 2024 04:32:33 +0000 (22:32 -0600)]
Update: Change --substitute short parameter from -s to -S for iki_read.

A lot of recent bug fixes have resulted in significant behavioral changes in the iki_read parameters.
There are enough breaking changes at this point that I feel safe in making this change from `-s` to `-S`.

This change makes iki_read more forward compatible with changes introduced in the 0.7.x and greater versions of iki_read.
The `-s` or `--select` from the 0.7.x branch is not being back ported but it is much more compatible to make the `--substitute` short parameter consistent across those releases.

5 months agoUpdate: Finish implementing the iki_read runtime tests.
Kevin Day [Tue, 10 Dec 2024 04:28:17 +0000 (22:28 -0600)]
Update: Finish implementing the iki_read runtime tests.

There are 2465 tests.
This is a bit much for manual verification.

I am doing the same thing that I have done in the past.
Which is to just generate the expected results based on the current output.
The problem is that with this design the tests will pass even if there are problems or mistakes.

These tests will have to be verified and fixed over time as needed.
Porting this overr to the 0.7.x development branch will help me catch such problems.

This completes the following in progress commits:
fde7fdd4a264dc9e52e0bbfc9721473df64bcc88

5 months agoBugfix: Fix bug in generate.sh script parameters and fix spacing style.
Kevin Day [Tue, 10 Dec 2024 03:59:09 +0000 (21:59 -0600)]
Bugfix: Fix bug in generate.sh script parameters and fix spacing style.

Some of the parameters are in the wrong order.

Add spacing to allow for lining up the lines to make it much easier to scan through with human eyes.

5 months agoBugfix: Fix handling of --line when not using --whole.
Kevin Day [Tue, 10 Dec 2024 03:34:41 +0000 (21:34 -0600)]
Bugfix: Fix handling of --line when not using --whole.

The function `iki_read_process_at()` is incorrectly named and should instead be called `iki_read_process_line()`.

The `--object`, `--content`, and `--literal` parameters with `--line` should print the line number for the output of those commands raather than the output of the file.
The printing of the line from the original file is very confusing and so I am considering this a bug.

Update the print help message.

5 months agoProgress: Begin adding the iki_read runtime tests.
Kevin Day [Mon, 9 Dec 2024 02:44:13 +0000 (20:44 -0600)]
Progress: Begin adding the iki_read runtime tests.

This sets up the testing scripts.
No expect files are generated yet.

I need to run the script and fix problems.
Then I need to review the generated expect files for problems and fix any discovered problems.

There are parameter combinations that I have not yet address but this runtime test file is big enough for now.

5 months agoBugfix: The IKI Read --total restrictions are not needed anymore.
Kevin Day [Mon, 9 Dec 2024 02:40:49 +0000 (20:40 -0600)]
Bugfix: The IKI Read --total restrictions are not needed anymore.

The `--total` parameter when combined with other parameters should not generate an error.
For cases of replacement, this should not be an error.

When `--total` is used with say `--wrap`, then the `--wrap` is pointless but not an error.
This should provide a better user experience.

5 months agoUpdate: Improve error reporting in runtime tests during generation.
Kevin Day [Mon, 9 Dec 2024 02:30:09 +0000 (20:30 -0600)]
Update: Improve error reporting in runtime tests during generation.

The generation now prints the specific command that failed.

5 months agoUpdate: Only print final new line on interrupt.
Kevin Day [Sun, 8 Dec 2024 19:38:16 +0000 (13:38 -0600)]
Update: Only print final new line on interrupt.

The behavior of adding the trailing new line is a bit problematic.
Remove the extra line, except for when an interrupt is triggered.

5 months agoBugfix: IKI Read may now have --whole with --at.
Kevin Day [Sun, 8 Dec 2024 19:23:17 +0000 (13:23 -0600)]
Bugfix: IKI Read may now have --whole with --at.

The recent changes for the `--total` parameter now allow for having the `--whole` parameter with the `--at` parameter.

The `--whole` with `--at` by itself does nothing.

Make sure that the `--at` works with `--name` along with `--whole`.

This program neither supports multiple `--at` nor multiple `--name`.
The use case of `--at` with `--whole` will therefore be very limited.

5 months agoBugfix: IKI Read is not handling parameter errors properly.
Kevin Day [Sun, 8 Dec 2024 19:21:10 +0000 (13:21 -0600)]
Bugfix: IKI Read is not handling parameter errors properly.

The `status` variable is being re-assigned after the error bit is set.
Add additional checks to prevent this from happening.

5 months agoCleanup: The ternaries for iki_read and fll_print_format().
Kevin Day [Sun, 8 Dec 2024 19:12:06 +0000 (13:12 -0600)]
Cleanup: The ternaries for iki_read and fll_print_format().

Use the ternary to reduce the functions defined for the total parameter printing.
Use the correct style for when a function has complex ternary.

5 months agoBugfix: The -t/--total in iki_read is confusing and allow for --total with --whole.
Kevin Day [Sun, 8 Dec 2024 01:55:01 +0000 (19:55 -0600)]
Bugfix: The -t/--total in iki_read is confusing and allow for --total with --whole.

The `--total` parameter should print the total number of IKI Variables.
The `--line` parameter is selecting based on the line as if the `--whole` parameter is based (even when it is not).
This makes little sense when in the `--content` that is the default behavior.

This solves part of that confusion by focusing on the `--total` parameter.

Using the `--whole` should also print the total number of lines rather than total number of Variables.

I will need to follow this up with runtime tests.
There are none at this time so a separate commit is needed to add all of the appropriate tests.

5 months agoUpdate: IKI Read help message.
Kevin Day [Sun, 8 Dec 2024 00:53:09 +0000 (18:53 -0600)]
Update: IKI Read help message.

Improve the sentences in the help message.
Re-organize the structure slightly to group the print commands together.

6 months agoUpdate: The time specification, making it more flexible.
Kevin Day [Sat, 23 Nov 2024 21:00:03 +0000 (15:00 -0600)]
Update: The time specification, making it more flexible.

Improve the time specification to grant better control and flexibility on what it means to those implementing and using it.
Provide suggestions regarding IKI and EKI.
Remember, these are suggestions and are not requirements.

6 months agoBugfix: IKI and EKI specifications, clarifying backslash escaping.
Kevin Day [Thu, 21 Nov 2024 04:51:51 +0000 (22:51 -0600)]
Bugfix: IKI and EKI specifications, clarifying backslash escaping.

I made several improvements in my previous commit e1c95441efc531bb27117aa9aa6067436d5b17da.
I added documentation regarding the backslashes similar to how the FSS backslashes are handled.
For the IKI and EKI specifications, this is not the case.

Update the specification to clarify this situation.
Update the examples to better describe this.
Fix the examples to be accurate.

6 months agoCleanup: Unit test for f_iki.
Kevin Day [Thu, 21 Nov 2024 04:50:18 +0000 (22:50 -0600)]
Cleanup: Unit test for f_iki.

Use the version 0.1.0 in the test string so that it no longer gets changed with release changes.
Add the missing undef for `_inline_macro_total_rows`.
Fix the constant status declaration scope.

6 months agoCleanup: Style practices in f_iki.
Kevin Day [Thu, 21 Nov 2024 04:49:36 +0000 (22:49 -0600)]
Cleanup: Style practices in f_iki.

6 months agoBugfix: The IKI and EKI specifications have mistakes and needs clarifications.
Kevin Day [Tue, 19 Nov 2024 02:26:01 +0000 (20:26 -0600)]
Bugfix: The IKI and EKI specifications have mistakes and needs clarifications.

The wording of the specification is now greatly improved.
I noticed that some of the specification is actually incomplete.
I removed the incomplete sentence.

Make sure the FSS-000C specification is updated to add allowances for the EKI specification.

The example in both the IKI and the EKI specifications has several mistakes.
Use the grave character (U+0060) for the code to help avoid needing to escape the single quotes.
The IKI inside of a valid IKI Variable do not need to be escaped.
The example that directly states "is escaped to not be treated as IKI Variable" is incorrectly being documented as a valid IKI syntax (a significant mistake on my part).

Add explicit escaping examples to help make the escape behavior more explicit and clear.
I believe the current escaping logic in the IKI processing code is incorrect and will need to be updated and corrected following this commit.

I remembered this time to make the date based on UTC.
The version date in this commit is based on the current UTC Earth day.

6 months agoUpdate: Backport f_iki unit tests changes.
Kevin Day [Sun, 17 Nov 2024 23:27:56 +0000 (17:27 -0600)]
Update: Backport f_iki unit tests changes.

The 0.7.x version commit 60d4e0c667860574659e9a7966ac0c591054f61a introduces additional unit tests.
Back port these unit tests to the 0.6.x version.

6 months agoCleanup: The f_iki_read() using digits for wrapped rather than f_true and f_false.
Kevin Day [Sun, 17 Nov 2024 23:24:51 +0000 (17:24 -0600)]
Cleanup: The f_iki_read() using digits for wrapped rather than f_true and f_false.

This brings in changes introduced upstream commit 60d4e0c667860574659e9a7966ac0c591054f61a.
The `wrapped` is changed to use `0x0` and `0x1` rather than `F_false` and `F_true`.
These are functionally identical but the code is more consistent when having `0x0`, `0x1`, and `0x2` instead of `F_false`, `F_true`, and `0x2`.

6 months agoUpdate: IKI and EKI specifications.
Kevin Day [Sat, 16 Nov 2024 05:31:38 +0000 (23:31 -0600)]
Update: IKI and EKI specifications.

Further clarify the specifications and simplify some of the logic.
The "Before Structure" is confusing in that it has a `\*:*`.

6 months agoBugfix: Perform range check before access array and fix typos in comments.
Kevin Day [Fri, 15 Nov 2024 03:37:24 +0000 (21:37 -0600)]
Bugfix: Perform range check before access array and fix typos in comments.

The range test must be performed and matched before attempting to access the array position at the range.

6 months agoUpdate: Add FSS Embedded List read depth tests and fix test script files.
Kevin Day [Fri, 8 Nov 2024 05:00:02 +0000 (23:00 -0600)]
Update: Add FSS Embedded List read depth tests and fix test script files.

Add tests for the FSS-0008 standard using depths.
I generated these test expectations.
I will have to slowly review these over time or fix them when I identify one is wrong.
I did do a test by building the same tests on both the 0.6 and 0.7 and found that they both pass.
I either have correct logic or I have consistently bad logic.

This adds a lot of FSS-0008 depth tests, however, the amount of tests needed is a lot more than what I have done here.
I think this large number is a good start.

Add special cases functions for the script tests.
I noticed that the failure code is incorrectly being set (the logic appears reversed).

The conditional argument used to determine which test being run in the test script is wrong.
Create a new variable called `test_set` and use that.
The `standard` variable can then be extracted from the `test_set`.

The test script incorrectly is missing the `-o` for the Object in some cases.

7 months agoFeature: Add EKI specification for EKI standard, a slightly updated IKI standard.
Kevin Day [Mon, 4 Nov 2024 03:19:29 +0000 (21:19 -0600)]
Feature: Add EKI specification for EKI standard, a slightly updated IKI standard.

Think of EKI as an extended IKI.
This introduces a single change (and its accompanying requirements).

Multiple IKI Vocabularies are now supported.
I have been using IKI in practice for a while now.
A need has risen up where I really want to be able to easily designate multiple IKI Vocabularies for a single IKI Variable.

This new format allows for me to do something more similar to HTML.
I have been using IKI as part of a templating process.
With EKI, unlike IKI, I can now make something both bold and italic.
Whereas with IKI, I would have to create a new type that combines them (like `bold_italic`).

I would then have to create two types if I wanted to be order agnostic, such as `bold_italic` and `italic_bold`.
This would get progressively worse if I added a third or more Vocabularies.

With EKI, I don't add any new IKI Variables and the order does not necessarily matter.

Example: `bold:italic:"My example"` (and `italic:bold:"My example"`).
This would have `bold` and `italic`.
The order should be preserved in case something does care about order.
The order can be ignored if something does not care about order.

7 months agoBugfix: Mistakes in the IKI specification.
Kevin Day [Mon, 4 Nov 2024 03:09:57 +0000 (21:09 -0600)]
Bugfix: Mistakes in the IKI specification.

Explicitly describe the colon `:` (`U+003A`).

The escape sequence is before the colon `:` (`U+003A`) and not the close bracked `]` (`U+005D`).

The example should be using `bold` and not `strong`.

The specification file names are incorrectly named (should be `iki` and not `fss`).

8 months agoBugfix: Empty Objects are preserving leading white space when in original mode and...
Kevin Day [Sat, 5 Oct 2024 03:01:27 +0000 (22:01 -0500)]
Bugfix: Empty Objects are preserving leading white space when in original mode and update runtime tests.

This (unfortunately) adds more logic to processing the case when `--original` is used and the Object is empty.

This makes me wonder if I have to implement the opener range.
I was not happy about adding the `close` for memory and space reasons.
Adding this would introduce more inefficiencies.

I may end up having to add support for processing different types of structures if I want to support the simple Object and Content without the `open` and `close` positions as well as with those positions.
The focus in this commit is only on fixing the printing and does not introduce any of the behavior that I described here.

Update the runtime tests for all of the FSS Read programs.
Some of the tests were missing or were incorrect such that this bug slipped by without detection.
The FSS Payload Read tests now have the (missing) NULL characters added to them.

8 months agoUpdate: Next micro version (0.6.13).
Kevin Day [Thu, 3 Oct 2024 03:23:18 +0000 (22:23 -0500)]
Update: Next micro version (0.6.13).

The following are the commands that I ran to make this change.
  # find build/ level_? specifications/ documents/ licenses/ -type f -exec sed -i -e 's|0\.6\.12|0.6.13|g' '{}' ';'
  # find build/ level_? specifications/ documents/ licenses/ -type f -exec sed -i -e 's|^version_micro 12|version_micro 13|g' '{}' ';'
  # find level_3/ -name common.h -exec sed -i -e 's|_program_version_micro_s F_string_ascii_1_s F_string_ascii_2_s|_program_version_micro_s F_string_ascii_1_s F_string_ascii_3_s|g' '{}' ';'
  # find level_3/ -name common.h -exec sed -i -e 's|_program_version_micro_s_length (F_string_ascii_1_s_length + F_string_ascii_2_s_length)|_program_version_micro_s_length (F_string_ascii_1_s_length + F_string_ascii_3_s_length)|g' '{}' ';'

8 months agoUpdate: The bootstrap example script now handles building using fake. 0.6.12
Kevin Day [Tue, 1 Oct 2024 02:07:43 +0000 (21:07 -0500)]
Update: The bootstrap example script now handles building using fake.

The bootstrap example script is generally for using bootstrap scripts.

I have ended up using this for regular building because it is simple and already written.
The FLL 0.7 development now has build settings for some programs that do not build using the bootstrap without additional parameters.

Add support for the bootstrap script to use `fake` directly if it exists in the PATH for these particular programs.

This is added to the 0.6 stable branch for consistency purposes and essentially does nothing there.
There are no programs in the 0.6 stable branch that utilize this.

8 months agoCleanup: Fix position of high ports to be consistent.
Kevin Day [Wed, 25 Sep 2024 00:25:24 +0000 (19:25 -0500)]
Cleanup: Fix position of high ports to be consistent.

8 months agoFeature: Fake settings specification updates and enable simple golang support.
Kevin Day [Mon, 23 Sep 2024 01:53:35 +0000 (20:53 -0500)]
Feature: Fake settings specification updates and enable simple golang support.

The Featureless Make is intended to not be language specific since its inception.
I did not know how the languages were to work, so I mostly built this to guarantee C/C++ support.

I found that the `golang` supports some command line based compilation.
This adds support for `golang` in the most basic way.
This support is not well tested.
An `example_go` project is added.
I have only tested the basic build and I have not done anything advanced.

This relaxes some of the requirements.
The `bash` is changed to `shell` to encourage more types of scripts.
The `custom` is added and used as a fallback if `build_language_path` is not used.

I found that there needs to be some additional settings in the `settings` specification.
This updates the specification and adds:
  - build_compiler_arguments
  - build_compiler_arguments_shared
  - build_compiler_arguments_static
  - build_compiler_arguments_library
  - build_compiler_arguments_library_shared
  - build_compiler_arguments_library_static
  - build_compiler_arguments_object
  - build_compiler_arguments_object_shared
  - build_compiler_arguments_object_static
  - build_compiler_arguments_program
  - build_compiler_arguments_program_shared
  - build_compiler_arguments_program_static
  - build_language_path

This also fixes some mistakes in the language of the specification.

8 months agoUpdate: Refresh firewall iptables rules and relax some of the defaults.
Kevin Day [Tue, 17 Sep 2024 02:13:26 +0000 (21:13 -0500)]
Update: Refresh firewall iptables rules and relax some of the defaults.

Relax some of the defaults so that there will be less immediate failure.
Provide a lot of the previous `DROP` statements for easy re-assignment by just uncommenting.

Add some specific wrapping tools around IPv6 related rules.

8 months agoUpdate: Cgroup example controller script example to show running under a SystemD...
Kevin Day [Sat, 14 Sep 2024 21:03:56 +0000 (16:03 -0500)]
Update: Cgroup example controller script example to show running under a SystemD system.

This is not required, but it builds the structure to accommodate the over-engineered SystemD absurdity of an init system.
This is now more dynamic.

Also show different programs like browsers.
Also show firewall being set to startup.

8 months agoUpdate: Improve robustness of the fll_control_group_prepare() function.
Kevin Day [Wed, 11 Sep 2024 05:19:55 +0000 (00:19 -0500)]
Update: Improve robustness of the fll_control_group_prepare() function.

Add additional existence checks before attempting to create a directory within the cgroup path.

9 months agoBugfix: FSS Embedded List Read printing tabbing when using original mode and trim...
Kevin Day [Sat, 7 Sep 2024 13:45:32 +0000 (08:45 -0500)]
Bugfix: FSS Embedded List Read printing tabbing when using original mode and trim mode.

Do not double-print the before spaces when both original and trim modes are in use.
Print the before even with original and trim are in use when the Object has no size.

9 months agoBugfix: Get the FSS Embedded List Read working as expected based on runtime tests.
Kevin Day [Sat, 7 Sep 2024 00:09:52 +0000 (19:09 -0500)]
Bugfix: Get the FSS Embedded List Read working as expected based on runtime tests.

A good portion of clean ups and design changes to address special cases or anything overlooked.
The runtime tests now pass as expected.

There are still some situations that need to be fixed.

9 months agoCleanup: Fix dead code.
Kevin Day [Thu, 5 Sep 2024 02:43:03 +0000 (21:43 -0500)]
Cleanup: Fix dead code.

The graph condition is always `0x1` when entering the block but inside it checks for `0x2`.
Update the function to accept either `0x1` or `0x2`.

9 months agoCleanup: Fix mispelling in tests.
Kevin Day [Thu, 5 Sep 2024 02:42:32 +0000 (21:42 -0500)]
Cleanup: Fix mispelling in tests.

The `valud` should be `valid`.

9 months agoFeature: Add support for building under Android.
Kevin Day [Wed, 4 Sep 2024 05:15:16 +0000 (00:15 -0500)]
Feature: Add support for building under Android.

This is not well tested or well supported.
This does have limited testing under the Termux project environment using CLang.

Add a new configuration option to build and run the project in an Android environment.

The test system had problems with text relocations but then required PIE.
This disables the relro in some spots (libraries) while enabling it in others (programs/executables).

Disable a lot of the functions that are not available or supported.

I have observed several warnings about `DT_FLAGS_1=0x41` being unsupported flag.
That is not a very helpful warning.
I have no idea what `0x41` is.
This causes a problem where the output of programs displays these warnings.
This can break programs that require I/O formatting and processing.

This has been tested to build using `bootstrap.sh` and then using `fake`.
Example build and install process:
# mkdir ~/software
# cd fll-0.6.X/
# ./bootstrap.sh build -m monolithic -m thread -m clang -m android && ./install.sh ~/software
# cd ../fake-0.6.X/
# ./bootstrap.sh build -m monolithic -m thread -m clang -m android -w ~/software && ./install.sh ~/software
# export LD_LIBRARY_PATH=~/software/libraries/shared
# export PATH=~/software/programs/shared
# cd ../byte_dump-0.6.X/
# fake -m monolithic -m thread -m clang -m android -w ~/software && ./install.sh ~/software

Example execution of `byte_dump` of `bash` program (this is a large dump).
# byte_dump -wt 7 $(type -p bash)

9 months agoBugfix: Replace index() with strchr().
Kevin Day [Wed, 4 Sep 2024 03:21:53 +0000 (22:21 -0500)]
Bugfix: Replace index() with strchr().

The `index()` function is deprecated.
Use the `strchr()` function instead.

9 months agoUpdate: Implement Object alignment and trim expanding in FSS Read programs and restru...
Kevin Day [Mon, 2 Sep 2024 23:32:42 +0000 (18:32 -0500)]
Update: Implement Object alignment and trim expanding in FSS Read programs and restructure the program flags.

The program flags for the standard-specific functionality vs the program arguments were previously stored in the same bit space.
This breaks the two parts into the main program flags and the "feature" flags.

Implement support for new functionality where the Object structure can be optionally preserved.

Implement support for new functionality where the tabbing of the Object can be preserved, even when trimmed.
This is a step towards a "pretty print" mode that is more or less an "original print" mode.
The tabbing structure is now well preserved for standards like FSS Extended List (FSS-0003).

The Object alignment can determined from the Object close.
Use the `closes` structure to identify how the Object end is tabbed.
Then use that tabbing for the Object.
When trimming is enabled, still apply that tabbing.
This is done only for standards where such behavior makes sense.

The original print is now better preserved.
Printing an Object can now print the before and after Object characters (usually white space).
The trimming and original print may be used together to produce the results where the is no white space before or after the Object but everything else from the original source is preserved.
This combination of trim and original essentially ensure that the old behavior can be still produced.

I would further note that the processing of the FSS Embedded List (FSS-0008) Objects is not recursively performed.
No trimming or anything like that is applied at this time.
Only the selected depth is recursed into such that the Object and Content are processed.
I made this decision to keep the design as simple as possible.
Should I get the motivation and the time, then I may at some point in the future decided to recursively process and format all of the embedded structures.

I happened to notice duplicate and unused flags.
These are now removed.

Update the runtime tests accordingly.

Add new runtime tests to test the updated behavior.
I used the 0.6 and 0.7 to test these and I compared the results.
There is a discrepancy in some of 0.6 and 0.7 tests.
I will have to follow this commit with additional test fixes as necessary pending further review.

9 months agoBugfix: FSS Embedded List Read is not applying delimits when printing in line mode.
Kevin Day [Sun, 1 Sep 2024 02:34:04 +0000 (21:34 -0500)]
Bugfix: FSS Embedded List Read is not applying delimits when printing in line mode.

Make sure delimits are properly applied.

The `--line` mode is printing the line character by character.
Add a loop to check if the given character is to be printed or not based on the delimits array.

9 months agoBugfix: Empty Content lines with no Object printed should not be included for FSS...
Kevin Day [Sun, 1 Sep 2024 01:44:10 +0000 (20:44 -0500)]
Bugfix: Empty Content lines with no Object printed should not be included for FSS Embedded List.

The FSS Embedded List standard (FSS-0008) should not display any lines when Content is empty and Objects are not being printed.

9 months agoBugfix: Incorrect handling of column counts with empty data for FSS Embedded List...
Kevin Day [Sun, 1 Sep 2024 01:28:31 +0000 (20:28 -0500)]
Bugfix: Incorrect handling of column counts with empty data for FSS Embedded List Read.

9 months agoUpdate: The FSS Lists (FSS-0002, FSS-0003, FSS-0008, etc..) to match recent specifica...
Kevin Day [Sat, 31 Aug 2024 23:47:07 +0000 (18:47 -0500)]
Update: The FSS Lists (FSS-0002, FSS-0003, FSS-0008, etc..) to match recent specification changes and reduce redundancy.

Update the Object read functions to be in compliance with the latest specification changes.
Review and update the code, fixing any observed problems and perform some clean ups.

I noticed that several of the list functions for Object read are almost identical.
Move this logic into into a shared private function to reduce repeated code.

The runtime tests are also updated.

I still need to review the Content read functions.
I probably may be able to also find similar, if not identical, code for the list write functions as well.
I will review the code and create a private function similar to what is done here if deemed possible and reasonable.

9 months agoCleanup: Fix bad grammar in function documentation comments.
Kevin Day [Sat, 31 Aug 2024 23:42:43 +0000 (18:42 -0500)]
Cleanup: Fix bad grammar in function documentation comments.

9 months agoCleanup: The testfile for the FSS Read programs.
Kevin Day [Sat, 31 Aug 2024 00:47:32 +0000 (19:47 -0500)]
Cleanup: The testfile for the FSS Read programs.

9 months agoUpdate: The FSS Basic List (FSS-0002) to match recent specification changes regading...
Kevin Day [Fri, 30 Aug 2024 05:07:55 +0000 (00:07 -0500)]
Update: The FSS Basic List (FSS-0002) to match recent specification changes regading Objects.

The runtime tests are also updated.
The FSS Payload (FSS-000E) tests are also updated as they use the FSS-0002 code.

9 months agoUpdate: The FSS-0002 and FSS-0003 standards, modifying the space after Object rules.
Kevin Day [Fri, 30 Aug 2024 02:18:10 +0000 (21:18 -0500)]
Update: The FSS-0002 and FSS-0003 standards, modifying the space after Object rules.

My previous changes did not alter the behavior of the standard.
I spent some time considering this and decied that I should make this change.

The new behavior is that white spaces after the last printable character (aka "graph" character) in a valid Object is no longer considered part of the Object.
I decided to do this because supporting the space after the Object but not the space before the Object is awkward and also makes Object name matching more difficult.
One of the pillars of this project is "human first".
Doing this change makes it easier for a human to use by relaxing the exactness of a match when it comes to white spaces before or after a valid Object.

The specifications specifically include optionally supporting untrimmed Objects that include the white space before or after the Object to help accommodate the previous behavior.

I do not want to add quote support in the Object names here to keep it simple.
This new behavior seems to be a good compromise.

9 months agoUpdate: Clarify the FSS-0002 and FSS-0003 standards regarding the white space before...
Kevin Day [Thu, 29 Aug 2024 03:27:03 +0000 (22:27 -0500)]
Update: Clarify the FSS-0002 and FSS-0003 standards regarding the white space before and after a valid Object.

I updated my 0.7 code and back ported some of the generated runtime tests.
I discovered problems and realized that the standard could be more clear according to the spaces before and after the Object.

This does not change the FSS-0002 and FSS-0003 standards in any functional way.
The simply clarifies the standard regarding the spaces to make it more clear and reduce the chances for a mistake.

9 months agoCleanup: FSS Extended List function variable names and code structure.
Kevin Day [Tue, 27 Aug 2024 04:30:19 +0000 (23:30 -0500)]
Cleanup: FSS Extended List function variable names and code structure.

Make the variable name more explicit.
This variable name also matches recent 0.7 branch changes.

Move the allocation for the comments range after setting all of the variables.
This should better allow for determining the state should the `f_string_ranges_increase()` fail.

9 months agoBugfix: FSS Embedded Read is printing a single line with --line parameter with -...
Kevin Day [Sun, 25 Aug 2024 16:36:39 +0000 (11:36 -0500)]
Bugfix: FSS Embedded Read is printing a single line with --line parameter with --object.

The entire Content is being displayed when `--object` is used with `--line`.
The logic for printing the `--line` is entirely missing.
This adds the necessary logic to process the Object (and Content) when the `--line` is used.

Update the runtime tests accordingly.

9 months agoBugfix: Invalid comment handling in FSS Embedded Read.
Kevin Day [Sun, 25 Aug 2024 04:30:44 +0000 (23:30 -0500)]
Bugfix: Invalid comment handling in FSS Embedded Read.

The comments are not being properly processed because graph_first is not and should be being set to 0x1 at start.
As a result, the first comment is not being treated as a comment.

Make sure to reset the `graph_first` and `line_start` after processing the comment.
The comment starts at the line and so use `line_start` rather than `newline_last + 1`.
Remove dead code where `graph_first == 0x2` is being checked inside a block that requires `graph_first` to be `0x1`.

Update code comments about `graph_first` in several of the fl_fss read sources.

Add additional check for buffer string range when processing comments.

Update the runtime tests as appropriate.

I also noticed that several of these runtime tests use `--line` but are showing multiple lines.
I will address this bug in a separate commit.

9 months agoBugfix: FSS Embedded Read has incomplete and incorrect code.
Kevin Day [Sun, 25 Aug 2024 03:24:56 +0000 (22:24 -0500)]
Bugfix: FSS Embedded Read has incomplete and incorrect code.

I never noticed that I had not implemented the `--columns` support for FSS Embedded Read.
The `--columns` is now properly supported and has runtime tests.

The `--select` is not always printing a number.
Make sure a number, even if it is `0`, is always printed.
The `--select` now also follows the more strict behavior as implemented in the 0.7 branch

Update the `--total` to match the more strict behavior as implemented in the 0.7 branch.

9 months agoUpdate: Always count any --select when using --object for FSS Read programs.
Kevin Day [Sat, 24 Aug 2024 03:09:39 +0000 (22:09 -0500)]
Update: Always count any --select when using --object for FSS Read programs.

Working on the 0.7 FSS Read programs resulted in me noticing an oversight regarding the `--select` with the `--object`.
The `--object` will always result in showing things even if the `--select` number is infinitely large.

This is a back port of those changes.

I decided to also copy over a lot of the FSS Read code for this from 0.7.
Doing this should help make maintaining both the 0.6 nd 0.7 easier.

I still have work for the FSS Embedded Read program in the 0.7 branch and so I decided to withhold any 0.6 changes for FSS Embedded Read until I finish my changes in 0.7.

This updates the relevant runtime tests.

9 months agoUpdate: Improvements around FSS Read functions regarding correctness.
Kevin Day [Sun, 18 Aug 2024 01:10:08 +0000 (20:10 -0500)]
Update: Improvements around FSS Read functions regarding correctness.

Update the `verify.sh` script (and associated `testfile`) to print the test name.
Update the `generate.sh` and `verify.sh` scripts to safely pass arguments with spaces using `"$@"`.

Update the FSS Embedded Read to include the backported fixes such as those from commit 104ed789a759a344146431ded54cde9fefb063ec.
- The use of `f_memory_array_increase()` is incorrect in several cases.
- Switch to `f_memory_array_resize()`.
- Add 2 when resizing to account for the depth position but also an additional element as a minor memory allocation optimization.

Update the FSS Basic and FSS Extended Read functions.
- Avoid printing end of Object space when there is no Content.
- For FSS Extended Read, move the print quote into dedicated function.
- Add print Content end empty print function to match the 0.7 code (simplify comparisons between the different versions).
- Utilize the flag practices for `print_state` to be similar to the 0.7 code.

Update the FSS Embedded Read program:
- Security issue regarding incorrect memset value (passed `sizeof(skip)` when instead `sizeof(bool)` should be used).
- The `--line` parameter is not being correctly validated and throws an error when a value is specified.
- Fix bug where empty Content is being improperly handled and '}' is being returned as the Content for empty Content.
- Rebuild the tests to match the 0.6 generation because the 0.7 is invalid (once the 0.7 is fixed, then I will do more extensive comparisons and appropriate fixes).

9 months agoBugfix: FSS Extended Read needs to only print new line if Object or Content is printed.
Kevin Day [Tue, 13 Aug 2024 17:29:03 +0000 (12:29 -0500)]
Bugfix: FSS Extended Read needs to only print new line if Object or Content is printed.

Do not always print the new line for the case when printing Object or Content.
When the Content is being printed and is empty Content, then do not print the new line.

9 months agoBugfix: FSS Extended Read needs to properly handle --total when using --select and...
Kevin Day [Tue, 13 Aug 2024 03:55:37 +0000 (22:55 -0500)]
Bugfix: FSS Extended Read needs to properly handle --total when using --select and also --empty.

The use of --select 0 and --total should result in either 0 or 1.
The presence of --empty must also be taken into consideration.

9 months agoBugfix: FSS Basic Read needs to properly handle --total when using --select and also...
Kevin Day [Tue, 13 Aug 2024 03:33:51 +0000 (22:33 -0500)]
Bugfix: FSS Basic Read needs to properly handle --total when using --select and also --empty.

The use of --select 0 and --total should result in either 0 or 1.
The presence of --empty must also be taken into consideration.

9 months agoUpdate: Back port tests for the FSS Read programs with more recent changes.
Kevin Day [Tue, 13 Aug 2024 03:31:21 +0000 (22:31 -0500)]
Update: Back port tests for the FSS Read programs with more recent changes.

The 0.7 development branch commit e68fc313615f0fbcae9f9b6175ffcd15353f593c includes several changes to the tests.

Back port the tests.

The tests will need to be reviewed for problems.
Either the test will be correct or either the 0.6 branch or the 0.7 branch will have to have changes.

9 months agoUpdate: Next micro version (0.6.12).
Kevin Day [Tue, 13 Aug 2024 02:18:56 +0000 (21:18 -0500)]
Update: Next micro version (0.6.12).

The following are the commands that I ran to make this change.
  # find build/ level_? specifications/ documents/ licenses/ -type f -exec sed -i -e 's|0\.6\.11|0.6.12|g' '{}' ';'
  # find build/ level_? specifications/ documents/ licenses/ -type f -exec sed -i -e 's|^version_micro 11|version_micro 12|g' '{}' ';'
  # find level_3/ -name common.h -exec sed -i -e 's|_program_version_micro_s F_string_ascii_1_s F_string_ascii_1_s|_program_version_micro_s F_string_ascii_1_s F_string_ascii_2_s|g' '{}' ';'
  # find level_3/ -name common.h -exec sed -i -e 's|_program_version_micro_s_length (F_string_ascii_1_s_length + F_string_ascii_1_s_length)|_program_version_micro_s_length (F_string_ascii_1_s_length + F_string_ascii_2_s_length)|g' '{}' ';'

9 months agoBugfix: Incorrect runtime tests for FSS Read programs. 0.6.11
Kevin Day [Sun, 11 Aug 2024 21:42:39 +0000 (16:42 -0500)]
Bugfix: Incorrect runtime tests for FSS Read programs.

I mass updated the FSS Read tests in the 0.7 branch.
I chose the quick route of just using the program to generate the tests.
This requires that I trust the results to be correct.
I figured I would eventually go through each one and make sure that they are correct at a later time.
It is a development branch, after all.

However, back porting these tests to the stable 0.6 branch revealed some bugs.
I reviewed the failing tests and files and I confirmed that the 0.6 branch is getting correct results and that the tests are incorrect.
The runtime tests in the 0.7 development branches will have to be updated and the bugs there will have to be fixed.

9 months agoBugfix: Properly back port runtime tests for FSS Read programs.
Kevin Day [Sun, 11 Aug 2024 21:09:16 +0000 (16:09 -0500)]
Bugfix: Properly back port runtime tests for FSS Read programs.

I failed to notice that the program is the `fss_read` program which does not exist in the 0.6 project.
I ended up testing the `fss_read` program installed on the system.
The tests all appeared to pass because of this when in reality the tests were never being run.

For the `fss_embedded_read` test, just disable that one for now.
There are known problems with the 0.6 branch for that.
I will have to address the problems with `fss_embedded_read` in another release.

9 months agoUpdate: Back port runtime tests for FSS Read programs.
Kevin Day [Sat, 10 Aug 2024 05:03:32 +0000 (00:03 -0500)]
Update: Back port runtime tests for FSS Read programs.

This brings in and enables the runtime tests for the different FSS Read programs.

9 months agoSecurity: Missing range checks on comment processing, handling missed spots.
Kevin Day [Sat, 10 Aug 2024 03:17:01 +0000 (22:17 -0500)]
Security: Missing range checks on comment processing, handling missed spots.

I failed to perform all of the changes when I backported commit 27c0bbafc2c0f3ae49c0e45297a2dc9f82c11221 via commit 1898cbbc7e92dfafb1e2fa3538284442e21c3879.

The while loop is being checked for the comments length.
The if condition immediately outside that is not being checked.
This check is being performed in the original commit that I backported from.
This is simply a backporting oversight.

9 months agoRegression: Properly set the start range.
Kevin Day [Sat, 10 Aug 2024 03:15:06 +0000 (22:15 -0500)]
Regression: Properly set the start range.

The optimization commit 2c0f62c1226b55b9fb546963e4751bd9c82a245b neglected to copy the `found->array[found->used].start` assignment.
It also failed to copy the error status check.

10 months agoSecurity: Missing range checks on comment processing.
Kevin Day [Tue, 6 Aug 2024 04:17:59 +0000 (23:17 -0500)]
Security: Missing range checks on comment processing.

This is a back port of the fixes for problem discovered in the 0.7 branch.
The 0.7 program fss_payload_read exposed this issue.
This issue affects multiple programs in the 0.6 branch.

The fss_payload_read such as the runtime test is wrong:
  # fss_payload_read -ocn payload level_3/fss_read/tests/runtime/fss_000e/source/test-0002-mixed.fss -t

The output is 1 but should instead be 4.
  # fss_payload_read -ocn payload level_3/fss_read/tests/runtime/fss_000e/source/test-0002-mixed.fss | wc -l

Investigating this problem revealed that the comment handling code is failing to perform a range check.
The overflow is causing the stop range to point to some random memory address which is almost always larger than the file.
This results in the count being wrong.

This bug is a security concern.
Add the range check in all places where this range check is missing for the comments.

10 months agoUpdate: Apply the not operator logic to avoid needing to literally specify it.
Kevin Day [Tue, 6 Aug 2024 02:18:05 +0000 (21:18 -0500)]
Update: Apply the not operator logic to avoid needing to literally specify it.

10 months agoBugfix: Stand alone controller build doesn't compile due to incorrect _di_f_thread_mu...
Kevin Day [Mon, 5 Aug 2024 01:39:38 +0000 (20:39 -0500)]
Bugfix: Stand alone controller build doesn't compile due to incorrect _di_f_thread_mutex_lock_timed_ config.h setting.

10 months agoUpdate: Greatly reduce memory consumption by implementing simple low allocation step.
Kevin Day [Sun, 4 Aug 2024 06:09:07 +0000 (01:09 -0500)]
Update: Greatly reduce memory consumption by implementing simple low allocation step.

This is the back port of the improvement from the 0.7 development branch.
Adding the macro neither breaks API nor ABI.

Historically the step was always 3.
I found, over time, that increasing the step greatly to something like 128 could greatly reduce memory consumption and performance in many cases.
In the situation where a large number of small objects are allocated then this number like 128 becomes highly abusive.

The simple low allocation step will only allocate a single unit on the very first allocation.
If the next allocation is on an array that has a size greater than one and less than four (via the tiny define), then the step size is set to four during allocation.
If the next allocation is on an array that has a size greater than four and less than eight (via the small define), then the step size is set to eight during allocation.
If the next allocation is on an array that has a size greater than eight and less than sixty-four (via the large define), then the step size is set to sixty-four during allocation.
In all cases, if the request step is less than the calculated step, then the requested step is used.
For example, if the requested step is twelve, then after eight is allocation, then the next generated step size is twelve rather than sixty-four.

Using some test files, shows the following reduction:
- Old: ~8GB of RAM -> New: ~200MB of RAM.
- Old: ~500MB of RAM -> New: ~20MB of RAM.

10 months agoUpdate: Reduce memory usage by fl_fss_basic_content_read() in some circumstances.
Kevin Day [Sun, 4 Aug 2024 06:06:00 +0000 (01:06 -0500)]
Update: Reduce memory usage by fl_fss_basic_content_read() in some circumstances.

The fl_fss_basic_content_read() is simple enough that the allocation of the found array is only needed on success.

10 months agoUpdate: Optimize away the isdigit(), isalpha(), isalnum(), and isxdigit().
Kevin Day [Sun, 4 Aug 2024 00:52:46 +0000 (19:52 -0500)]
Update: Optimize away the isdigit(), isalpha(), isalnum(), and isxdigit().

I did some research and learned that the "is*()" functions can greatly affect performance due to locale and other manners.
I originally used these to allow for well established optimization to take place.

Replace these with some mathematical operations that should increase performance.
This also means no function call on the stack.
This project is already function stack heavy by design and so reducing functions when easy is a great thing.

Start using literal characters rather than the standard strings for the UTF related functions.
In these cases the ASCII expectation is guaranteed.
The ability to override these is also not practical as the meaning should not change.

I have not looked at all of the "is*()" functions and I may address any remaining ones at a later time.
I potentially may also investigate mapping tables to further improve performance.

These math calculations can be used in a lot of the non-ASCII UTF ranges as well.
I opted to not do these just yet given that such work will take a large amount of time.

I have not done any performance analysis yet but I plan to do so.

10 months agoCleanup: Use a pointer to make the code more readable in fake_build_load_setting_proc...
Kevin Day [Thu, 1 Aug 2024 03:06:49 +0000 (22:06 -0500)]
Cleanup: Use a pointer to make the code more readable in fake_build_load_setting_process().

10 months agoBugfix: The build_name and version numbers should not support forward or backward...
Kevin Day [Thu, 1 Aug 2024 02:48:07 +0000 (21:48 -0500)]
Bugfix: The build_name and version numbers should not support forward or backward slashes.

This utilizes the logic from the "stage" setting that strips out invalid slashes.

The standard is updated accordingly to make this behavior more explicit.

10 months agoBugfix: Add stage setting to standards to prevent build state file conflicts.
Kevin Day [Thu, 1 Aug 2024 02:24:23 +0000 (21:24 -0500)]
Bugfix: Add stage setting to standards to prevent build state file conflicts.

The build state stage files are conflicting in some cases.
The old solution to this problem has been observed as insufficient.
The different build settings might have the same exact file name.

I have tossed around the idea of a settings Object such as "stage" in the past but I had previously opted against it.
I now believe that skipping over this was a mistake.

Add a new feature to the standards to fix this bug.
The "stage" value may now be specified.
The fakefile files accept the "stage" setting and passes the result along to any build settings.
The settings files accept the "stage" setting and uses the value by appending it to the stage files.

Only a single value is supported.
The forward and backward slashes are explicitly prohibited.
Other special characters are recommended to be avoided given the possibility of local file system problems.
Rather than erroring out, this slashes are stripped out.

The bootstrap.sh script is updated to support this.
The support for "stage" in the boostrap.sh script is very limited.

10 months agoBugfix: Incorrect length on string CONTROLLER_rule_print_control_groups_prepare_s.
Kevin Day [Fri, 26 Jul 2024 00:02:33 +0000 (19:02 -0500)]
Bugfix: Incorrect length on string CONTROLLER_rule_print_control_groups_prepare_s.

10 months agoUpdate: Yet another file with a copyright year that needs to be updated.
Kevin Day [Thu, 25 Jul 2024 03:10:17 +0000 (22:10 -0500)]
Update: Yet another file with a copyright year that needs to be updated.

I overlooked this one it seems.

10 months agoCleanup: Fix grammar mistake in the standard.
Kevin Day [Sun, 14 Jul 2024 21:07:51 +0000 (16:07 -0500)]
Cleanup: Fix grammar mistake in the standard.

This does not alter the "content" of the standard and only alters the grammar.
The version does not, therefore, have to change.

10 months agoCleanup: Some style clean ups.
Kevin Day [Sun, 14 Jul 2024 04:50:53 +0000 (23:50 -0500)]
Cleanup: Some style clean ups.

I did not seek out anything to clean up.
This just cleans up some code that I happened to be looking at.

10 months agoUpdate: Add additional protection around assignment of global.thread.enabled during...
Kevin Day [Sat, 13 Jul 2024 04:57:20 +0000 (23:57 -0500)]
Update: Add additional protection around assignment of global.thread.enabled during Controller exit process.

Spend some time trying to ensure that the mutex lock can be achieved and then change the enabled state to disabled.
Add a maximum retry as a fail safe but otherwise keep retrying unless certain error conditions are encountered.

10 months agoUpdate: Use copy of flag to avoid possible race conditions with controller_thread_is_...
Kevin Day [Sat, 13 Jul 2024 04:28:38 +0000 (23:28 -0500)]
Update: Use copy of flag to avoid possible race conditions with controller_thread_is_enabled().

The thread.enabled is checked multiple times in controller_thread_is_enabled() but this value may have changed.
Make a constant copy and reference that copy so that any changes after the first read will not affect the function results.

10 months agoBugfix: Double creation of mutex alert lock.
Kevin Day [Sat, 13 Jul 2024 03:48:37 +0000 (22:48 -0500)]
Bugfix: Double creation of mutex alert lock.

The lock.alert mutex lock must not be created twice.

10 months agoBugfix: Controller parameter type is f_number_unsigned_t and not uint8_t.
Kevin Day [Sat, 13 Jul 2024 03:08:12 +0000 (22:08 -0500)]
Bugfix: Controller parameter type is f_number_unsigned_t and not uint8_t.

The array of codes is an array of f_number_unsigned_t and not uint8_t.

I was probably thinking about the array only needs to be of type uint8_t long, which would be represented by the counter.
I probably then accidentally set the value type to be uint8_t to match that.

10 months agoBugfix: Controller is adding an extra '/' to the file name.
Kevin Day [Fri, 12 Jul 2024 03:55:51 +0000 (22:55 -0500)]
Bugfix: Controller is adding an extra '/' to the file name.

This does not cause a problem unless the local filesystem is very picky about extra slashes.

The error printing revealed the problem as descibed in the examples below.

Example Incorrect Error Message:
  ERROR: Unable to open file './/entries/utility.entry', could not find.

Example Correct Error Message:
  ERROR: Unable to open file './entries/utility.entry', could not find.

10 months agoBugfix: Incorrect thread unlock in controller_rule_process().
Kevin Day [Fri, 12 Jul 2024 03:33:15 +0000 (22:33 -0500)]
Bugfix: Incorrect thread unlock in controller_rule_process().

When the lock is grabbed but a failure occurs an if condition handles that case.
After that block is a second block that then attempts to unlock that same lock.
Given that the lock failed, this lock cannot be in a locked state.

10 months agoCleanup: Execute process child id structure.
Kevin Day [Thu, 11 Jul 2024 05:21:10 +0000 (00:21 -0500)]
Cleanup: Execute process child id structure.

Make the variable "child" more verbose in its name to make it clear that it is coming from the process.
This makes it more clear why there is a write lock obtained to change this.

Perform other minor structural changes.

10 months agoBugfix: Improve Controller error message regarding "file not found..., found".
Kevin Day [Thu, 11 Jul 2024 02:40:57 +0000 (21:40 -0500)]
Bugfix: Improve Controller error message regarding "file not found..., found".

The error message essentially says file not found because file was found.
This is crazy confusing.

Fix the error message to say something more like unable to create the file because an existing file is found.

10 months agoUpdate: Provide fallback should the locks on exit fail to catch and update function...
Kevin Day [Wed, 10 Jul 2024 02:30:32 +0000 (21:30 -0500)]
Update: Provide fallback should the locks on exit fail to catch and update function using pointer.

The previous commit 49a3d41d1c17734b0a8299b356f1e299386f4a42 removed the forced fallback to avoid potential race conditions.
The reason for having that fallback is to ensure that the exit process is guaranteed and not potentially blocked by a lock.

Provide an alternative that makes several attempts to properly lock on exit.
Only when those extra attempts fails should the failsafe/fallback be used.

Update controller_thread_process_cancel() to have the global data as a pointer.

10 months agoBugfix: Don't assign enabled variable on lock failure to avoid potential race conditi...
Kevin Day [Tue, 9 Jul 2024 03:57:46 +0000 (22:57 -0500)]
Bugfix: Don't assign enabled variable on lock failure to avoid potential race condition in the Controller program.

11 months agoBugfix: Controller error printing function has wrong locking.
Kevin Day [Mon, 8 Jul 2024 03:00:09 +0000 (22:00 -0500)]
Bugfix: Controller error printing function has wrong locking.

The locking being used in controller_rule_item_print_error() is based on the special case for when fll_error_print() is used.
The fll_error_print() is not being used so do not use the special case locking.

11 months agoSecurity: Remove simulate feature that actually executes a script.
Kevin Day [Mon, 8 Jul 2024 00:12:48 +0000 (19:12 -0500)]
Security: Remove simulate feature that actually executes a script.

The simulate is setup to actually execute scripts via a fake script execution.
This is not intended to do anything other than to catch problems in the script setup.

I have come to the realization that a malicious actor could setup a custom scripting engine to be executed on simulation.

An oblivious user could then be performing a simulation with the expectation that nothing actually happens while the malicious scripting engine performs some nefarious activity.

Strip out the fake script execution to prevent this behavior.

This is a loss of some functionality but I prefer the safety over this potential bad behavior.

11 months agoRevert: Rewrite timing logic in controller, and use different logic.
Kevin Day [Sun, 7 Jul 2024 21:08:48 +0000 (16:08 -0500)]
Revert: Rewrite timing logic in controller, and use different logic.

This reverts commit 9b21b888e52d9a7268c231bc0d520ec0be9bfcb8.

This is not actually needed because a 32-bit long should not overflow with just 1000000000.
The logic I replaced it with was sloppy anyway and left out some cases.

The long representing nanoseconds can store greater than 999999999.
Make sure that is handled before adding to the tv_nsec.

11 months agoUpdate: Rewrite timing logic in controller.
Kevin Day [Sun, 7 Jul 2024 04:35:59 +0000 (23:35 -0500)]
Update: Rewrite timing logic in controller.

Check if both numbers added together are greater than or equal to half a second.
If they are, then an overflow will happen.
Subtract the half seconds instead of handling an overflow.

This does not handle the case where the milliseconds or nanoseconds are greater than one second.
This only handles the cases where they are greater than half a second.

11 months agoBugfix: Replace f_signal_mask() with f_thread_signal_mask().
Kevin Day [Sun, 7 Jul 2024 04:33:33 +0000 (23:33 -0500)]
Bugfix: Replace f_signal_mask() with f_thread_signal_mask().

The f_thread_signal_mask() is being used to setup the signals.
If that fails, the unmask process is incorrectly using f_signal_mask() when instead f_thread_signal_mask() should be used.