chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6c666e2
)
service: refuse to parse sysv scripts that are requested with a boot. prefix or ...
author
Lennart Poettering
<lennart@poettering.net>
Wed, 19 May 2010 19:52:30 +0000
(21:52 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 19 May 2010 19:52:30 +0000
(21:52 +0200)
src/service.c
patch
|
blob
|
history
diff --git
a/src/service.c
b/src/service.c
index 0615b51490a4235b716839ed24cce8c02745c1e2..2fcb304e86d7bffbcfae02627e6f5a842687d19b 100644
(file)
--- a/
src/service.c
+++ b/
src/service.c
@@
-654,6
+654,12
@@
static int service_load_sysv_name(Service *s, const char *name) {
assert(s);
assert(name);
assert(s);
assert(name);
+ /* For SysV services we strip the boot. or .sh
+ * prefixes/suffixes. */
+ if (startswith(name, "boot.") ||
+ endswith(name, ".sh.service"))
+ return -ENOENT;
+
STRV_FOREACH(p, UNIT(s)->meta.manager->sysvinit_path) {
char *path;
int r;
STRV_FOREACH(p, UNIT(s)->meta.manager->sysvinit_path) {
char *path;
int r;
@@
-667,7
+673,7
@@
static int service_load_sysv_name(Service *s, const char *name) {
r = service_load_sysv_path(s, path);
if (r >= 0 && UNIT(s)->meta.load_state == UNIT_STUB) {
r = service_load_sysv_path(s, path);
if (r >= 0 && UNIT(s)->meta.load_state == UNIT_STUB) {
- /* Try Debian style .sh source'able init scripts */
+ /* Try Debian style
xxx
.sh source'able init scripts */
strcat(path, ".sh");
r = service_load_sysv_path(s, path);
}
strcat(path, ".sh");
r = service_load_sysv_path(s, path);
}
@@
-675,7
+681,7
@@
static int service_load_sysv_name(Service *s, const char *name) {
free(path);
if (r >= 0 && UNIT(s)->meta.load_state == UNIT_STUB) {
free(path);
if (r >= 0 && UNIT(s)->meta.load_state == UNIT_STUB) {
- /* Try Suse style boot.xxx
x
init scripts */
+ /* Try Suse style boot.xxx init scripts */
if (asprintf(&path, "%s/boot.%s", *p, name) < 0)
return -ENOMEM;
if (asprintf(&path, "%s/boot.%s", *p, name) < 0)
return -ENOMEM;