diff options
author | jim-p <jimp@pfsense.org> | 2015-06-08 08:23:03 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2015-06-08 08:24:59 -0400 |
commit | 3386101487d6beda23925ce02e301af547c4b460 (patch) | |
tree | e3f720d5670397d7fff4ce5adecb8eb914556a4d | |
parent | 0d44aca64623da5a3eeef0619704a10b3cfda7a5 (diff) | |
download | pfsense-3386101487d6beda23925ce02e301af547c4b460.zip pfsense-3386101487d6beda23925ce02e301af547c4b460.tar.gz |
Use skel as the source of new user files rather than copying from root.
Reported-By: https://twitter.com/fitchitis/status/607850849172373504
-rw-r--r-- | etc/inc/auth.inc | 1 | ||||
-rw-r--r-- | etc/inc/dot.hushlogin | 0 | ||||
-rw-r--r-- | etc/skel/dot.profile | 5 | ||||
-rw-r--r-- | etc/skel/dot.shrc | 14 | ||||
-rw-r--r-- | etc/skel/dot.tcshrc | 9 |
5 files changed, 28 insertions, 1 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index ceaa9e5..e216289 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -461,7 +461,6 @@ function local_user_set(& $user) { /* create user directory if required */ if (!is_dir($user_home)) { mkdir($user_home, 0700); - mwexec("/bin/cp /root/.* {$home_base}/", true); } @chown($user_home, $user_name); @chgrp($user_home, $user_group); diff --git a/etc/inc/dot.hushlogin b/etc/inc/dot.hushlogin new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/etc/inc/dot.hushlogin diff --git a/etc/skel/dot.profile b/etc/skel/dot.profile new file mode 100644 index 0000000..700597a --- /dev/null +++ b/etc/skel/dot.profile @@ -0,0 +1,5 @@ +# Detect interactive logins and display the shell +if [ -n "${SSH_TTY}" -o "${TERM}" = "cons25" ]; then + /etc/rc.initial + exit +fi diff --git a/etc/skel/dot.shrc b/etc/skel/dot.shrc new file mode 100644 index 0000000..6f3c2fc --- /dev/null +++ b/etc/skel/dot.shrc @@ -0,0 +1,14 @@ +HTTP_PROXY=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyurl)' /conf/config.xml` +if [ "${HTTP_PROXY}" != "" ]; then + HTTP_PROXY_PORT=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyport)' /conf/config.xml` + if [ "${HTTP_PROXY_PORT}" != "" ]; then + HTTP_PROXY="${HTTP_PROXY}:${HTTP_PROXY_PORT}" + fi + export HTTP_PROXY +fi + +# Detect interactive logins and display the shell +if [ -n "${SSH_TTY}" -o "${TERM}" = "cons25" ]; then + /etc/rc.initial + exit +fi diff --git a/etc/skel/dot.tcshrc b/etc/skel/dot.tcshrc index e03cc94..38cf897 100644 --- a/etc/skel/dot.tcshrc +++ b/etc/skel/dot.tcshrc @@ -19,3 +19,12 @@ if ($term == "xterm" || $term == "vt100" || $term == "vt102" || $term == "vt220" bindkey "\e[7~" beginning-of-line # Home rxvt/konsole bindkey "\e[8~" end-of-line # End rxvt/konsole endif + +set http_proxy=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyurl)' /conf/config.xml` +if (${http_proxy} != "") then + set http_proxy_port=`/usr/local/bin/xmllint --xpath 'string(//pfsense/system/proxyport)' /conf/config.xml` + if (${http_proxy_port} != "") then + set http_proxy="${http_proxy}:${http_proxy_port}" + endif + setenv HTTP_PROXY ${http_proxy} +endif |