-
Notifications
You must be signed in to change notification settings - Fork 41
remove timestamp from generated files #350
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
Conversation
+1 from me for this PR as well. (not a maintainer either but an interested party like Colin). |
Hi, so I finally have some time to put into authselect. Thank you for the contribution. Do I understand it correctly that there are two distinct solutions and that we merge only one? That is:
|
@pbrezina exactly, and I'd say that this PR here is the preferred solution. :) |
Yes, I agree. I don't think there is any particular reason to keep the timestamp in the preamble. I would just like to keep |
Also is Fedora rawhide enough or do you want to deliver this also to F39 or older? |
F39 would be nice |
Done. |
F38 would be great. |
Please, apply this diff and we can merge: diff --git a/src/lib/util/template.c b/src/lib/util/template.c
index 98d762e..f211d86 100644
--- a/src/lib/util/template.c
+++ b/src/lib/util/template.c
@@ -555,7 +555,8 @@ template_generate_preamble()
"# Do not modify this file manually, use authselect instead. Any user changes will be overwritten.\n"
"# You can stop authselect from managing your configuration by calling 'authselect opt-out'.\n"
"# See authselect(8) for more details.\n\n";
- return preamble;
+
+ return strdup(preamble);
}
errno_t
@@ -668,15 +669,18 @@ template_write(const char *filepath,
const char *content,
mode_t mode)
{
- const char *preamble = template_generate_preamble();
+ char *preamble;
char *output;
errno_t ret;
+ preamble = template_generate_preamble();
if (content == NULL) {
- output = strdup(preamble);
+ output = preamble;
} else {
output = format("%s%s", preamble, content);
+ free(preamble);
}
+
if (output == NULL) {
return ENOMEM;
} Also the commit message should look like this:
Thank you. |
This enables reproducible OS builds. Resolves: #319 Co-authored-by: Malte Poll <[email protected]> Signed-off-by: Paul Meyer <[email protected]>
Thank you. |
This enables reproducible OS builds.
Fixes #319
This is an alternative approach to #348, based on the suggestion by @cgwalters