Adds a pair of files which cause a segfault (also with
systemd-analyze verify).
https://bugzilla.redhat.com/show_bug.cgi?id=
1124843
}
u->dropin_paths = unit_find_dropin_paths(u);
}
u->dropin_paths = unit_find_dropin_paths(u);
return 0;
STRV_FOREACH(f, u->dropin_paths) {
return 0;
STRV_FOREACH(f, u->dropin_paths) {
UnitDependency k;
for (k = 0; k < _UNIT_DEPENDENCY_MAX; k++) {
UnitDependency k;
for (k = 0; k < _UNIT_DEPENDENCY_MAX; k++) {
- r = set_remove_and_put(back->dependencies[k], other, u);
- if (r == -EEXIST)
+ /* Do not add dependencies between u and itself */
+ if (back == u) {
set_remove(back->dependencies[k], other);
set_remove(back->dependencies[k], other);
- else
- assert(r >= 0 || r == -ENOENT);
+ } else {
+ r = set_remove_and_put(back->dependencies[k], other, u);
+ if (r == -EEXIST)
+ set_remove(back->dependencies[k], other);
+ else
+ assert(r >= 0 || r == -ENOENT);
+ }
+ /* Also do not move dependencies on u to itself */
+ set_remove(other->dependencies[d], u);
+
complete_move(&u->dependencies[d], &other->dependencies[d]);
set_free(other->dependencies[d]);
complete_move(&u->dependencies[d], &other->dependencies[d]);
set_free(other->dependencies[d]);
--- /dev/null
+[Service]
+ExecStart=/bin/true
--- /dev/null
+[Unit]
+BindsTo=loopy2.service
+
+[Install]
+Also=loopy2.service
--- /dev/null
+loopy.service
\ No newline at end of file