1999-08-27 23:37:10 +00:00
|
|
|
# $FreeBSD$
|
1998-09-13 23:11:13 +00:00
|
|
|
#
|
o Migrate path, umask from dot.login to dot.cshrc
o Comment out display of fortune by default.
o Synch root's .cshrc/.login and non-root's .cshrc/.login in terms of
gratuitous variables set (EDITOR).
o Remove some commented out variables set inconsistently or gratuitously,
such as Interviews settings, 8-bit German locale for root only.
o Synchronize comments in header, as well as references to appropriate man
pages.
o Remove MANPATH setting as apparently /etc/manpath.config does all that
already.
Similar changes probably need to be made in other dot.* files for root
and skel, as all of these files seem to set different aliases, environmental
variables, prompts, and have different semantics.
As a result of this patch, leaving aside the setting of a special prompt
for root, users of csh and tcsh should find similar environments when
logging in or su'ing to any account using that shell.
Reviewed by: asmodai, nbm, will
2000-03-25 20:23:39 +00:00
|
|
|
# .cshrc - csh resource script, read at beginning of execution by each shell
|
|
|
|
#
|
|
|
|
# see also csh(1), environ(7).
|
2012-03-24 18:43:18 +00:00
|
|
|
# more examples available at /usr/share/examples/csh/
|
o Migrate path, umask from dot.login to dot.cshrc
o Comment out display of fortune by default.
o Synch root's .cshrc/.login and non-root's .cshrc/.login in terms of
gratuitous variables set (EDITOR).
o Remove some commented out variables set inconsistently or gratuitously,
such as Interviews settings, 8-bit German locale for root only.
o Synchronize comments in header, as well as references to appropriate man
pages.
o Remove MANPATH setting as apparently /etc/manpath.config does all that
already.
Similar changes probably need to be made in other dot.* files for root
and skel, as all of these files seem to set different aliases, environmental
variables, prompts, and have different semantics.
As a result of this patch, leaving aside the setting of a special prompt
for root, users of csh and tcsh should find similar environments when
logging in or su'ing to any account using that shell.
Reviewed by: asmodai, nbm, will
2000-03-25 20:23:39 +00:00
|
|
|
#
|
1993-06-20 13:41:45 +00:00
|
|
|
|
1995-11-30 02:28:37 +00:00
|
|
|
alias h history 25
|
|
|
|
alias j jobs -l
|
2012-03-24 18:43:18 +00:00
|
|
|
alias la ls -aF
|
1995-11-30 02:28:37 +00:00
|
|
|
alias lf ls -FA
|
2012-03-24 18:43:18 +00:00
|
|
|
alias ll ls -lAF
|
1993-06-20 13:41:45 +00:00
|
|
|
|
vfs: add restrictions to read(2) of a directory [1/2]
Historically, we've allowed read() of a directory and some filesystems will
accommodate (e.g. ufs/ffs, msdosfs). From the history department staffed by
Warner: <<EOF
pdp-7 unix seemed to allow reading directories, but they were weird, special
things there so I'm unsure (my pdp-7 assembler sucks).
1st Edition's sources are lost, mostly. The kernel allows it. The
reconstructed sources from 2nd or 3rd edition read it though.
V6 to V7 changed the filesystem format, and should have been a warning, but
reading directories weren't materially changed.
4.1b BSD introduced readdir because of UFS. UFS broke all directory reading
programs in 1983. ls, du, find, etc all had to be rewritten. readdir() and
friends were introduced here.
SysVr3 picked up readdir() in 1987 for the AT&T fork of Unix. SysVr4 updated
all the directory reading programs in 1988 because different filesystem
types were introduced.
In the 90s, these interfaces became completely ubiquitous as PDP-11s running
V7 faded from view and all the folks that initially started on V7 upgraded
to SysV. Linux never supported this (though I've not done the software
archeology to check) because it has always had a pathological diversity of
filesystems.
EOF
Disallowing read(2) on a directory has the side-effect of masking
application bugs from relying on other implementation's behavior
(e.g. Linux) of rejecting these with EISDIR across the board, but allowing
it has been a vector for at least one stack disclosure bug in the past[0].
By POSIX, this is implementation-defined whether read() handles directories
or not. Popular implementations have chosen to reject them, and this seems
sensible: the data you're reading from a directory is not structured in some
unified way across filesystem implementations like with readdir(2), so it is
impossible for applications to portably rely on this.
With this patch, we will reject most read(2) of a dirfd with EISDIR. Users
that know what they're doing can conscientiously set
bsd.security.allow_read_dir=1 to allow read(2) of directories, as it has
proven useful for debugging or recovery. A future commit will further limit
the sysctl to allow only the system root to read(2) directories, to make it
at least relatively safe to leave on for longer periods of time.
While we're adding logic pertaining to directory vnodes to vn_io_fault, an
additional assertion has also been added to ensure that we're not reaching
vn_io_fault with any write request on a directory vnode. Such request would
be a logical error in the kernel, and must be debugged rather than allowing
it to potentially silently error out.
Commented out shell aliases have been placed in root's chsrc/shrc to promote
awareness that grep may become noisy after this change, depending on your
usage.
A tentative MFC plan has been put together to try and make it as trivial as
possible to identify issues and collect reports; note that this will be
strongly re-evaluated. Tentatively, I will MFC this knob with the default as
it is in HEAD to improve our odds of actually getting reports. The future
priv(9) to further restrict the sysctl WILL NOT BE MERGED BACK, so the knob
will be a faithful reversion on stable/12. We will go into the merge
acknowledging that the sysctl default may be flipped back to restore
historical behavior at *any* point if it's warranted.
[0] https://www.freebsd.org/security/advisories/FreeBSD-SA-19:10.ufs.asc
PR: 246412
Reviewed by: mckusick, kib, emaste, jilles, cy, phk, imp (all previous)
Reviewed by: rgrimes (latest version)
MFC after: 1 month (note the MFC plan mentioned above)
Relnotes: absolutely, but will amend previous RELNOTES entry
Differential Revision: https://reviews.freebsd.org/D24596
2020-06-04 18:09:55 +00:00
|
|
|
# read(2) of directories may not be desirable by default, as this will provoke
|
|
|
|
# EISDIR errors from each directory encountered.
|
|
|
|
# alias grep grep -d skip
|
|
|
|
|
2000-05-28 15:09:31 +00:00
|
|
|
# A righteous umask
|
o Migrate path, umask from dot.login to dot.cshrc
o Comment out display of fortune by default.
o Synch root's .cshrc/.login and non-root's .cshrc/.login in terms of
gratuitous variables set (EDITOR).
o Remove some commented out variables set inconsistently or gratuitously,
such as Interviews settings, 8-bit German locale for root only.
o Synchronize comments in header, as well as references to appropriate man
pages.
o Remove MANPATH setting as apparently /etc/manpath.config does all that
already.
Similar changes probably need to be made in other dot.* files for root
and skel, as all of these files seem to set different aliases, environmental
variables, prompts, and have different semantics.
As a result of this patch, leaving aside the setting of a special prompt
for root, users of csh and tcsh should find similar environments when
logging in or su'ing to any account using that shell.
Reviewed by: asmodai, nbm, will
2000-03-25 20:23:39 +00:00
|
|
|
umask 22
|
|
|
|
|
Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;
update paths; and include everything in the "base" distribution.
The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive. Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.
The next steps will be:
2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities. I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.
3. Merging src/games into src/usr.bin.
This change will not be MFCed.
Reviewed by: jmg
Discussed at: EuroBSDCon
Approved by: gjb (release-affecting changes)
2015-02-12 05:35:00 +00:00
|
|
|
set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin)
|
2000-03-07 18:52:37 +00:00
|
|
|
|
o Migrate path, umask from dot.login to dot.cshrc
o Comment out display of fortune by default.
o Synch root's .cshrc/.login and non-root's .cshrc/.login in terms of
gratuitous variables set (EDITOR).
o Remove some commented out variables set inconsistently or gratuitously,
such as Interviews settings, 8-bit German locale for root only.
o Synchronize comments in header, as well as references to appropriate man
pages.
o Remove MANPATH setting as apparently /etc/manpath.config does all that
already.
Similar changes probably need to be made in other dot.* files for root
and skel, as all of these files seem to set different aliases, environmental
variables, prompts, and have different semantics.
As a result of this patch, leaving aside the setting of a special prompt
for root, users of csh and tcsh should find similar environments when
logging in or su'ing to any account using that shell.
Reviewed by: asmodai, nbm, will
2000-03-25 20:23:39 +00:00
|
|
|
setenv EDITOR vi
|
2018-08-08 19:24:20 +00:00
|
|
|
setenv PAGER less
|
1993-06-20 13:41:45 +00:00
|
|
|
|
|
|
|
if ($?prompt) then
|
1995-11-30 02:28:37 +00:00
|
|
|
# An interactive shell -- set some stuff up
|
2012-12-05 13:56:39 +00:00
|
|
|
set prompt = "%N@%m:%~ %# "
|
2012-03-24 18:43:18 +00:00
|
|
|
set promptchars = "%#"
|
|
|
|
|
1994-01-22 10:58:26 +00:00
|
|
|
set filec
|
2012-03-24 18:43:18 +00:00
|
|
|
set history = 1000
|
2012-04-11 14:13:22 +00:00
|
|
|
set savehist = (1000 merge)
|
2012-03-24 18:43:18 +00:00
|
|
|
set autolist = ambiguous
|
|
|
|
# Use history to aid expansion
|
|
|
|
set autoexpand
|
|
|
|
set autorehash
|
1995-11-30 02:28:37 +00:00
|
|
|
set mail = (/var/mail/$USER)
|
2001-01-10 02:37:16 +00:00
|
|
|
if ( $?tcsh ) then
|
|
|
|
bindkey "^W" backward-delete-word
|
|
|
|
bindkey -k up history-search-backward
|
|
|
|
bindkey -k down history-search-forward
|
|
|
|
endif
|
2012-03-24 18:43:18 +00:00
|
|
|
|
1993-06-20 13:41:45 +00:00
|
|
|
endif
|