sysusers: make sp_lstchg shadow field reproducible

If the environment variable SOURCE_DATE_EPOCH is set, use its value
instead of the current time.
This commit is contained in:
Johannes Schauer Marin Rodrigues
2022-09-02 07:17:25 +02:00
committed by Lennart Poettering
parent dddec402de
commit 3fa8a1148a
4 changed files with 38 additions and 1 deletions
+12
View File
@@ -776,6 +776,18 @@ int getenv_bool_secure(const char *p) {
return parse_boolean(e);
}
int getenv_uint64_secure(const char *p, uint64_t *ret) {
const char *e;
assert(p);
e = secure_getenv(p);
if (!e)
return -ENXIO;
return safe_atou64(e, ret);
}
int set_unset_env(const char *name, const char *value, bool overwrite) {
assert(name);
+2
View File
@@ -57,6 +57,8 @@ char *strv_env_pairs_get(char **l, const char *name) _pure_;
int getenv_bool(const char *p);
int getenv_bool_secure(const char *p);
int getenv_uint64_secure(const char *p, uint64_t *ret);
/* Like setenv, but calls unsetenv if value == NULL. */
int set_unset_env(const char *name, const char *value, bool overwrite);