aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--lib/envop.c39
-rw-r--r--lib/envop.h1
-rw-r--r--src/comp.c9
4 files changed, 49 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index e131bf2..003b0da 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU Pies NEWS -- history of user-visible changes. 2021-05-09
+GNU Pies NEWS -- history of user-visible changes. 2021-06-03
See the end of file for copying conditions.
Please send Pies bug reports to <bug-pies@gnu.org> or
@@ -21,6 +21,8 @@ client program piesctl.
As stated in the documentation, program-specific configuration
file piesctl.conf takes precedence over pies.conf.
+* Fix reloading of the configuration files.
+
Version 1.5, 2020-12-14
diff --git a/lib/envop.c b/lib/envop.c
index c685ee2..75d0891 100644
--- a/lib/envop.c
+++ b/lib/envop.c
@@ -71,6 +71,7 @@ environ_free (environ_t *env)
for (i = 0; i < env->env_count; i++)
free (env->env_base[i]);
free (env->env_base);
+ free (env);
}
static ssize_t
@@ -502,4 +503,40 @@ envop_free (struct envop_entry *op)
op = next;
}
}
-
+
+int
+envop_cmp (struct envop_entry *a, struct envop_entry *b)
+{
+ while (a)
+ {
+ if (!b)
+ return 1;
+ if (a->code != b->code)
+ return 1;
+ switch (a->code)
+ {
+ case envop_clear:
+ break;
+
+ case envop_keep:
+ case envop_set:
+ case envop_unset:
+ if (strcmp (a->name, b->name))
+ return 1;
+
+ if (!a->value)
+ {
+ if (b->value)
+ return 1;
+ }
+ else if (!b->value || strcmp (a->value, b->value))
+ return 1;
+ break;
+ }
+ a = a->next;
+ b = b->next;
+ }
+ if (b)
+ return 1;
+ return 0;
+}
diff --git a/lib/envop.h b/lib/envop.h
index 6587b1a..2b4aad6 100644
--- a/lib/envop.h
+++ b/lib/envop.h
@@ -63,6 +63,7 @@ int envop_entry_add (envop_t **head,
int envop_exec (envop_t *op, environ_t *env);
void envop_free (envop_t *op);
+int envop_cmp (struct envop_entry *a, struct envop_entry *b);
diff --git a/src/comp.c b/src/comp.c
index 91663e4..1e75f6d 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -218,8 +218,10 @@ argvcmp (char **a, char **b)
{
size_t i;
- if (!a != !b)
- return 1;
+ if (!a)
+ return !!b;
+ else if (!b)
+ return !!a;
for (i = 0; a[i]; i++)
if (!b[i] || strcmp (b[i], a[i]))
@@ -271,8 +273,10 @@ component_match (struct component *comp, struct component *ref)
EQ (mode);
FN (tag, safe_strcmp);
FN (program, safe_strcmp);
+ FN (command, safe_strcmp);
EQ (argc);
FN (argv, argvcmp);
+ FN (envop, envop_cmp);
FN (dir, safe_strcmp);
FN (prereq, grecs_list_compare);
FN (depend, grecs_list_compare);
@@ -280,6 +284,7 @@ component_match (struct component *comp, struct component *ref)
EQ (max_instances);
FN (rmfile, safe_strcmp);
FNP (privs, pies_privs_cmp);
+ EQ (umask);
FN (limits, limits_cmp);
FN (runlevels, safe_strcmp);
EQ (max_rate);

Return to:

Send suggestions and report system problems to the System administrator.