From 48f5309e0d2792cad815a4b4103b3e2ef8a7f384 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Thu, 3 Sep 2020 12:35:46 +0800 Subject: [PATCH 1/2] remove system-files interface. --- snap/snapcraft.yaml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 7a0e1c3b80..3f5b5f1de0 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -18,14 +18,12 @@ apps: - network - network-bind - system-observe - - systemfiles taos: command: taoswrapper.sh plugs: - network - system-observe - - systemfiles - historyfile taosdemo: @@ -41,18 +39,6 @@ plugs: write: - $HOME/.taos_history - systemfiles: - interface: system-files - read: - - /etc/taos - - /var/lib/taos - - /var/log/taos - - /tmp - write: - - /var/log/taos - - /var/lib/taos - - /tmp - parts: script: plugin: dump @@ -119,4 +105,4 @@ layout: hooks: install: - plugs: [systemfiles, historyfile] + plugs: [historyfile] From f21200d9f13a79a2ffaa5b0a7ab324f8039d5e9c Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Fri, 4 Sep 2020 14:35:14 +0800 Subject: [PATCH 2/2] remove personalfiles interface. --- snap/snapcraft.yaml | 14 -------------- src/kit/shell/src/shellLinux.c | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 3f5b5f1de0..0ac0764217 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -24,21 +24,12 @@ apps: plugs: - network - system-observe - - historyfile taosdemo: command: usr/bin/taosdemo plugs: - network -plugs: - historyfile: - interface: personal-files - read: - - $HOME/.taos_history - write: - - $HOME/.taos_history - parts: script: plugin: dump @@ -101,8 +92,3 @@ layout: bind: $SNAP_DATA/var/log/taos /etc/taos: bind: $SNAP_DATA/etc/taos - - -hooks: - install: - plugs: [historyfile] diff --git a/src/kit/shell/src/shellLinux.c b/src/kit/shell/src/shellLinux.c index 6c09d5c9d0..69bab44985 100644 --- a/src/kit/shell/src/shellLinux.c +++ b/src/kit/shell/src/shellLinux.c @@ -409,7 +409,7 @@ void set_terminal_mode() { } } -void get_history_path(char *history) { sprintf(history, "%s/%s", getpwuid(getuid())->pw_dir, HISTORY_FILE); } +void get_history_path(char *history) { sprintf(history, "%s/%s", getenv("HOME"), HISTORY_FILE); } void clearScreen(int ecmd_pos, int cursor_pos) { struct winsize w;