remove path from collected data

PATH is fairy sensitive information and it doesn't represent command context
pull/15/head
Simon Let 7 years ago
parent fee9700de0
commit 848d50011b
  1. 2
      .gitignore
  2. 26
      collect/resh-collect.go
  3. 14
      common/resh-common.go
  4. 4
      shellrc.sh
  5. 2
      version

2
.gitignore vendored

@ -0,0 +1,2 @@
resh-collect
resh-daemon

@ -5,12 +5,14 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/BurntSushi/toml"
common "github.com/curusarn/resh/common"
"io/ioutil"
"log"
"net/http"
"os"
"github.com/BurntSushi/toml"
common "github.com/curusarn/resh/common"
// "os/exec"
"os/user"
"path/filepath"
@ -52,7 +54,7 @@ func main() {
lang := flag.String("lang", "", "$LANG")
lcAll := flag.String("lcAll", "", "$LC_ALL")
login := flag.String("login", "", "$LOGIN")
path := flag.String("path", "", "$PATH")
// path := flag.String("path", "", "$PATH")
pwd := flag.String("pwd", "", "$PWD - present working directory")
pwdAfter := flag.String("pwdAfter", "", "$PWD after command")
shellEnv := flag.String("shellEnv", "", "$SHELL")
@ -102,18 +104,18 @@ func main() {
os.Exit(0)
}
if *requireVersion != "" && *requireVersion != Version {
fmt.Println("Please restart/reload this terminal session " +
fmt.Println("Please restart/reload this terminal session " +
"(resh version: " + Version +
" resh version of this terminal session: " + *requireVersion +
")")
os.Exit(3)
os.Exit(3)
}
if *requireRevision != "" && *requireRevision != Revision {
fmt.Println("Please restart/reload this terminal session " +
fmt.Println("Please restart/reload this terminal session " +
"(resh revision: " + Revision +
" resh revision of this terminal session: " + *requireRevision +
")")
os.Exit(3)
os.Exit(3)
}
realtimeAfter, err := strconv.ParseFloat(*rta, 64)
if err != nil {
@ -178,11 +180,11 @@ func main() {
Cols: *cols,
Lines: *lines,
Home: *home,
Lang: *lang,
LcAll: *lcAll,
Login: *login,
Path: *path,
Home: *home,
Lang: *lang,
LcAll: *lcAll,
Login: *login,
// Path: *path,
Pwd: *pwd,
PwdAfter: *pwdAfter,
ShellEnv: *shellEnv,

@ -9,13 +9,13 @@ type Record struct {
SessionId string `json:"sessionId"`
// posix
Cols string `json:"cols"`
Lines string `json:"lines"`
Home string `json:"home"`
Lang string `json:"lang"`
LcAll string `json:"lcAll"`
Login string `json:"login"`
Path string `json:"path"`
Cols string `json:"cols"`
Lines string `json:"lines"`
Home string `json:"home"`
Lang string `json:"lang"`
LcAll string `json:"lcAll"`
Login string `json:"login"`
//Path string `json:"path"`
Pwd string `json:"pwd"`
PwdAfter string `json:"pwdAfter"`
ShellEnv string `json:"shellEnv"`

@ -112,7 +112,7 @@ __resh_preexec() {
__RESH_LC_ALL="$LC_ALL"
# other LC ?
__RESH_LINES="$LINES"
__RESH_PATH="$PATH"
# __RESH_PATH="$PATH"
__RESH_PWD="$PWD"
# non-posix
@ -165,7 +165,6 @@ __resh_precmd() {
-lcAll "$__RESH_LC_ALL" \
-lines "$__RESH_LINES" \
-login "$__RESH_LOGIN" \
-path "$__RESH_PATH" \
-pwd "$__RESH_PWD" \
-pwdAfter "$__RESH_PWD_AFTER" \
-shellEnv "$__RESH_SHELL_ENV" \
@ -193,6 +192,7 @@ __resh_precmd() {
-osReleaseName "$__RESH_OS_RELEASE_NAME" \
-osReleasePrettyName "$__RESH_OS_RELEASE_PRETTY_NAME" \
&>~/.resh/client_last_run_out.txt || echo "resh ERROR: $(head -n 1 ~/.resh/client_last_run_out.txt)"
# -path "$__RESH_PATH" \
fi
unset __RESH_COLLECT
}

@ -1 +1 @@
1.0.0
1.1.0

Loading…
Cancel
Save