Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config: Add BARE constants and some bugfixes #463

Merged
merged 4 commits into from
Oct 6, 2021

Conversation

juergenchrist
Copy link
Contributor

The inital configlib commit did not include the possibility to use bare word
constants.  This is needed, e.g., for the "disable-event-support" keyword of
opencryptoki.conf.

To support this, add ConfigNodeBareConst to keep the constant in the key
without any further values in the node.  Also restructure the grammar:
- Every configelem now takes care of the positions of comments _within_ and
_after_ the element.
- Since "after element i" is "before element (i+1)", the config element cannot
take care of comments before the element (shift/reduce conflict since the
parser cannot know if the comment is after element i or before element i+1).
To alleviate this situation and preserve comments at the beginning of a file
or a structure content, add a commentedconfigelemstar that only takes care of
comments before the first configelem.  That should cover all comment
positions.

Fix incorrect version masks in dump of ConfigVersionValNode.

confignode_deepfree did not free elements in BARELISTs causing memory leaks.

BUILT_SOURCES should not contain the generated headers.  They are generated
and updated via ylwrap which does a content comparison for all but the
generated parser/lexer C sources.  If the inputs to bison or flex change but
still produce the same header file, make install will regenerate the parser
and lexer, recompile them, and relink all binaries that use the config lib.
By using the generated C files in the BUILT_SOURCES variable we solve this
problem since the C files are always updated by ylwrap (even if they did not
change).

The inital configlib commit did not include the possibility to use bare word
constants.  This is needed, e.g., for the "disable-event-support" keyword of
opencryptoki.conf.

To support this, add ConfigNodeBareConst to keep the constant in the key
without any further values in the node.  Also restructure the grammar:
- Every configelem now takes care of the positions of comments _within_ and
_after_ the element.
- Since "after element i" is "before element (i+1)", the config element cannot
take care of comments before the element (shift/reduce conflict since the
parser cannot know if the comment is after element i or before element i+1).
To alleviate this situation and preserve comments at the beginning of a file
or a structure content, add a commentedconfigelemstar that only takes care of
comments before the first configelem.  That should cover all comment
positions.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Fix incorrect version masks in dump of ConfigVersionValNode.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
confignode_deepfree did not free elements in BARELISTs causing memory leaks.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
BUILT_SOURCES should not contain the generated headers.  They are generated
and updated via ylwrap which does a content comparison for all but the
generated parser/lexer C sources.  If the inputs to bison or flex change but
still produce the same header file, make install will regenerate the parser
and lexer, recompile them, and relink all binaries that use the config lib.
By using the generated C files in the BUILT_SOURCES variable we solve this
problem since the C files are always updated by ylwrap (even if they did not
change).

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Copy link
Contributor

@ifranzki ifranzki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@p-steuer p-steuer merged commit fbf819d into opencryptoki:master Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants