summaryrefslogtreecommitdiff
path: root/plugins/server/command.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/server/command.go')
-rw-r--r--plugins/server/command.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/plugins/server/command.go b/plugins/server/command.go
deleted file mode 100644
index b8bc1395..00000000
--- a/plugins/server/command.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package server
-
-import (
- "os"
- "regexp"
-
- "github.com/spiral/errors"
-)
-
-// pattern for the path finding
-const pattern string = `^\/*([A-z/.:-]+\.(php|sh|ph))$`
-
-func (server *Plugin) scanCommand(cmd []string) error {
- const op = errors.Op("server_command_scan")
- r, err := regexp.Compile(pattern)
- if err != nil {
- return err
- }
-
- for i := 0; i < len(cmd); i++ {
- if r.MatchString(cmd[i]) {
- // try to stat
- _, err := os.Stat(cmd[i])
- if err != nil {
- return errors.E(op, errors.FileNotFound, err)
- }
-
- // stat successful
- return nil
- }
- }
- return errors.E(errors.Str("scan failed, possible path not found, this is not an error"), op)
-}