summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2016-03-04 20:35:11 +0200
committerHans Rosenfeld <hans.rosenfeld@nexenta.com>2016-12-02 15:53:39 +0100
commit719d176126cc1c689a469d4c3553d770d1c4e94e (patch)
treeeb2cb81c2b60ce075a891980cfd1e8f355a1b4ed
parent9c31cf024c08128fce3fce725716f43a0286b787 (diff)
downloadillumos-joyent-719d176126cc1c689a469d4c3553d770d1c4e94e.tar.gz
6723 etc/skel needs cleanup
2931 PS1 prompt in default user .profile is incorrect Reviewed by: Andrew Stormont <andyjstormont@gmail.com> Reviewed by: Lauri Tirkkonen <lotheac@iki.fi> Reviewed by: Gordon Ross <Gordon.W.Ross@gmail.com> Reviewed by: Adam Števko <adam.stevko@gmail.com> Reviewed by: Alexander Pyhalov <apyhalov@gmail.com> Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-rw-r--r--usr/src/cmd/login/login.dfl9
-rw-r--r--usr/src/cmd/nsadmin/Makefile10
-rw-r--r--usr/src/cmd/nsadmin/bashrc.sh4
-rw-r--r--usr/src/cmd/nsadmin/dot-kshrc.sh11
-rw-r--r--usr/src/cmd/nsadmin/dot-profile.sh18
-rw-r--r--usr/src/cmd/nsadmin/etc-profile.sh22
-rw-r--r--usr/src/cmd/nsadmin/local.cshrc29
-rw-r--r--usr/src/cmd/nsadmin/local.login27
-rw-r--r--usr/src/cmd/nsadmin/local.profile28
-rw-r--r--usr/src/pkg/manifests/SUNWcs.mf4
10 files changed, 52 insertions, 110 deletions
diff --git a/usr/src/cmd/login/login.dfl b/usr/src/cmd/login/login.dfl
index 4b11830230..13ecd51113 100644
--- a/usr/src/cmd/login/login.dfl
+++ b/usr/src/cmd/login/login.dfl
@@ -47,12 +47,15 @@ PASSREQ=YES
ALTSHELL=YES
# PATH sets the initial shell PATH variable
-#
-#PATH=/usr/bin:
+# sample with GNU tools in front of the path
+# PATH=/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin
+# sample with XPG4 tools in front of the path
+# PATH=/usr/xpg4/bin:/usr/bin:/usr/sbin:/sbin
+PATH=/usr/bin:/usr/sbin:/sbin:/usr/gnu/bin
# SUPATH sets the initial shell PATH variable for root
#
-#SUPATH=/usr/sbin:/usr/bin
+SUPATH=/usr/sbin:/sbin:/usr/bin
# TIMEOUT sets the number of seconds (between 0 and 900) to wait before
# abandoning a login session.
diff --git a/usr/src/cmd/nsadmin/Makefile b/usr/src/cmd/nsadmin/Makefile
index 620aa978e4..c87810e767 100644
--- a/usr/src/cmd/nsadmin/Makefile
+++ b/usr/src/cmd/nsadmin/Makefile
@@ -24,7 +24,7 @@
#
PROG= profile .login ksh.kshrc system
-PROGSKEL= local.login local.profile local.cshrc .profile
+PROGSKEL= .profile .kshrc
PROGROOT= .profile .bashrc
include ../Makefile.cmd
@@ -35,10 +35,10 @@ ROOTETCSKELPROG= $(PROGSKEL:%=$(ROOTETCSKEL)/%)
ROOTROOTPROG= $(PROGROOT:%=$(ROOTROOT)/%)
FILEMODE= 0644
-CLOBBERFILES = profile .bashrc .profile .login
+CLOBBERFILES = profile .bashrc .profile .login .kshrc
.login: login.csh
- $(RM) .login;
+ $(RM) .login
$(CP) login.csh .login
profile: etc-profile.sh
@@ -49,6 +49,10 @@ profile: etc-profile.sh
$(RM) .profile
$(CP) dot-profile.sh $@
+.kshrc: dot-kshrc.sh
+ $(RM) .kshrc
+ $(CP) dot-kshrc.sh $@
+
.bashrc: bashrc.sh
$(RM) .bashrc
$(CP) bashrc.sh $@
diff --git a/usr/src/cmd/nsadmin/bashrc.sh b/usr/src/cmd/nsadmin/bashrc.sh
index 128f6b79d7..938b0da67e 100644
--- a/usr/src/cmd/nsadmin/bashrc.sh
+++ b/usr/src/cmd/nsadmin/bashrc.sh
@@ -2,6 +2,4 @@
# Define default prompt to <username>@<hostname>:<path><"($|#) ">
# and print '#' for user "root" and '$' for normal users.
#
-PS1='${LOGNAME}@$(/usr/bin/hostname):$(
- [[ "${LOGNAME}" == "root" ]] && printf "%s" "${PWD/${HOME}/~}# " ||
- printf "%s" "${PWD/${HOME}/~}\$ ")'
+typeset +x PS1="\u@\h:\w\\$ "
diff --git a/usr/src/cmd/nsadmin/dot-kshrc.sh b/usr/src/cmd/nsadmin/dot-kshrc.sh
new file mode 100644
index 0000000000..0ba420ac58
--- /dev/null
+++ b/usr/src/cmd/nsadmin/dot-kshrc.sh
@@ -0,0 +1,11 @@
+#
+# Sample kshrc. Used by ksh for interactive invocations, processed after
+# /etc/ksh.kshrc
+#
+
+# alias h='fc -l | more' # View history nicely
+# alias logout=exit # Another way to exit
+# alias rm='rm -i' # Confirm file removal
+# alias del='rm -i' # Confirm file removal
+# alias lsf='ls -CF' # List files in nice format
+# alias ll='ls -l' # List files in long format
diff --git a/usr/src/cmd/nsadmin/dot-profile.sh b/usr/src/cmd/nsadmin/dot-profile.sh
index 33a79c97b2..a45e47b58d 100644
--- a/usr/src/cmd/nsadmin/dot-profile.sh
+++ b/usr/src/cmd/nsadmin/dot-profile.sh
@@ -1,16 +1,14 @@
#
-# Simple profile places /usr/gnu/bin at front,
-# adds /usr/X11/bin, /usr/sbin and /sbin to the end.
+# Uncommenting PATH below will place /usr/gnu/bin at front,
+# adds /usr/sbin and /sbin to the end.
#
-# Use less(1) as the default pager for the man(1) command.
-#
-export PATH=/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin
-export PAGER="/usr/bin/less -ins"
-
+# export PATH=/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin
#
# Define default prompt to <username>@<hostname>:<path><"($|#) ">
# and print '#' for user "root" and '$' for normal users.
#
-PS1='${LOGNAME}@$(/usr/bin/hostname):$(
- [[ "${LOGNAME}" == "root" ]] && printf "%s" "${PWD/${HOME}/~}# " ||
- printf "%s" "${PWD/${HOME}/~}\$ ")'
+# override default prompt for bash
+# case "$0" in
+# -bash)
+# export PS1="\u@\h:\w\\$ "
+# esac
diff --git a/usr/src/cmd/nsadmin/etc-profile.sh b/usr/src/cmd/nsadmin/etc-profile.sh
index a74965d21a..035e8a3025 100644
--- a/usr/src/cmd/nsadmin/etc-profile.sh
+++ b/usr/src/cmd/nsadmin/etc-profile.sh
@@ -37,10 +37,24 @@ then
export TERM
fi
+#
+# use less(1) as the default pager for the man(1) command.
+#
+PAGER="/usr/bin/less -ins"
+export PAGER
+
# Login and -su shells get /etc/profile services.
# -rsh is given its environment in its .profile.
case "$0" in
+-bash)
+ # set prompt for bash
+ PS1="\u@\h:\w\\$ "
+ export PS1
+ ;;
+esac
+
+case "$0" in
-sh | -ksh | -ksh93 | -jsh | -bash | -zsh)
if [ ! -f .hushlogin ]
@@ -53,12 +67,12 @@ case "$0" in
/bin/mail -E
case $? in
- 0)
+ 0)
echo "You have new mail."
- ;;
- 2)
+ ;;
+ 2)
echo "You have mail."
- ;;
+ ;;
esac
fi
esac
diff --git a/usr/src/cmd/nsadmin/local.cshrc b/usr/src/cmd/nsadmin/local.cshrc
deleted file mode 100644
index 38894ca5b9..0000000000
--- a/usr/src/cmd/nsadmin/local.cshrc
+++ /dev/null
@@ -1,29 +0,0 @@
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright 2000 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-#ident "%Z%%M% %I% %E% SMI"
-umask 022
-set path=(/bin /usr/bin /usr/ucb /etc .)
-if ( $?prompt ) then
- set history=32
-endif
diff --git a/usr/src/cmd/nsadmin/local.login b/usr/src/cmd/nsadmin/local.login
deleted file mode 100644
index d636b45594..0000000000
--- a/usr/src/cmd/nsadmin/local.login
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# ident "%Z%%M% %I% %E% SMI"
-stty -istrip
-# setenv TERM `tset -Q -`
diff --git a/usr/src/cmd/nsadmin/local.profile b/usr/src/cmd/nsadmin/local.profile
deleted file mode 100644
index a85bb9ace1..0000000000
--- a/usr/src/cmd/nsadmin/local.profile
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# ident "%Z%%M% %I% %E% SMI"
-stty istrip
-PATH=/usr/bin:/usr/ucb:/etc:.
-export PATH
diff --git a/usr/src/pkg/manifests/SUNWcs.mf b/usr/src/pkg/manifests/SUNWcs.mf
index 97bbe88c51..085251d8c5 100644
--- a/usr/src/pkg/manifests/SUNWcs.mf
+++ b/usr/src/pkg/manifests/SUNWcs.mf
@@ -436,10 +436,8 @@ file path=etc/security/prof_attr group=sys preserve=true \
timestamp=19700101T000000Z
file path=etc/security/prof_attr.d/SUNWcs group=sys
file path=etc/shadow group=sys mode=0400 preserve=true
+file path=etc/skel/.kshrc group=other preserve=true
file path=etc/skel/.profile group=other preserve=true
-file path=etc/skel/local.cshrc group=sys preserve=true
-file path=etc/skel/local.login group=sys preserve=true
-file path=etc/skel/local.profile group=sys preserve=true
file path=etc/svc/profile/generic_limited_net.xml group=sys mode=0444
file path=etc/svc/profile/generic_open.xml group=sys mode=0444
file path=etc/svc/profile/inetd_generic.xml group=sys mode=0444