From 35774fec8b06c7950c1d4c595257d107808561a9 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 11 Dec 2020 14:13:15 +0100 Subject: [PATCH] small defensive code additions --- ocis/pkg/runtime/runtime.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ocis/pkg/runtime/runtime.go b/ocis/pkg/runtime/runtime.go index bea1d99735..24eb752b45 100644 --- a/ocis/pkg/runtime/runtime.go +++ b/ocis/pkg/runtime/runtime.go @@ -34,8 +34,6 @@ var ( // Extensions are ocis extension services Extensions = []string{ "glauth", - "graph", - "graph-explorer", "konnectd", "ocs", "onlyoffice", @@ -54,6 +52,8 @@ var ( "storage-public-link", "thumbnails", "webdav", + //"graph", + //"graph-explorer", } // There seem to be a race condition when reva-sharing needs to read the sharing.json file and the parent folder is not present. @@ -129,6 +129,11 @@ OUT: func RunService(client *rpc.Client, service string) int { args := process.NewProcEntry(service, os.Environ(), []string{service}...) + all := append(Extensions, append(dependants, MicroServices...)...) + if !contains(all, service) { + return 1 + } + var reply int if err := client.Call("Service.Start", args, &reply); err != nil { golog.Fatal(err) @@ -159,3 +164,12 @@ func setDefaults() { // registry registry.Name = OwncloudNamespace + "registry" } + +func contains(a []string, b string) bool { + for i := range a { + if a[i] == b { + return true + } + } + return false +}