summaryrefslogtreecommitdiff
path: root/etc/ksh.kshrc
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2018-02-18 21:48:01 +0000
committerkn <kn@cvs.openbsd.org>2018-02-18 21:48:01 +0000
commit412ef70387017de4c7a42f7610c2a7eb14539a0f (patch)
treede1b4f82635ee5d2300f4c2e92eed1e026318bd4 /etc/ksh.kshrc
parentf43d01fe676a95149508d28888e85fe8f41f803d (diff)
zap *_path() functions
These PATH helpers failed to quote their input properly leading to shell code execution. Noone noticed since import (over 21 years ago), so wipe it. OK tb rpe
Diffstat (limited to 'etc/ksh.kshrc')
-rw-r--r--etc/ksh.kshrc25
1 files changed, 1 insertions, 24 deletions
diff --git a/etc/ksh.kshrc b/etc/ksh.kshrc
index 5b5bd040f79..5230b8ffd8b 100644
--- a/etc/ksh.kshrc
+++ b/etc/ksh.kshrc
@@ -1,4 +1,4 @@
-# $OpenBSD: ksh.kshrc,v 1.30 2017/11/05 10:58:39 rpe Exp $
+# $OpenBSD: ksh.kshrc,v 1.31 2018/02/18 21:48:00 kn Exp $
#
# NAME:
# ksh.kshrc - global initialization for ksh
@@ -119,26 +119,3 @@ case "$-" in
*) # non-interactive
;;
esac
-# commands for both interactive and non-interactive shells
-
-# is $1 missing from $2 (or PATH) ?
-function no_path {
- eval _v="\$${2:-PATH}"
- case :$_v: in
- *:$1:*) return 1;; # no we have it
- esac
- return 0
-}
-# if $1 exists and is not in path, append it
-function add_path {
- [[ -d ${1:-.} ]] && no_path $* && eval ${2:-PATH}="\$${2:-PATH}:$1"
-}
-# if $1 exists and is not in path, prepend it
-function pre_path {
- [[ -d ${1:-.} ]] && no_path $* && eval ${2:-PATH}="$1:\$${2:-PATH}"
-}
-# if $1 is in path, remove it
-function del_path {
- no_path $* || eval ${2:-PATH}=$(eval echo :'$'${2:-PATH}: |
- sed -e "s;:$1:;:;g" -e "s;^:;;" -e "s;:\$;;")
-}