History log of /freebsd-9.3-release/bin/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
267655 20-Jun-2014 gjb

Remove svn:mergeinfo carried over from stable/9.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-9.3-release/COPYRIGHT
/freebsd-9.3-release/MAINTAINERS
/freebsd-9.3-release/Makefile
/freebsd-9.3-release/Makefile.inc1
/freebsd-9.3-release/ObsoleteFiles.inc
/freebsd-9.3-release/UPDATING
/freebsd-9.3-release/bin
cat
cp
csh
date
dd
df
ed
expr
getfacl
kenv
ln
mkdir
mv
pkill
ps
pwait
rcp
rm
setfacl
sh
sleep
test
uuidgen
/freebsd-9.3-release/cddl
/freebsd-9.3-release/cddl/contrib
/freebsd-9.3-release/cddl/contrib/dtracetoolkit
/freebsd-9.3-release/cddl/contrib/opensolaris
/freebsd-9.3-release/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize
/freebsd-9.3-release/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-9.3-release/cddl/contrib/opensolaris/cmd/zfs
/freebsd-9.3-release/cddl/contrib/opensolaris/cmd/zpool
/freebsd-9.3-release/cddl/contrib/opensolaris/lib/libdtrace/common
/freebsd-9.3-release/cddl/contrib/opensolaris/lib/libzfs
/freebsd-9.3-release/cddl/lib
/freebsd-9.3-release/cddl/lib/drti
/freebsd-9.3-release/cddl/lib/libdtrace
/freebsd-9.3-release/cddl/usr.bin/zinject
/freebsd-9.3-release/contrib
/freebsd-9.3-release/contrib/bind9
/freebsd-9.3-release/contrib/binutils
/freebsd-9.3-release/contrib/bmake
/freebsd-9.3-release/contrib/bsnmp
/freebsd-9.3-release/contrib/bsnmp/snmp_mibII
/freebsd-9.3-release/contrib/bzip2
/freebsd-9.3-release/contrib/compiler-rt
/freebsd-9.3-release/contrib/dialog
/freebsd-9.3-release/contrib/diff
/freebsd-9.3-release/contrib/ee
/freebsd-9.3-release/contrib/expat
/freebsd-9.3-release/contrib/file
/freebsd-9.3-release/contrib/gcc
/freebsd-9.3-release/contrib/gcclibs
/freebsd-9.3-release/contrib/gdb
/freebsd-9.3-release/contrib/gdtoa
/freebsd-9.3-release/contrib/gnu-sort
/freebsd-9.3-release/contrib/gperf
/freebsd-9.3-release/contrib/groff
/freebsd-9.3-release/contrib/less
/freebsd-9.3-release/contrib/libarchive
/freebsd-9.3-release/contrib/libarchive/cpio
/freebsd-9.3-release/contrib/libarchive/libarchive
/freebsd-9.3-release/contrib/libarchive/libarchive_fe
/freebsd-9.3-release/contrib/libarchive/tar
/freebsd-9.3-release/contrib/libc++
/freebsd-9.3-release/contrib/libc-pwcache
/freebsd-9.3-release/contrib/libc-vis
/freebsd-9.3-release/contrib/libcxxrt
/freebsd-9.3-release/contrib/libpcap
/freebsd-9.3-release/contrib/libstdc++
/freebsd-9.3-release/contrib/libucl
/freebsd-9.3-release/contrib/llvm
/freebsd-9.3-release/contrib/llvm/tools/clang
/freebsd-9.3-release/contrib/mknod
/freebsd-9.3-release/contrib/mtree
/freebsd-9.3-release/contrib/ncurses
/freebsd-9.3-release/contrib/netcat
/freebsd-9.3-release/contrib/ntp
/freebsd-9.3-release/contrib/nvi
/freebsd-9.3-release/contrib/one-true-awk
/freebsd-9.3-release/contrib/openbsm
/freebsd-9.3-release/contrib/openpam
/freebsd-9.3-release/contrib/openresolv
/freebsd-9.3-release/contrib/opie
/freebsd-9.3-release/contrib/pf
/freebsd-9.3-release/contrib/pnpinfo
/freebsd-9.3-release/contrib/sendmail
/freebsd-9.3-release/contrib/tcpdump
/freebsd-9.3-release/contrib/tcsh
/freebsd-9.3-release/contrib/telnet
/freebsd-9.3-release/contrib/tnftp
/freebsd-9.3-release/contrib/top
/freebsd-9.3-release/contrib/top/install-sh
/freebsd-9.3-release/contrib/traceroute
/freebsd-9.3-release/contrib/tzcode
/freebsd-9.3-release/contrib/tzcode/stdtime
/freebsd-9.3-release/contrib/tzcode/zic
/freebsd-9.3-release/contrib/tzdata
/freebsd-9.3-release/contrib/unvis
/freebsd-9.3-release/contrib/vis
/freebsd-9.3-release/contrib/wpa
/freebsd-9.3-release/contrib/xz
/freebsd-9.3-release/crypto/heimdal
/freebsd-9.3-release/crypto/openssh
/freebsd-9.3-release/crypto/openssl
/freebsd-9.3-release/etc
/freebsd-9.3-release/etc/mtree
/freebsd-9.3-release/etc/rc.d
/freebsd-9.3-release/games/bcd
/freebsd-9.3-release/games/caesar
/freebsd-9.3-release/games/factor
/freebsd-9.3-release/games/fortune
/freebsd-9.3-release/games/fortune/fortune
/freebsd-9.3-release/games/grdc
/freebsd-9.3-release/games/morse
/freebsd-9.3-release/games/number
/freebsd-9.3-release/games/pom
/freebsd-9.3-release/games/random
/freebsd-9.3-release/gnu/lib
/freebsd-9.3-release/gnu/lib/csu
/freebsd-9.3-release/gnu/lib/libgcc
/freebsd-9.3-release/gnu/lib/libgomp
/freebsd-9.3-release/gnu/lib/libstdc++
/freebsd-9.3-release/gnu/lib/libsupc++
/freebsd-9.3-release/gnu/usr.bin/binutils
/freebsd-9.3-release/gnu/usr.bin/binutils/libbinutils
/freebsd-9.3-release/gnu/usr.bin/cc/c++
/freebsd-9.3-release/gnu/usr.bin/cc/cc_tools
/freebsd-9.3-release/gnu/usr.bin/cc/include
/freebsd-9.3-release/gnu/usr.bin/gdb
/freebsd-9.3-release/gnu/usr.bin/gdb/kgdb
/freebsd-9.3-release/gnu/usr.bin/gperf
/freebsd-9.3-release/gnu/usr.bin/groff
/freebsd-9.3-release/gnu/usr.bin/send-pr
/freebsd-9.3-release/include
/freebsd-9.3-release/include/arpa
/freebsd-9.3-release/kerberos5
/freebsd-9.3-release/kerberos5/lib/libgssapi_krb5
/freebsd-9.3-release/lib
/freebsd-9.3-release/lib/Makefile
/freebsd-9.3-release/lib/bind
/freebsd-9.3-release/lib/clang
/freebsd-9.3-release/lib/clang/include
/freebsd-9.3-release/lib/csu
/freebsd-9.3-release/lib/libarchive
/freebsd-9.3-release/lib/libbluetooth
/freebsd-9.3-release/lib/libc
/freebsd-9.3-release/lib/libc++
/freebsd-9.3-release/lib/libc/stdtime
/freebsd-9.3-release/lib/libc/sys
/freebsd-9.3-release/lib/libc/uuid
/freebsd-9.3-release/lib/libcam
/freebsd-9.3-release/lib/libcompiler_rt
/freebsd-9.3-release/lib/libcrypt
/freebsd-9.3-release/lib/libcxxrt
/freebsd-9.3-release/lib/libdwarf
/freebsd-9.3-release/lib/libedit
/freebsd-9.3-release/lib/libelf
/freebsd-9.3-release/lib/libexpat
/freebsd-9.3-release/lib/libfetch
/freebsd-9.3-release/lib/libgeom
/freebsd-9.3-release/lib/libgpib
/freebsd-9.3-release/lib/libgssapi
/freebsd-9.3-release/lib/libiconv_modules
/freebsd-9.3-release/lib/libipsec
/freebsd-9.3-release/lib/libjail
/freebsd-9.3-release/lib/libkiconv
/freebsd-9.3-release/lib/libkvm
/freebsd-9.3-release/lib/libmagic
/freebsd-9.3-release/lib/libmemstat
/freebsd-9.3-release/lib/libncp
/freebsd-9.3-release/lib/libnetbsd
/freebsd-9.3-release/lib/libnetgraph
/freebsd-9.3-release/lib/libopie
/freebsd-9.3-release/lib/libpam
/freebsd-9.3-release/lib/libpcap
/freebsd-9.3-release/lib/libpmc
/freebsd-9.3-release/lib/libproc
/freebsd-9.3-release/lib/libprocstat
/freebsd-9.3-release/lib/libradius
/freebsd-9.3-release/lib/librpcsec_gss
/freebsd-9.3-release/lib/librpcsvc
/freebsd-9.3-release/lib/librt
/freebsd-9.3-release/lib/libsbuf
/freebsd-9.3-release/lib/libsm
/freebsd-9.3-release/lib/libstand
/freebsd-9.3-release/lib/libstdbuf
/freebsd-9.3-release/lib/libtacplus
/freebsd-9.3-release/lib/libthr
/freebsd-9.3-release/lib/libthr/thread/thr_setprio.c
/freebsd-9.3-release/lib/libthr/thread/thr_setschedparam.c
/freebsd-9.3-release/lib/libthread_db
/freebsd-9.3-release/lib/libucl
/freebsd-9.3-release/lib/libulog
/freebsd-9.3-release/lib/libusb
/freebsd-9.3-release/lib/libusbhid
/freebsd-9.3-release/lib/libutil
/freebsd-9.3-release/lib/libvgl
/freebsd-9.3-release/lib/libypclnt
/freebsd-9.3-release/lib/libz
/freebsd-9.3-release/lib/msun
/freebsd-9.3-release/lib/ncurses/form
/freebsd-9.3-release/lib/ncurses/menu
/freebsd-9.3-release/lib/ncurses/ncurses
/freebsd-9.3-release/lib/ncurses/panel
/freebsd-9.3-release/libexec/atrun
/freebsd-9.3-release/libexec/bootpd
/freebsd-9.3-release/libexec/comsat
/freebsd-9.3-release/libexec/ftpd
/freebsd-9.3-release/libexec/getty
/freebsd-9.3-release/libexec/mail.local
/freebsd-9.3-release/libexec/pppoed
/freebsd-9.3-release/libexec/rbootd
/freebsd-9.3-release/libexec/rshd
/freebsd-9.3-release/libexec/rtld-elf
/freebsd-9.3-release/libexec/save-entropy
/freebsd-9.3-release/libexec/smrsh
/freebsd-9.3-release/libexec/tftpd
/freebsd-9.3-release/libexec/ypxfr
/freebsd-9.3-release/release
/freebsd-9.3-release/release/doc
/freebsd-9.3-release/release/doc/en_US.ISO8859-1/hardware
/freebsd-9.3-release/release/ia64
/freebsd-9.3-release/release/picobsd/tinyware/passwd
/freebsd-9.3-release/rescue
/freebsd-9.3-release/rescue/rescue
/freebsd-9.3-release/sbin
/freebsd-9.3-release/sbin/atacontrol
/freebsd-9.3-release/sbin/atm/atmconfig
/freebsd-9.3-release/sbin/bsdlabel
/freebsd-9.3-release/sbin/camcontrol
/freebsd-9.3-release/sbin/ccdconfig
/freebsd-9.3-release/sbin/ddb
/freebsd-9.3-release/sbin/devd
/freebsd-9.3-release/sbin/devfs
/freebsd-9.3-release/sbin/dhclient
/freebsd-9.3-release/sbin/dump
/freebsd-9.3-release/sbin/dumpfs
/freebsd-9.3-release/sbin/fdisk
/freebsd-9.3-release/sbin/fdisk_pc98
/freebsd-9.3-release/sbin/fsck_ffs
/freebsd-9.3-release/sbin/fsck_msdosfs
/freebsd-9.3-release/sbin/fsdb
/freebsd-9.3-release/sbin/fsirand
/freebsd-9.3-release/sbin/gbde
/freebsd-9.3-release/sbin/geom
/freebsd-9.3-release/sbin/geom/class/mirror
/freebsd-9.3-release/sbin/geom/class/multipath
/freebsd-9.3-release/sbin/geom/class/part
/freebsd-9.3-release/sbin/geom/class/raid
/freebsd-9.3-release/sbin/geom/class/raid3
/freebsd-9.3-release/sbin/geom/class/sched
/freebsd-9.3-release/sbin/geom/class/virstor
/freebsd-9.3-release/sbin/ggate
/freebsd-9.3-release/sbin/growfs
/freebsd-9.3-release/sbin/gvinum
/freebsd-9.3-release/sbin/hastctl
/freebsd-9.3-release/sbin/hastd
/freebsd-9.3-release/sbin/ifconfig
/freebsd-9.3-release/sbin/init
/freebsd-9.3-release/sbin/ipf
/freebsd-9.3-release/sbin/ipfw
/freebsd-9.3-release/sbin/iscontrol
/freebsd-9.3-release/sbin/kldload
/freebsd-9.3-release/sbin/mca
/freebsd-9.3-release/sbin/md5
/freebsd-9.3-release/sbin/mdconfig
/freebsd-9.3-release/sbin/mdmfs
/freebsd-9.3-release/sbin/mount
/freebsd-9.3-release/sbin/mount_cd9660
/freebsd-9.3-release/sbin/mount_msdosfs
/freebsd-9.3-release/sbin/mount_nfs
/freebsd-9.3-release/sbin/mount_ntfs
/freebsd-9.3-release/sbin/mount_nullfs
/freebsd-9.3-release/sbin/mount_unionfs
/freebsd-9.3-release/sbin/natd
/freebsd-9.3-release/sbin/newfs
/freebsd-9.3-release/sbin/newfs_msdos
/freebsd-9.3-release/sbin/nvmecontrol
/freebsd-9.3-release/sbin/ping6
/freebsd-9.3-release/sbin/quotacheck
/freebsd-9.3-release/sbin/rcorder
/freebsd-9.3-release/sbin/reboot
/freebsd-9.3-release/sbin/recoverdisk
/freebsd-9.3-release/sbin/restore
/freebsd-9.3-release/sbin/route
/freebsd-9.3-release/sbin/routed/rtquery
/freebsd-9.3-release/sbin/savecore
/freebsd-9.3-release/sbin/setkey
/freebsd-9.3-release/sbin/shutdown
/freebsd-9.3-release/sbin/swapon
/freebsd-9.3-release/sbin/sysctl
/freebsd-9.3-release/sbin/tunefs
/freebsd-9.3-release/sbin/umount
/freebsd-9.3-release/secure/lib/libcrypt
/freebsd-9.3-release/secure/lib/libcrypto
/freebsd-9.3-release/secure/lib/libssh
/freebsd-9.3-release/secure/lib/libssl
/freebsd-9.3-release/secure/libexec/ssh-keysign
/freebsd-9.3-release/secure/usr.bin/openssl
/freebsd-9.3-release/secure/usr.bin/ssh
/freebsd-9.3-release/secure/usr.sbin/sshd
/freebsd-9.3-release/share
/freebsd-9.3-release/share/doc
/freebsd-9.3-release/share/doc/bind9
/freebsd-9.3-release/share/doc/smm
/freebsd-9.3-release/share/dtrace
/freebsd-9.3-release/share/examples
/freebsd-9.3-release/share/examples/csh
/freebsd-9.3-release/share/examples/cvsup
/freebsd-9.3-release/share/examples/diskless
/freebsd-9.3-release/share/examples/etc
/freebsd-9.3-release/share/examples/kld/dyn_sysctl
/freebsd-9.3-release/share/examples/ppp
/freebsd-9.3-release/share/examples/printing
/freebsd-9.3-release/share/examples/scsi_target
/freebsd-9.3-release/share/examples/ses
/freebsd-9.3-release/share/i18n/csmapper
/freebsd-9.3-release/share/info
/freebsd-9.3-release/share/man
/freebsd-9.3-release/share/man/man3
/freebsd-9.3-release/share/man/man4
/freebsd-9.3-release/share/man/man4/run.4
/freebsd-9.3-release/share/man/man4/runfw.4
/freebsd-9.3-release/share/man/man5
/freebsd-9.3-release/share/man/man7
/freebsd-9.3-release/share/man/man8
/freebsd-9.3-release/share/man/man9
/freebsd-9.3-release/share/misc
/freebsd-9.3-release/share/mk
/freebsd-9.3-release/share/mk/bsd.arch.inc.mk
/freebsd-9.3-release/share/mk/bsd.sys.mk
/freebsd-9.3-release/share/skel
/freebsd-9.3-release/share/syscons
/freebsd-9.3-release/share/syscons/keymaps
/freebsd-9.3-release/share/termcap
/freebsd-9.3-release/share/zoneinfo
/freebsd-9.3-release/sys
/freebsd-9.3-release/sys/amd64/include/xen
/freebsd-9.3-release/sys/boot
/freebsd-9.3-release/sys/boot/forth
/freebsd-9.3-release/sys/boot/i386/efi
/freebsd-9.3-release/sys/boot/i386/gptboot
/freebsd-9.3-release/sys/boot/ia64/efi
/freebsd-9.3-release/sys/boot/ia64/ski
/freebsd-9.3-release/sys/boot/powerpc/boot1.chrp
/freebsd-9.3-release/sys/boot/powerpc/ofw
/freebsd-9.3-release/sys/cddl/contrib/opensolaris
/freebsd-9.3-release/sys/conf
/freebsd-9.3-release/sys/contrib/dev/acpica
/freebsd-9.3-release/sys/contrib/dev/run
/freebsd-9.3-release/sys/contrib/octeon-sdk
/freebsd-9.3-release/sys/contrib/pf
/freebsd-9.3-release/sys/contrib/x86emu
/freebsd-9.3-release/sys/dev
/freebsd-9.3-release/sys/dev/e1000
/freebsd-9.3-release/sys/dev/isp
/freebsd-9.3-release/sys/dev/ixgbe
/freebsd-9.3-release/sys/dev/puc
/freebsd-9.3-release/sys/dev/usb/wlan/if_run.c
/freebsd-9.3-release/sys/dev/usb/wlan/if_runreg.h
/freebsd-9.3-release/sys/fs
/freebsd-9.3-release/sys/fs/ntfs
/freebsd-9.3-release/sys/modules
/freebsd-9.3-release/sys/modules/ixgbe
/freebsd-9.3-release/sys/net
/freebsd-9.3-release/sys/netpfil
/freebsd-9.3-release/sys/sys
/freebsd-9.3-release/tools
/freebsd-9.3-release/tools/build
/freebsd-9.3-release/tools/build/options
/freebsd-9.3-release/tools/diag
/freebsd-9.3-release/tools/kerneldoc
/freebsd-9.3-release/tools/regression
/freebsd-9.3-release/tools/regression/aio/aiotest
/freebsd-9.3-release/tools/regression/bin/sh
/freebsd-9.3-release/tools/regression/bin/test
/freebsd-9.3-release/tools/regression/doat
/freebsd-9.3-release/tools/regression/fifo
/freebsd-9.3-release/tools/regression/fsx
/freebsd-9.3-release/tools/regression/lib/libc
/freebsd-9.3-release/tools/regression/netinet
/freebsd-9.3-release/tools/regression/pipe
/freebsd-9.3-release/tools/regression/security/cap_test
/freebsd-9.3-release/tools/regression/sockets
/freebsd-9.3-release/tools/regression/usr.sbin
/freebsd-9.3-release/tools/regression/usr.sbin/etcupdate
/freebsd-9.3-release/tools/test
/freebsd-9.3-release/tools/test/auxinfo
/freebsd-9.3-release/tools/test/pthread_vfork
/freebsd-9.3-release/tools/tools
/freebsd-9.3-release/tools/tools/ath
/freebsd-9.3-release/tools/tools/bootparttest
/freebsd-9.3-release/tools/tools/cxgbetool
/freebsd-9.3-release/tools/tools/ether_reflect
/freebsd-9.3-release/tools/tools/mcgrab
/freebsd-9.3-release/tools/tools/nanobsd
/freebsd-9.3-release/tools/tools/netmap
/freebsd-9.3-release/tools/tools/syscall_timing
/freebsd-9.3-release/tools/tools/sysdoc
/freebsd-9.3-release/tools/tools/umastat
/freebsd-9.3-release/tools/tools/vimage
/freebsd-9.3-release/tools/tools/zfsboottest
/freebsd-9.3-release/usr.bin
/freebsd-9.3-release/usr.bin/apply
/freebsd-9.3-release/usr.bin/ar
/freebsd-9.3-release/usr.bin/at
/freebsd-9.3-release/usr.bin/bc
/freebsd-9.3-release/usr.bin/bmake
/freebsd-9.3-release/usr.bin/brandelf
/freebsd-9.3-release/usr.bin/bsdiff
/freebsd-9.3-release/usr.bin/c89
/freebsd-9.3-release/usr.bin/c99
/freebsd-9.3-release/usr.bin/calendar
/freebsd-9.3-release/usr.bin/calendar/calendars
/freebsd-9.3-release/usr.bin/chpass
/freebsd-9.3-release/usr.bin/clang
/freebsd-9.3-release/usr.bin/comm
/freebsd-9.3-release/usr.bin/compress
/freebsd-9.3-release/usr.bin/cpio
/freebsd-9.3-release/usr.bin/csup
/freebsd-9.3-release/usr.bin/ctlstat
/freebsd-9.3-release/usr.bin/cut
/freebsd-9.3-release/usr.bin/dc
/freebsd-9.3-release/usr.bin/dig
/freebsd-9.3-release/usr.bin/du
/freebsd-9.3-release/usr.bin/ee
/freebsd-9.3-release/usr.bin/fetch
/freebsd-9.3-release/usr.bin/find
/freebsd-9.3-release/usr.bin/finger
/freebsd-9.3-release/usr.bin/fstat
/freebsd-9.3-release/usr.bin/gcore
/freebsd-9.3-release/usr.bin/gprof
/freebsd-9.3-release/usr.bin/grep
/freebsd-9.3-release/usr.bin/gzip
/freebsd-9.3-release/usr.bin/hexdump
/freebsd-9.3-release/usr.bin/host
/freebsd-9.3-release/usr.bin/indent
/freebsd-9.3-release/usr.bin/ipcrm
/freebsd-9.3-release/usr.bin/join
/freebsd-9.3-release/usr.bin/kdump
/freebsd-9.3-release/usr.bin/killall
/freebsd-9.3-release/usr.bin/ktrace
/freebsd-9.3-release/usr.bin/ktrdump
/freebsd-9.3-release/usr.bin/last
/freebsd-9.3-release/usr.bin/lastcomm
/freebsd-9.3-release/usr.bin/ldd
/freebsd-9.3-release/usr.bin/less
/freebsd-9.3-release/usr.bin/lex
/freebsd-9.3-release/usr.bin/limits
/freebsd-9.3-release/usr.bin/locale
/freebsd-9.3-release/usr.bin/lock
/freebsd-9.3-release/usr.bin/lockf
/freebsd-9.3-release/usr.bin/login
/freebsd-9.3-release/usr.bin/lsvfs
/freebsd-9.3-release/usr.bin/m4
/freebsd-9.3-release/usr.bin/mail
/freebsd-9.3-release/usr.bin/make
/freebsd-9.3-release/usr.bin/makewhatis
/freebsd-9.3-release/usr.bin/man
/freebsd-9.3-release/usr.bin/minigzip
/freebsd-9.3-release/usr.bin/ministat
/freebsd-9.3-release/usr.bin/mkcsmapper
/freebsd-9.3-release/usr.bin/mkesdb
/freebsd-9.3-release/usr.bin/mklocale
/freebsd-9.3-release/usr.bin/mktemp
/freebsd-9.3-release/usr.bin/msgs
/freebsd-9.3-release/usr.bin/mt
/freebsd-9.3-release/usr.bin/ncal
/freebsd-9.3-release/usr.bin/ncplist
/freebsd-9.3-release/usr.bin/ncplogin
/freebsd-9.3-release/usr.bin/netstat
/freebsd-9.3-release/usr.bin/newgrp
/freebsd-9.3-release/usr.bin/nfsstat
/freebsd-9.3-release/usr.bin/nslookup
/freebsd-9.3-release/usr.bin/passwd
/freebsd-9.3-release/usr.bin/pr
/freebsd-9.3-release/usr.bin/printf
/freebsd-9.3-release/usr.bin/procstat
/freebsd-9.3-release/usr.bin/protect
/freebsd-9.3-release/usr.bin/rctl
/freebsd-9.3-release/usr.bin/rlogin
/freebsd-9.3-release/usr.bin/rpcgen
/freebsd-9.3-release/usr.bin/rsh
/freebsd-9.3-release/usr.bin/rwho
/freebsd-9.3-release/usr.bin/script
/freebsd-9.3-release/usr.bin/sed
/freebsd-9.3-release/usr.bin/seq
/freebsd-9.3-release/usr.bin/sockstat
/freebsd-9.3-release/usr.bin/split
/freebsd-9.3-release/usr.bin/stat
/freebsd-9.3-release/usr.bin/stdbuf
/freebsd-9.3-release/usr.bin/su
/freebsd-9.3-release/usr.bin/systat
/freebsd-9.3-release/usr.bin/tail
/freebsd-9.3-release/usr.bin/talk
/freebsd-9.3-release/usr.bin/tar
/freebsd-9.3-release/usr.bin/tftp
/freebsd-9.3-release/usr.bin/top
/freebsd-9.3-release/usr.bin/touch
/freebsd-9.3-release/usr.bin/truss
/freebsd-9.3-release/usr.bin/unvis
/freebsd-9.3-release/usr.bin/unzip
/freebsd-9.3-release/usr.bin/usbhidaction
/freebsd-9.3-release/usr.bin/usbhidctl
/freebsd-9.3-release/usr.bin/users
/freebsd-9.3-release/usr.bin/uuencode
/freebsd-9.3-release/usr.bin/vacation
/freebsd-9.3-release/usr.bin/vis
/freebsd-9.3-release/usr.bin/vmstat
/freebsd-9.3-release/usr.bin/w
/freebsd-9.3-release/usr.bin/wall
/freebsd-9.3-release/usr.bin/who
/freebsd-9.3-release/usr.bin/whois
/freebsd-9.3-release/usr.bin/write
/freebsd-9.3-release/usr.bin/xinstall
/freebsd-9.3-release/usr.bin/xlint
/freebsd-9.3-release/usr.bin/yes
/freebsd-9.3-release/usr.sbin
/freebsd-9.3-release/usr.sbin/Makefile
/freebsd-9.3-release/usr.sbin/ac
/freebsd-9.3-release/usr.sbin/acpi/acpidump
/freebsd-9.3-release/usr.sbin/adduser
/freebsd-9.3-release/usr.sbin/amd
/freebsd-9.3-release/usr.sbin/ancontrol
/freebsd-9.3-release/usr.sbin/apmd
/freebsd-9.3-release/usr.sbin/arp
/freebsd-9.3-release/usr.sbin/authpf
/freebsd-9.3-release/usr.sbin/bluetooth/ath3kfw
/freebsd-9.3-release/usr.sbin/bluetooth/bthidd
/freebsd-9.3-release/usr.sbin/bluetooth/hccontrol
/freebsd-9.3-release/usr.sbin/bluetooth/sdpd
/freebsd-9.3-release/usr.sbin/boot0cfg
/freebsd-9.3-release/usr.sbin/bootparamd
/freebsd-9.3-release/usr.sbin/bsdconfig
/freebsd-9.3-release/usr.sbin/bsdinstall
/freebsd-9.3-release/usr.sbin/bsdinstall/scripts
/freebsd-9.3-release/usr.sbin/bsnmpd
/freebsd-9.3-release/usr.sbin/bsnmpd/modules/snmp_hostres
/freebsd-9.3-release/usr.sbin/bsnmpd/modules/snmp_wlan
/freebsd-9.3-release/usr.sbin/bsnmpd/tools/bsnmptools
/freebsd-9.3-release/usr.sbin/btxld
/freebsd-9.3-release/usr.sbin/burncd
/freebsd-9.3-release/usr.sbin/cdcontrol
/freebsd-9.3-release/usr.sbin/chkgrp
/freebsd-9.3-release/usr.sbin/config
/freebsd-9.3-release/usr.sbin/cpucontrol
/freebsd-9.3-release/usr.sbin/crashinfo
/freebsd-9.3-release/usr.sbin/cron
/freebsd-9.3-release/usr.sbin/cron/crontab
/freebsd-9.3-release/usr.sbin/crunch
/freebsd-9.3-release/usr.sbin/ctladm
/freebsd-9.3-release/usr.sbin/ctm/ctm_dequeue
/freebsd-9.3-release/usr.sbin/daemon
/freebsd-9.3-release/usr.sbin/diskinfo
/freebsd-9.3-release/usr.sbin/edquota
/freebsd-9.3-release/usr.sbin/etcupdate
/freebsd-9.3-release/usr.sbin/flowctl
/freebsd-9.3-release/usr.sbin/freebsd-update
/freebsd-9.3-release/usr.sbin/fwcontrol
/freebsd-9.3-release/usr.sbin/gpioctl
/freebsd-9.3-release/usr.sbin/gssd
/freebsd-9.3-release/usr.sbin/i2c
/freebsd-9.3-release/usr.sbin/ifmcstat
/freebsd-9.3-release/usr.sbin/inetd
/freebsd-9.3-release/usr.sbin/iostat
/freebsd-9.3-release/usr.sbin/ip6addrctl
/freebsd-9.3-release/usr.sbin/jail
/freebsd-9.3-release/usr.sbin/jls
/freebsd-9.3-release/usr.sbin/kbdcontrol
/freebsd-9.3-release/usr.sbin/kbdmap
/freebsd-9.3-release/usr.sbin/keyserv
/freebsd-9.3-release/usr.sbin/kgmon
/freebsd-9.3-release/usr.sbin/kldxref
/freebsd-9.3-release/usr.sbin/lpr
/freebsd-9.3-release/usr.sbin/lpr/filters
/freebsd-9.3-release/usr.sbin/lpr/lpd
/freebsd-9.3-release/usr.sbin/makefs
/freebsd-9.3-release/usr.sbin/memcontrol
/freebsd-9.3-release/usr.sbin/mergemaster
/freebsd-9.3-release/usr.sbin/mfiutil
/freebsd-9.3-release/usr.sbin/mixer
/freebsd-9.3-release/usr.sbin/mountd
/freebsd-9.3-release/usr.sbin/moused
/freebsd-9.3-release/usr.sbin/mptutil
/freebsd-9.3-release/usr.sbin/mtest
/freebsd-9.3-release/usr.sbin/mtree
/freebsd-9.3-release/usr.sbin/named
/freebsd-9.3-release/usr.sbin/ndiscvt
/freebsd-9.3-release/usr.sbin/ndp
/freebsd-9.3-release/usr.sbin/newsyslog
/freebsd-9.3-release/usr.sbin/nfscbd
/freebsd-9.3-release/usr.sbin/nfsd
/freebsd-9.3-release/usr.sbin/nmtree
/freebsd-9.3-release/usr.sbin/ntp
/freebsd-9.3-release/usr.sbin/pc-sysinstall
/freebsd-9.3-release/usr.sbin/pciconf
/freebsd-9.3-release/usr.sbin/pkg
/freebsd-9.3-release/usr.sbin/pkg_install
/freebsd-9.3-release/usr.sbin/pkg_install/add
/freebsd-9.3-release/usr.sbin/pkg_install/info
/freebsd-9.3-release/usr.sbin/pkg_install/updating
/freebsd-9.3-release/usr.sbin/pmcannotate
/freebsd-9.3-release/usr.sbin/pmccontrol
/freebsd-9.3-release/usr.sbin/pmcstat
/freebsd-9.3-release/usr.sbin/portsnap
/freebsd-9.3-release/usr.sbin/portsnap/portsnap
/freebsd-9.3-release/usr.sbin/powerd
/freebsd-9.3-release/usr.sbin/ppp
/freebsd-9.3-release/usr.sbin/pw
/freebsd-9.3-release/usr.sbin/pwd_mkdb
/freebsd-9.3-release/usr.sbin/rarpd
/freebsd-9.3-release/usr.sbin/route6d
/freebsd-9.3-release/usr.sbin/rpc.lockd
/freebsd-9.3-release/usr.sbin/rpc.statd
/freebsd-9.3-release/usr.sbin/rpc.yppasswdd
/freebsd-9.3-release/usr.sbin/rpc.ypupdated
/freebsd-9.3-release/usr.sbin/rpc.ypxfrd
/freebsd-9.3-release/usr.sbin/rrenumd
/freebsd-9.3-release/usr.sbin/rtadvctl
/freebsd-9.3-release/usr.sbin/rtadvd
/freebsd-9.3-release/usr.sbin/rtprio
/freebsd-9.3-release/usr.sbin/rtsold
/freebsd-9.3-release/usr.sbin/rwhod
/freebsd-9.3-release/usr.sbin/sa
/freebsd-9.3-release/usr.sbin/sade
/freebsd-9.3-release/usr.sbin/sendmail
/freebsd-9.3-release/usr.sbin/service
/freebsd-9.3-release/usr.sbin/services_mkdb
/freebsd-9.3-release/usr.sbin/setfib
/freebsd-9.3-release/usr.sbin/smbmsg
/freebsd-9.3-release/usr.sbin/syslogd
/freebsd-9.3-release/usr.sbin/sysrc
/freebsd-9.3-release/usr.sbin/tcpdrop
/freebsd-9.3-release/usr.sbin/tcpdump
/freebsd-9.3-release/usr.sbin/timed
/freebsd-9.3-release/usr.sbin/timed/timed
/freebsd-9.3-release/usr.sbin/traceroute6
/freebsd-9.3-release/usr.sbin/tzsetup
/freebsd-9.3-release/usr.sbin/uhsoctl
/freebsd-9.3-release/usr.sbin/usbdump
/freebsd-9.3-release/usr.sbin/utxrm
/freebsd-9.3-release/usr.sbin/vidcontrol
/freebsd-9.3-release/usr.sbin/vipw
/freebsd-9.3-release/usr.sbin/wake
/freebsd-9.3-release/usr.sbin/watch
/freebsd-9.3-release/usr.sbin/watchdogd
/freebsd-9.3-release/usr.sbin/wlandebug
/freebsd-9.3-release/usr.sbin/wpa
/freebsd-9.3-release/usr.sbin/wpa/hostapd
/freebsd-9.3-release/usr.sbin/wpa/wpa_supplicant
/freebsd-9.3-release/usr.sbin/yp_mkdb
/freebsd-9.3-release/usr.sbin/ypbind
/freebsd-9.3-release/usr.sbin/yppush
/freebsd-9.3-release/usr.sbin/ypserv
/freebsd-9.3-release/usr.sbin/zic
267654 20-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


266489 21-May-2014 thomas

MFC rev. 265593:
(dd_out): Fix handling of all-zeroes block at end of input with
conv=sparse.

PR: bin/189174
PR: bin/189284
Reviewed by: kib


266286 17-May-2014 bdrewery

MFC r265229,r265239:

Add -J to filter by matching jail IDs and names.


265266 03-May-2014 dumbbell

date(1): Add "-R" flag to use RFC 2822 date and time output format [MFC]

As stated in the man page, this is equivalent to use "%a, %d %b %Y %T %z"
as the output format while LC_TIME is set to the "C" locale.

This is compatible with date(1) from the GNU core utilities.

This is an MFC of r264968 and r264970.


264645 18-Apr-2014 jilles

MFC r260246: sh(1): Discourage use of -e.

Also, do not say that ! before a pipeline is an operator, because it is
syntactically a keyword.


264644 18-Apr-2014 jilles

MFC r263847: sh: Fix memory leak with an assignment before a regular builtin


264643 18-Apr-2014 jilles

MFC r263846: sh: Fix memory leak when trying to set a read only variable.


264629 17-Apr-2014 jilles

MFC r263777: sh: Fix possible memory leaks and double frees with unexpected
SIGINT.


264579 17-Apr-2014 delphij

MFC all recent changes on -HEAD to dd(1).


264423 13-Apr-2014 jilles

MFC r238468: sh: Expand assignment-like words specially for
export/readonly/local.

Examples:
export x=~
now expands the tilde
local y=$1
is now safe, even if $1 contains IFS characters or metacharacters.

For a word to "look like an assignment", it must start with a name followed
by an equals sign, none of which may be quoted.

The special treatment applies when the first word (potentially after
"command") is "export", "readonly" or "local". There may be quoting
characters but no expansions. If "local" is overridden with a function there
is no special treatment ("export" and "readonly" cannot be overridden with a
function).

If things like
local arr=(1 2 3)
are ever allowed in the future, they cannot call a "local" function. This
would either be a run-time error or it would call the builtin.

This matches Austin Group bug #351, planned for the next issue of POSIX.1.

As for the MFC, it is easy to depend on this feature inadvertently, and
adding this fixes a regression from stable/8 that may be apparent in things
like
local x=${y+a @}.

PR: bin/166771
Relnotes: yes


264303 09-Apr-2014 dim

MFC r263778:

Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process
all the SUBDIR entries in parallel, instead of serially. Apply this
option to a selected number of Makefiles, which can greatly speed up the
build on multi-core machines, when using make -j.

This can be extended to more Makefiles later on, whenever they are
verified to work correctly with parallel building.

I tested this on a 24-core machine, with make -j48 buildworld (N = 6):

before stddev after stddev
======= ====== ======= ======
real time 1741.1 16.5 959.8 2.7
user time 12468.7 16.4 14393.0 16.8
sys time 1825.0 54.8 2110.6 22.8

(user+sys)/real 8.2 17.1

E.g. the build was approximately 45% faster in real time. On machines
with less cores, or with lower -j settings, the speedup will not be as
impressive. But at least you can now almost max out a machine with
buildworld!

Submitted by: jilles

MFC r263833:

Enable parallel building for gnu/usr.bin and usr.bin/clang too.


263970 31-Mar-2014 des

MFH (r237568, r255422, r255460, r255766, r255767, r255774, r255829,
r256126, r257954, r261320, r261499, r263691, r263712): upgrade to
OpenSSH 6.6p1 via 6.3p1, 6.4p1 and 6.5p1.

Differences relative to head:

- No DNSSEC support since stable/9 does not have LDNS
- Sandboxing off by default, and uses rlimit instead of Capsicum
- ED25519 moved to the bottom of the order of preference to avoid
"new public key" warnings


262469 25-Feb-2014 daichi

MFC r262467: sh: Add -h option to SYNOPSIS

Reviewed by: jilles


260948 20-Jan-2014 wblock

MFC r260782:

-h and -H options backwards in manual page.


256728 18-Oct-2013 trasz

MFC r256050:

Remove useless check - ki_loginclass is an array; can't be NULL.


256054 04-Oct-2013 trasz

MFC r254134:

Add -c flag to pgrep(1) and pkill(1), to match login classes.


255065 30-Aug-2013 jilles

MFC r254335: sh: Allow a lone redirection before '|', ';;' or ';&'.

Example: </dev/null | :

PR: 181240


253223 11-Jul-2013 jilles

MFC r251211: test(1): Add information about replacing -nt/-ot.


252617 03-Jul-2013 jilles

MFC r248349: sh: Recognize "--" and explicitly reject options in wait
builtin.

If syntactically invalid job identifiers are to be taken as jobs that exited
with status 127, this should not apply to options, so that we can add
options later if need be.


252611 03-Jul-2013 jilles

MFC r251763: sh(1): A subshell environment has its own rlimits (ulimit).

This has always been the case and is intended (just like cd).

This matches Austin group issue #706.


252610 03-Jul-2013 jilles

MFC r248870 by joel: Minor mdoc fix in previous commit.


252609 03-Jul-2013 jilles

MFC r248692: sh(1): Mention possible ambiguities with $(( and ((.

In some other shells, things like $((a);(b)) are command substitutions.

Also, there are shells that have an extension ((ARITH)) that evaluates an
arithmetic expression and returns status 1 if the result is zero, 0
otherwise. This extension may lead to ambiguity with two subshells starting
in sequence.


252607 03-Jul-2013 jilles

MFC r251209: test(1): List non-standard primaries.


252606 03-Jul-2013 jilles

MFC r251078,r251433: sleep: Improve nanosleep() error handling:

* Work around kernel bugs that cause a spurious [EINTR] return if a
debugger (such as truss(1)) is attached.

* Write an error message if an error other than [EINTR] occurs.

PR: bin/178664


252214 25-Jun-2013 ken

MFC: 249658, 249701

Update chio(1) and ch(4) to support reporting element designators.

This allows mapping a tape drive in a changer (as reported by
'chio status') to a sa(4) driver instance by comparing the
serial numbers.

The designators can be ASCII (which is printed out directly), binary
(which is printed in hex format) or UTF-8, which is printed in either
native UTF-8 format if the terminal can support it, or in %XX notation
for non-ASCII characters. Thanks to Hiroki Sato <hrs@> for the
explanation and example UTF-8 printing code.

chio.h: Modify the changer_element_status structure to add new
fields and definitions from the SMC3r16 spec.

Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and
define a new CHIOGSTATUS ioctl.

Clean up some tab/space issues.

chio.c: For the 'status' subcommand, print the designator field
if it is supplied by a device.

scsi_ch.h: Add new flags for DVCID and CURDATA to the READ
ELEMENT STATUS command structure.

Add a read_element_status_device_id structure
for the data fields in the new standard. Add new
unions, dt_or_obsolete and voltage_devid, to hold
and address data from either SCSI-2 or newer devices.

scsi_ch.c: Implement support for fetching device IDs with READ
ELEMENT STATUS data.

Add new arguments to scsi_read_element_status() to
allow the user to request the DVCID and CURDATA bits.
This isn't compiled into libcam (it's only an internal
kernel interface), so we don't need any special
handling for the API change.

If the user issues the new CHIOGSTATUS ioctl, copy all of
the available element status data out. If he issues the
OCHIOGSTATUS ioctl, we don't copy the new fields in the
structure.

Fix a bug in chopen() that would result in the peripheral
never getting unheld if chgetparams() failed.

Sponsored by: Spectra Logic
Submitted by: Po-Li Soong


251156 30-May-2013 delphij

MFC r250666:

Constify parameters, no functional or binary change.


250733 17-May-2013 grog

MFC revisions 243049,243129,244134,245871,245912,249698,249924


250586 13-May-2013 eadler

MFC r249949:
Take some improvements from DragonFlyBSD:
- add const where appropriate
- add static where appropriate
- fix a whitespace issues


250328 07-May-2013 kib

MFC r249811:
Literally follow POSIX:
If the bs= expr operand is specified and no conversions other than sync,
noerror, or notrunc are requested, the data returned from each input
block shall be written as a separate output block.

PR: standards/177742


250084 30-Apr-2013 eadler

MFC r249996:
Add missing static qualifiers


249254 08-Apr-2013 trasz

MFC r248972:

Mention that read_attributes, write_attributes, read_acl and write_acl
are always permitted for the file owner.

PR: kern/174948


249242 07-Apr-2013 jilles

MFC r230998,r233792: sh: Use vfork in a few common cases.

This uses vfork() for simple commands and command substitutions containing a
single simple command, invoking an external program under certain conditions
(no redirections or variable assignments, non-interactive shell, no job
control). These restrictions limit the amount of code executed in a vforked
child.

Various incarnations of this patch have been shown to bring performance
improvements:
http://lists.freebsd.org/pipermail/freebsd-hackers/2012-January/037581.html

The use of vfork() can be disabled by setting a variable named
SH_DISABLE_VFORK.


248337 15-Mar-2013 brooks

MFC all features as of r248336:

The user visable feature is from r246083:

Add -l option to cat(1). This option causes cat(1) to use fcntl(2) to
set an exclusive advisory lock on stdout. This will be used to guarantee
orderly writing to METALOG.

Sponsored by: DARPA, AFRL
Obtained from: NetBSD (mason)


247516 01-Mar-2013 jhb

MFC 245610,245633,245635:
Include the thread name along with the command name when displaying the
command name of a thread from a multi-threaded process that doesn't have
an available argument list (such as kernel processes) and threads display
is enabled via -H.


247163 22-Feb-2013 jilles

MFC r246522: sh: Simplify mksyntax and make it fit for cross-compiling.

Now it outputs fixed files, which use constants provided by the C standard
library to determine appropriate values for the target machine.

Before, mksyntax inspected the host machine which resulted in subtle
breakage if e.g. char is signed on the host and unsigned on the target such
as when cross-compiling on x86 for ARM.

Submitted by: Christoph Mallon


247082 21-Feb-2013 kib

MFC r246486:
Document P_PPTRACE.


247058 20-Feb-2013 jilles

MFC r246371: sh: Do not test for digit_contig in mksyntax.

ISO/IEC 9899:1999 (E) 5.2.1p3 guarantees that the values of the characters
0123456789 are contiguous.

The generated syntax.c and syntax.h remain the same.

Submitted by: Christoph Mallon


247057 20-Feb-2013 jilles

MFC r246507: sh: Fix a comment.


246914 17-Feb-2013 jilles

MFC r244734: test(1): Document == alias for =.


246819 15-Feb-2013 trasz

MFC r246557:

In the setfacl(1) manual page, make it clear that for NFSv4 ACLs,
one should really use -a and -x instead of -m.

MFC r246558:

Improve description of the "-m" option to setfacl(1).

MFC r246559:

Fix NFSv4 permission description in setfacl(1) manual page: the 'D'
means delete_child, not delete.


246266 02-Feb-2013 eadler

MFC r245535:
Remove useless variable 'Pflag':
-P is an alternative to -H and -L, and it is implemented using the Hflag and Lflag variables.

Approved by: cperciva (mentor, implicit)


245690 20-Jan-2013 jilles

MFC r245382: sh: Fix crash when parsing '{ } &'.


244875 31-Dec-2012 gjb

MFC r244791:
- Fix wording nit.

PR: 174787
Submitted by: Cody Rank


244117 11-Dec-2012 glebius

Revert r244108. yyparse() declaration isn't redundant in stable/9.

Reported by: tinderbox :)


244108 11-Dec-2012 kevlo

MFC r235771:

Remove redundant declaration of yyparse.

Reported by: tinderbox


244075 10-Dec-2012 grog

MFC to r242840:

Add y flag and environment variable LS_SAMESORT to specify the same
sorting order for time and name with the -t option. IEEE Std 1003.2
(POSIX.2) mandates that the -t option sort in descending order, and
that if two files have the same timestamp, they should be sorted in
ascending order of their names. The -r flag reverses both of these
sort orders, so they're never the same. This creates significant
problems for sequentially named files stored on FAT file systems,
where it can be impossible to list them in the order in which they
were created.

Add , (comma) option to print file sizes grouped and separated by
thousands using the non-monetary separator returned by localeconv(3),
typically a comma or period.


243557 26-Nov-2012 eadler

MFC r243072:
Follow the behavior as specified in POSIX:

if (exists AND (NOT f_option) AND
((not_writable AND input_is_terminal) OR i_option))
prompt

in particular, add the test for input_is_terminal

PR: bin/173039
Approved by: cperciva (implicit)


243402 22-Nov-2012 jilles

MFC r242766: sh: Fix two issues when an alias is redefined:

* The last character is not displayed.
* If the alias ends with itself (as a word), an infinite memory-eating loop
occurs.

If an alias is defined initially, a space is appended to avoid recursion but
this did not happen when an alias was later modified.

PR: bin/173418
Submitted by: Daniel F.


241320 07-Oct-2012 jhb

MFC 226961,239951:
Add a -h flag similar to the -h flag for ln to force mv(1) to treat a
symbolic link to a directory for the target as a symbolic link instead of
a directory. This makes it possible to atomically update a symbolic
link using rename().


241188 04-Oct-2012 trasz

MFC r240088:

Explicitly mention that "cp -p" copies ACLs.

PR: docs/168962


241187 04-Oct-2012 trasz

MFC r240087:

Fix an error in setfacl(1) that manifested like this:

# setfacl -m u:trasz:rwx x
# setfacl -m u:root:rwx x
# getfacl x
# file: x
# owner: root
# group: wheel
user::rw-
user:root:rwx
user:trasz:rwx
group::r--
mask::rwx
other::r--
# setfacl -m u:root:rwx x
setfacl: x: acl_calc_mask() failed: Invalid argument
setfacl: x: failed to set ACL mask

For NFSv4 ACLs, this sort of situation would result in duplicated
entries.


241186 04-Oct-2012 trasz

MFC r240085:

In getfacl(1) manual page, mention where to read about the ACL syntax.
PR submitter suggested adding it to acl(3) instead, but I don't think
pointing ordinary users at section 3 is a good idea.

PR: docs/162380


241185 04-Oct-2012 trasz

MFC r240084:

Make "setfacl -bd" an alias for "setfacl -k". Previously it would crash
on assert.

PR: bin/165807


241184 04-Oct-2012 trasz

MFC r240083:

Make setfacl(1) behave properly in situations like "setfacl -kd".


241158 03-Oct-2012 zont

MFC r240645:
- Add 'dsiz' and 'ssiz' keywords to show data and stack size respectively.

MFC r240649:
- Bump date.

Approved by: kib (mentor)


241030 28-Sep-2012 jilles

MFC r240505: sh: Reduce code duplication: use setinputfile instead of
open/setinputfd combination.


240598 17-Sep-2012 trasz

MFC r240076:

Fix compact form of "synchronize" permission in setfacl(1) manual page - it
should be "s", not "S".

PR: docs/162380


240408 12-Sep-2012 jh

MFC r238653: Use proper error message when fstat(2) fails on stdout.

PR: bin/159746


240407 12-Sep-2012 jh

MFC r238652: style(9).


240123 05-Sep-2012 emaste

MFC 239883:

Avoid passing uninitialized stack to addelem() if called with an empty
arg.

PR: bin/171174


239542 21-Aug-2012 pfg

MFC r238377:

Merge libedit adjustment from NetBSD.

On recent versions of NetBSD's libedit, el_gets
now sets el_len to -1 on error so we can
distinguish between a NULL string and an error.

This fixes sh from exiting with newer versions
of libedit now allowing EINTR to return.

Obtained from: NetBSD
Reviewed by: jilles
MFC after: 3 weeks


238481 15-Jul-2012 des

MFH r236751: document sha256 / sha512 support
MFH r236892: remove mention of auth.conf from programs that don't use it
MFH r236963: remove dead code relating to auth.conf
MFH r236965 r236966 r236967 r237005 r237006 r237011: retire auth.conf

Approved by: re


237615 27-Jun-2012 delphij

MFC r237339:

Polish previous revision: if the fts_* routines have lstat()'ed the
directory entry then use the struct stat from that instead of doing
it again, and skip the rm_overwrite() call if fts_read() indicated
that the entry couldn't be a regular file.

Obtained from: OpenBSD

MFC r237284 (kevlo):

Fix potential symlink race condition in "rm -P" by adding a check
that the file we have opened is the one we expected. Also open in
non-blocking mode to avoid a potential hang with FIFOs.

Obtained from: NetBSD via OpenBSD


237216 18-Jun-2012 eadler

MFC r233648:
Remove trailing whitespace per mdoc lint warning

Approved by: cperciva (implicit)


236349 31-May-2012 wblock

MFC r235842

Mention the upper hard limit for -n option. Patch slightly modified
from PR version.

PR: 168255
Submitted by: Andy Kosela
Approved by: gjb (mentor)


236293 30-May-2012 kib

MFC r235851:
Add 'cow' keyword to show per-process cow count.


236118 26-May-2012 mdf

MFC r235297, r235316:

Add a -v and -N option to kenv(1), so it can be more easily used in
scripts the way sysctl(8) is. The -N option, like in sysctl(8),
displays only the kenv names, not their values. The -v option prints an
individual kenv variable name with its value as name="value". This is
the inverse of sysctl(8)'s -n flag, since the default behaviour of
kenv(1) is already like sysctl(8) -n.


235891 24-May-2012 trasz

MFC r225868:

Make ps(1) automatically size its column widths.


234717 26-Apr-2012 gjb

MFC r232157, r232158:

r232157:
Fix various typos in manual pages.

Submitted by: amdmi3
PR: 165431

r232158:
Whitespace cleanup:
o Wrap sentences on to new lines
o Cleanup trailing whitespace


233289 21-Mar-2012 jilles

MFC r229201: sh: Make patmatch() non-recursive.


233139 19-Mar-2012 eadler

MFC r232466, r232469:
Direct users to swapinfo and pstat from df

PR: bin/165321
Approved by: cperciva


232802 11-Mar-2012 kib

MFC r232694:

Document P_ORPHAN.


232633 07-Mar-2012 mp

MFC r231990

Update to tcsh 6.18.01


231790 15-Feb-2012 jilles

MFC r229220: sh: Make various functions static.


231784 15-Feb-2012 jilles

MFC r229219: sh: Remove unused function scopyn().


231533 11-Feb-2012 jilles

MFC r230437: sh: Remove "kill" example function, which is superseded by the
kill builtin.


231529 11-Feb-2012 jilles

MFC r231001: sh: Fix swapped INTON/INTOFF.

A possible consequence of this bug was a memory leak if SIGINT arrived
during a 'set' command (listing variables).


231260 09-Feb-2012 bapt

MFH r226502,r226503: factor out the common code and fix two display bugs

Approved by: des (mentor)


231085 06-Feb-2012 dumbbell

MFC r230212:
sh: Fix execution of multiple statements in a trap when evalskip is set

Before this fix, only the first statement of the trap was executed if
evalskip was set. This is for example the case when:
o "-e" is set for this shell
o a trap is set on EXIT
o a function returns 1 and causes the script to abort

Reviewed by: jilles
Sponsored by: Yakaz (http://www.yakaz.com)


230781 30-Jan-2012 trociny

MFC r227840, r227846:

r227840:

No need in procfs(5).

r227846

Remove yet another outdated note about procfs(5) being required.

Spotted by: arundel


230625 27-Jan-2012 jilles

MFC r228937: sh: Do not force special builtins non-special in optimized
command substitition.

This is not necessary: errors are already caught in evalbackcmd() and
forcelocal handles changes to variables.

Note that this depends on r223024.


230624 27-Jan-2012 jilles

MFC r230095: sh: Properly show "Not a directory" error in cd builtin.

The errno message display added in r222292 did not take attempting to
cd to a non-directory or something that cannot be stat()ed into account.

PR: bin/164070


230439 21-Jan-2012 jilles

MFC r230117: sh: Fix out of bounds array access when trap is used with an
invalid signal.


229143 31-Dec-2011 dim

MFC r228595:

Fix some obtuse fprintf tricks in bin/ed.


229036 30-Dec-2011 jilles

MFC r227122: sh(1): Improve documentation of field splitting.

This describes the POSIX-compliant splitting algorithm that first appeared
in 8.0.


227305 07-Nov-2011 marius

MFC: r227006, r227281, r227282

Add a PCI front-end to esp(4) allowing it to support AMD Am53C974 and
replace amd(4) with the former in the amd64, i386 and pc98 GENERIC kernel
configuration files. Besides duplicating functionality, amd(4), which
previously also supported the AMD Am53C974, unlike esp(4) is no longer
maintained and has accumulated enough bit rot over time to always cause
a panic during boot as long as at least one target is attached to it
(see PR 124667).

PR: 124667
Approved by: re (kib)
Obtained from: NetBSD (based on)


226190 10-Oct-2011 gjb

MFC 225908, 225912, 225927:

225908:
- Reorder default ps(1) output according to reality.

225912:
- there's no reason the semantics of the -x flag are being explained in
the -a flag description
- be more precise regarding the relation between the -a flag and the
security.bsd.see_other_uids sysctl
- describe the format of the -t flag's argument
- 'con' no longer is a possible entry in the 'TT' column
- explain that the 'TT' column refers to pseudo-terminals
via mere numbers
- add a hint in the 'tt' keyword description that a
keyword 'tty' exists, which will give the full terminal pathname

225859:
- Correct a typo that was introduced in 225912

Approved by: re (kib)


225736 23-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


225215 27-Aug-2011 brueffer

Fix memory leaks in error cases.

PR: 159011
Submitted by: Henning Petersen <henning.petersen@t-online.de>
Approved by: re (kib)
MFC after: 1 week


224199 18-Jul-2011 bz

Rename ki_ocomm to ki_tdname and OCOMMLEN to TDNAMLEN.
Provide backward compatibility defines under BURN_BRIDGES.

Suggested by: jhb
Reviewed by: emaste
Sponsored by: Sandvine Incorporated
Approved by: re (kib)


223909 10-Jul-2011 jilles

sh(1): Extend documentation about subshells.

Because sh executes commands in subshell environments without forking in
more and more cases (particularly from 8.0 on), it makes sense to describe
subshell environments more precisely using ideas from POSIX, together with
some FreeBSD-specific items.

In particular, the hash and times builtins may not behave as if their state
is copied for a subshell environment while leaving the parent shell
environment unchanged.


223883 09-Jul-2011 se

Fix style, since this file has just been touched in a major way.
No actual code changes.


223882 09-Jul-2011 se

Some refactoring for easier maintenance of the code. This is a follow-up
to re-establishment of 64bit arithmetic, but is committed separately, to
not obscure that conversion. This commit does not change the observed
behaviour of expr in any way. Style will be fixed in a follow-up commit.


223881 09-Jul-2011 se

Make /bin/expr support 64bit numeric range and range checks by default,
again. This brings back the behaviour of expr in FreeBSD-4, which had been
reverted due to an assumed incompatbility with POSIX.1 for FreeBSD-5.

This issue has been discussed in the freebsd-standards list, and the
consensus was, that POSIX.1 is in fact not violated by this extension,
since it affects only cases of POSIX undefined behaviour (overflow of
signed long).

Other operating systems did upgrade their versions of expr to support
64bit range, after it had been initially brought to FreeBSD. They have
used it for a decade without problems, meanwhile.

The -e option is retained, but it will only select less strict checking
of numeric parameters (leading white-space, leading "+" are allowed and
skipped, an empty string is considered to represent 0 in numeric context.)
The call of check_utility_compat() as a means of establishing backwards
compatibility with FreeBSD-4 is considered obsolete, but preserved in
this commit. It is expected to be removed in a later revision of this
file.
Reviewed by: bde, das, jilles
MFC after: 2 month (those parts that do not violate POLA)


223709 01-Jul-2011 pluknet

Bump date after the previous commit.


223708 01-Jul-2011 pluknet

Update and sort the list of the available keywords.


223580 26-Jun-2011 jilles

sh: Include <limits.h> instead of non-standard <sys/limits.h>.


223522 24-Jun-2011 jilles

sh(1): Improve documentation of shell patterns:

* Shell patterns are also for ${var#pat} and the like.
* An '!' by itself will not trigger pathname generation so do not call it a
meta-character, even though it has a special meaning directly after an
'['.
* Character ranges are locale-dependent.
* A '^' will complement a character class like '!' but is non-standard.

MFC after: 1 week


223517 24-Jun-2011 jilles

sh(1): Document the case command better.

Suggested by: netchild
Reviewed by: gjb


223494 24-Jun-2011 kevlo

Remove duplicated header files


223372 21-Jun-2011 ru

Make ``realpath'' behave like ``realpath .''.


223282 19-Jun-2011 jilles

sh: Remove special support for background simple commands.

It expands the arguments in the parent shell process, which is incorrect.


223281 18-Jun-2011 jilles

sh: Add do-nothing -h option.

POSIX requires a -h option to sh and set, to locate and remember utilities
invoked by functions as they are defined. Given that this
locate-and-remember process is optional elsewhere, it seems safe enough to
make this option do nothing.

POSIX does not specify a long name for this option. Follow ksh in calling it
"trackall".


223186 17-Jun-2011 jilles

sh: Add case statement fallthrough (with ';&' instead of ';;').

Replacing ;; with the new control operator ;& will cause the next list to be
executed as well without checking its pattern, continuing until a list ends
with ;; or until the end of the case statement. This is like omitting
"break" in a C "switch" statement.

The sequence ;& was formerly invalid.

This feature is proposed for the next POSIX issue in Austin Group issue
#449.


223183 17-Jun-2011 jilles

sh: Skip variables with invalid names in "set", "export -p", "readonly -p".

This ensures the output of these commands is valid shell input.


223163 16-Jun-2011 jilles

sh: Reduce unnecessary forks with eval.

The eval special builtin now runs the code with EV_EXIT if it was run
with EV_EXIT itself.

In particular, this eliminates one fork when a command substitution contains
an eval command that ends with an external program or a subshell.

This is similar to what r220978 did for functions.


223120 15-Jun-2011 jilles

sh: Add support for named character classes in bracket expressions.

Example:
case x in [[:alpha:]]) echo yes ;; esac


223086 14-Jun-2011 trasz

Add "gid" and "group" keywords to display the effective group ID
and effective group name. Also, add "egid", "egroup" and "euid" aliases.

PR: bin/146331
Submitted by: Jeremie Le Hen <jeremie at le-hen dot org>


223060 13-Jun-2011 jilles

sh: Fix duplicate prototypes for builtins.

Have mkbuiltins write the prototypes for the *cmd functions to builtins.h
instead of builtins.c and include builtins.h in more .c files instead of
duplicating prototypes for *cmd functions in other headers.


223024 12-Jun-2011 jilles

sh: Save/restore changed variables in optimized command substitution.

In optimized command substitution, save and restore any variables changed by
expansions (${var=value} and $((var=assigned))), instead of trying to
determine if an expansion may cause such changes.

If $! is referenced in optimized command substitution, do not cause jobs to
be remembered longer.

This fixes $(jobs $!) again, simplifies the man page and shortens the code.


223010 12-Jun-2011 jilles

sh: Fix locale-dependent ranges in bracket expressions.

When I added UTF-8 support in r221646, the LC_COLLATE-based ordering broke
because of sign extension of char.

Because of libc restrictions, this does not work for UTF-8. For UTF-8
locales, ranges always use character code order.


223005 12-Jun-2011 jilles

sh: Read .profile from the home directory (or / if HOME is not set).

In most cases, login shells are started from the home directory, but not in
all, such as xterm -ls.

This commit depends on r222957 for read_profile() performing parameter
expansion.

PR: bin/50569


222957 10-Jun-2011 jilles

sh: Do parameter expansion on ENV before using it.

This is required by POSIX, and allows things like ENV=\$HOME/.shrc.

Note that tilde expansion is explicitly not performed.


222907 09-Jun-2011 jilles

sh: Do parameter expansion before printing PS4 (set -x).

The function name expandstr() and the general idea of doing this kind of
expansion by treating the text as a here document without end marker is from
dash.

All variants of parameter expansion and arithmetic expansion also work (the
latter is not required by POSIX but it does not take extra code and many
other shells also allow it).

Command substitution is prevented because I think it causes too much code to
be re-entered (for example creating an unbounded recursion of trace lines).

Unfortunately, our LINENO is somewhat crude, otherwise PS4='$LINENO+ ' would
be quite useful.


222716 05-Jun-2011 jilles

sh: Fix $? in heredocs on simple commands.

PR: bin/41410


222699 04-Jun-2011 jilles

sh: Improve error message if the script cannot be opened.

Avoid "<nosuchfile>: cannot open <nosuchfile>: ...".


222684 04-Jun-2011 jilles

sh: Reduce more needless differences between error messages.


222676 04-Jun-2011 jilles

sh: Honour -n while processing -c string.


222386 27-May-2011 jilles

sh: Remove the "exp" builtin.

The "exp" builtin is undocumented, non-standard and not very useful.

If exp's return value is not used, something like
VAR=$(exp EXPRESSION)
is equivalent to
VAR=$((EXPRESSION))
except that errors in the expression are fatal and quoting special
characters is not needed in the latter case.

If exp's return value is used, something like
if exp EXPRESSION >/dev/null
can be replaced by
if [ $((EXPRESSION)) -ne 0 ]
with similar differences.

The exp-run showed that "let" is close enough to bash's and ksh's builtin
that removing it would break a few ports. Therefore, "let" remains in 9.x.

PR: bin/104432
Exp-run done by: pav (with some other sh(1) changes)


222381 27-May-2011 jilles

sh: Correct criterion for using CDPATH in cd.

CDPATH should be ignored not only for pathnames starting with '/' but also
for pathnames whose first component is '.' or '..'.

The man page already describes this behaviour.


222362 27-May-2011 jilles

sh: Various updates to the TOUR document.


222361 27-May-2011 jilles

sh: Fix unquoted $@/$* if IFS=''.

If IFS is null, unquoted $@/$* should still expand to separate words.
This differs from quoted $@ (which does not depend on IFS) in that pathname
generation is performed and empty words are removed.


222292 25-May-2011 jilles

sh: Show errno messages in cd.


222182 22-May-2011 jilles

sh: Remove obsolete token type TENDBQUOTE.

This token type was related to Almquist's original version of backquotes
that could not nest and fell into disuse fairly soon.


222178 22-May-2011 uqs

Fix some typos under bin/

Found by: codespell


222177 22-May-2011 uqs

Fix a bunch of typos and a couple of whitespace nits.

Helped by: codespell and vim's spellchecker


222173 22-May-2011 jilles

sh: Fix bss-based buffer overflow in . builtin.

If the length of a directory in PATH together with the given filename
exceeded FILENAME_MAX (which may happen even for pathnames that work), a
static buffer was overflown.

The static buffer is unnecessary, we can use the stalloc() stack.

Obtained from: NetBSD
MFC after: 1 week


222165 21-May-2011 jilles

sh: Expand aliases after assignments and redirections.


222154 20-May-2011 jilles

sh: Implement the cd -e flag proposed for the next POSIX issue.

This reflects failure to determine the pathname of the new directory in the
exit status (1). Normally, cd returns successfully if it did chdir() and the
call was successful.

In POSIX, -e only has meaning with -P; because our -L is not entirely
compliant and may fall back to -P mode, -e has some effect with -L as well.


222134 20-May-2011 jilles

sh: Allow terminating a heredoc with a terminator at EOF without a newline.

This is sometimes used with eval or old-style command substitution, and most
shells other than ash derivatives allow it.

It can also be used with scripts that violate POSIX's requirement on the
application that they end in a newline (scripts must be text files except
that line length is unlimited).

Example:
v=`cat <<EOF
foo
EOF`
echo $v

This commit does not add support for the similar construct with new-style
command substitution, like
v=$(cat <<EOF
foo
EOF)
This continues to require a newline after the terminator.


222130 20-May-2011 pluknet

Spelling in P_HADTHREADS.

MFC after: 1 week


222127 20-May-2011 pluknet

Fix the description of the "paddr" keyword. It shows a process
pointer just like a dublicating "uprocp".

MFC after: 1 week


221975 15-May-2011 jilles

sh: Minor optimization to output from ulimit/export/readonly.

No functional change is intended.


221970 15-May-2011 jilles

sh: Avoid close(-1) when evaluating a multi-command pipeline.

Valgrind complains about this.


221845 13-May-2011 pluknet

Update sticky(7) cross references.

PR: docs/124468
X-MFC with: r218998


221669 08-May-2011 jilles

sh: Add \u/\U support (in $'...') for UTF-8.

Because we have no iconv in base, support for other charsets is not
possible.

Note that \u/\U are processed using the locale that was active when the
shell started. This is necessary to avoid behaviour that depends on the
parse/execute split (for example when placing braces around an entire
script). Therefore, UTF-8 encoding is implemented manually.


221668 08-May-2011 jilles

sh: Optimize variable code by storing the length of the name.

Obtained from: NetBSD


221660 08-May-2011 jilles

sh(1): Update BUGS section for UTF-8 support.


221646 08-May-2011 jilles

sh: Add UTF-8 support to pattern matching.

?, [...] patterns match codepoints instead of bytes. They do not match
invalid sequences. [...] patterns must not contain invalid sequences
otherwise they will not match anything. This is so that ${var#?} removes the
first codepoint, not the first byte, without putting UTF-8 knowledge into
the ${var#pattern} code. However, * continues to match any string and an
invalid sequence matches an identical invalid sequence. (This differs from
fnmatch(3).)


221602 07-May-2011 jilles

sh: Add UTF-8 support to ${#var}.

If the current locale uses UTF-8, ${#var} counts codepoints (more precisely,
bytes b with (b & 0xc0) != 0x80).


221559 06-May-2011 jilles

sh: Track if the current locale's charset is UTF-8 or not.


221551 06-May-2011 jilles

sh: Change the CTL* bytes to ones invalid in UTF-8.

This ensures that mbrtowc(3) can be used directly once it has been verified
that there is no CTL* byte. Dealing with a CTLESC byte within a multibyte
character would be complicated.

The new values do occur in iso-8859-* encodings. This decreases efficiency
slightly but should not affect correctness.

Caveat: Updating across this change and rebuilding without cleaning may
yield a subtly broken sh binary. By default, make buildworld will clean and
avoid problems.


221513 05-May-2011 jilles

sh: Add $'quoting' (C-style escape sequences).

A string between $' and ' may contain backslash escape sequences similar to
the ones in a C string constant (except that a single-quote must be escaped
and a double-quote need not be). Details are in the sh(1) man page.

This construct is useful to include unprintable characters, tabs and
newlines in strings; while this can be done with a command substitution
containing a printf command, that needs ugly workarounds if the result is to
end with a newline as command substitution removes all trailing newlines.

The construct may also be useful in future to describe unprintable
characters without needing to write those characters themselves in 'set -x',
'export -p' and the like.

The implementation attempts to comply to the proposal for the next issue of
the POSIX specification. Because this construct is not in POSIX.1-2008,
using it in scripts intended to be portable is unwise.

Matching the minimal locale support in the rest of sh, the \u and \U
sequences are currently not useful.

Exp-run done by: pav (with some other sh(1) changes)


221463 04-May-2011 jilles

sh: Apply set -u to variables in arithmetic.

Note that this only applies to variables that are actually used.
Things like (0 && unsetvar) do not cause an error.

Exp-run done by: pav (with some other sh(1) changes)


221461 04-May-2011 jilles

sh: Detect an error for ${#var<GARBAGE>}.

In particular, this makes things like ${#foo[0]} and ${#foo[@]} errors
rather than silent equivalents of ${#foo}.

PR: bin/151720
Submitted by: Mark Johnston
Exp-run done by: pav (with some other sh(1) changes)


221372 03-May-2011 ru

Don't call -f option's argument "stdin".

MFC after: 3 days


221027 25-Apr-2011 jilles

sh: Set $? to 0 for background commands.

For backgrounded pipelines and subshells, the previous value of $? was being
preserved, which is incorrect.

For backgrounded simple commands containing a command substitution, the
status of the last command substitution was returned instead of 0.

If fork() fails, this is an error.


221012 25-Apr-2011 jilles

sh: Check setuid()/setgid() return values.

If the -p option is turned off, privileges from a setuid or setgid binary
are dropped. Make sure to check if this succeeds. If it fails, this is an
error which will cause the shell to abort except in interactive mode or if
'command' was used to make 'set' or an outer 'eval' or '.' non-special.

Note that taking advantage of this feature and writing setuid shell scripts
seems unwise.

MFC after: 1 week


221011 25-Apr-2011 jilles

sh: Remove duplicate code resetting uid/gid for set +p/+o privileged.

MFC after: 1 week


220978 23-Apr-2011 jilles

sh: Allow EV_EXIT through function calls, make {...} <redir more consistent.

If EV_EXIT causes an exit, use the exception mechanism to unwind
redirections and local variables. This way, if the final command is a
redirected command, an EXIT trap now executes without the redirections.

Because of these changes, EV_EXIT can now be inherited by the body of a
function, so do so. This means that a function no longer prevents a fork
before an exec being skipped, such as in
f() { head -1 /etc/passwd; }; echo $(f)

Wrapping a single builtin in a function may still cause an otherwise
unnecessary fork with command substitution, however.

An exit command or -e failure still invokes the EXIT trap with the
original redirections and local variables in place.

Note: this depends on SHELLPROC being gone. A SHELLPROC depended on
keeping the redirections and local variables and only cleaning up the
state to restore them.


220903 20-Apr-2011 jilles

sh: Do not word split "${#parameter}".

This is only a problem if IFS contains digits, which is unusual but valid.

Because of an incorrect fix for PR bin/12137, "${#parameter}" was treated
as ${#parameter}. The underlying problem was that "${#parameter}"
erroneously added CTLESC bytes before determining the length. This
was properly fixed for PR bin/56147 but the incorrect fix was not backed
out.

Reported by: Seeker on forums.freebsd.org
MFC after: 2 weeks


220799 18-Apr-2011 trasz

Document problems with -d/-w and the fact that -X is the default.

Suggested by: arundel@
Reviewed by: arundel@


220574 12-Apr-2011 trasz

Get rid of DSIZ; instead just call the sizing function if provided.


220465 09-Apr-2011 trasz

Make it possible to use permission sets (full_set, modify_set, read_set
and write_set) with setfacl(1).

PR: kern/154113
Submitted by: Shawn Webb <lattera at gmail dot com> (earlier version)
MFC after: 1 month


219972 24-Mar-2011 trasz

Add proper width calculation for time fields (time, cputime and usertime).
This fixes the ugly overflow in "ps aux" output for "[idle]".


219967 24-Mar-2011 trasz

Make "LOGIN" and "CLASS" columns width scale properly instead of wasting space.


219806 20-Mar-2011 jilles

sh(1): Describe subshell environment, command substitution more correctly.

POSIX does not require the shell to fork for a subshell environment, and we
use that possibility in various ways (command substitutions with a single
command and most subshells that are the final command of a shell process).
Therefore do not tie subshells to forking in the man page.

Command substitutions with expansions are a bit strange, causing a fork for
$(...$(($x))...) because $x might expand to y=2; they will probably be
changed later but this is how they work now.


219713 17-Mar-2011 kib

Implement the usertime and systime keywords for ps, printing the
corresponding times reported by getrusage().

Submitted by: Dan Nelson <dnelson allantgroup com>
MFC after: 1 week


219680 15-Mar-2011 jilles

bin: Prefer strrchr() to rindex().

This removes the last index/rindex usage from /bin.


219623 13-Mar-2011 jilles

sh: Fix some parameter expansion variants ${#...}.

These already worked: $# ${#} ${##} ${#-} ${#?}
These now work as well: ${#+word} ${#-word} ${##word} ${#%word}

There is an ambiguity in the standard with ${#?}: it could be the length of
$? or it could be $# giving an error in the (impossible) case that it is not
set. We continue to use the former interpretation as it seems more useful.


219363 07-Mar-2011 stefanf

Remove unnecessary cast.

Reviewed by: jilles


219350 06-Mar-2011 jilles

sh(1): Reduce excessive semicolon-separated sentences.

Reported by: Benjamin Kaduk


219307 05-Mar-2011 trasz

Export login class information via kinfo and make it possible to view
it using "ps -o class".


219306 05-Mar-2011 jilles

sh: Fix some warnings in code for arithmetic expressions.

Submitted by: eadler


219154 01-Mar-2011 jilles

kill: Note that this is used both as a normal program and a shell builtin.


219084 27-Feb-2011 delphij

Accept == as an alias of = which is a popular GNU extension.

This is intentionally undocumented for now since it's not part
of any standard.

MFC after: 1 month


219061 26-Feb-2011 ume

When WITH_ICONV is set, use our in-tree iconv.


218917 21-Feb-2011 pluknet

mdoc(7) markup.

Approved by: avg (mentor), kib (mentor)
MFC after: 3 days


218909 21-Feb-2011 brucec

Fix typos - remove duplicate "the".

PR: bin/154928
Submitted by: Eitan Adler <lists at eitanadler.com>
MFC after: 3 days


218724 15-Feb-2011 jilles

test: Note that this is used both as a normal program and a shell builtin.

MFC after: 1 week


218626 12-Feb-2011 jilles

sh: Detect dividing the smallest integer by -1.

This overflows and on some architectures such as amd64 it generates SIGFPE.
Generate an error on all architectures.


218619 12-Feb-2011 brucec

Fix typos.

PR: docs/131625
Submitted by: Andrew Wright <andrew at qemg.org>
MFC after: 1 month


218467 08-Feb-2011 jilles

sh(1): Update description of arithmetic.


218466 08-Feb-2011 jilles

sh: Import arithmetic expression code from dash.

New features:
* proper lazy evaluation of || and &&
* ?: ternary operator
* executable is considerably smaller (8K on i386) because lex and yacc are
no longer used

Differences from dash:
* arith_t instead of intmax_t
* imaxdiv() not used
* unset or null variables default to 0
* let/exp builtin (undocumented, will probably be removed later)

Obtained from: dash


218325 05-Feb-2011 jilles

sh: Fix two things about {(...)} <redir:

* In {(...) <redir1;} <redir2, do not drop redir1.
* Maintain the difference between (...) <redir and {(...)} <redir:
In (...) <redir, the redirection is performed in the child, while in
{(...)} <redir it should be performed in the parent (like {(...); :;}
<redir)


218324 05-Feb-2011 jilles

sh: Remove clearcmdentry()'s now unused argument.


218323 05-Feb-2011 jilles

sh: Forget all cached command locations on any PATH change.

POSIX requires this and it is simpler than the previous code that remembered
command locations when appending directories to PATH.

In particular,
PATH=$PATH
is no longer a no-op but discards all cached command locations.


218320 05-Feb-2011 jilles

sh: Do not try to execute binary files as scripts.

If execve() returns an [ENOEXEC] error, check if the file is binary before
trying to execute it using sh. A file is considered binary if at least one
of the first 256 bytes is '\0'.

In particular, trying to execute ELF binaries for the wrong architecture now
fails with an "Exec format error" message instead of syntax errors and
potentially strange results.


218306 04-Feb-2011 jilles

sh: Remove special code for shell scripts without magic number.

These are called "shell procedures" in the source.

If execve() failed with [ENOEXEC], the shell would reinitialize itself
and execute the program as a script. This requires a fair amount of code
which is not frequently used (most scripts have a #! magic number).
Therefore just execute a new instance of sh (_PATH_BSHELL) to run the
script.


218285 04-Feb-2011 jilles

Make sys_signame upper case.

This matches the constants from <signal.h> with 'SIG' removed, which POSIX
requires kill and trap to accept and 'kill -l' to write.

'kill -l', 'trap', 'trap -l' output is now upper case.

In Turkish locales, signal names with an upper case 'I' are now accepted,
while signal names with a lower case 'i' are no longer accepted, and the
output of 'killall -l' now contains proper capital 'I' without dot instead
of a dotted capital 'I'.


218242 03-Feb-2011 jilles

sh: Return only 126 or 127 for execve() failures.

Do not return 2 for errors other than [EACCES] or [ENOENT].


218203 02-Feb-2011 jilles

sh: Remove comment mentioning herefd, which is gone.


218105 30-Jan-2011 jilles

sh: Send messages about signals to stderr.

This is required by POSIX and seems to make more sense.

See also r217557.


217847 25-Jan-2011 jilles

sh: Clean up some old comments:
* There is no plan for an alternative to the command "set".
* Attempting to unset a readonly variable has not raised an error for quite
a while, so the order of unsetting a variable and a function with the same
name does not matter.

MFC after: 1 week


217821 25-Jan-2011 kib

Document P_FOLLOWFORK.

MFC after: 2 weeks


217557 18-Jan-2011 jilles

sh: Fix signal messages being sent to the wrong file sometimes.

When a foreground job exits on a signal, a message is printed to stdout
about this. The buffer was not flushed after this which could result in the
message being written to the wrong file if the next command was a builtin
and had stdout redirected.

Example:
sh -c 'kill -9 $$'; : > foo; echo FOO:; cat foo

Reported by: gcooper
MFC after: 1 week


217473 16-Jan-2011 jilles

sh(1): Document changes to 'exit' from traps.


217472 16-Jan-2011 jilles

sh: If exit is used without args from a trap action, exit on the signal.

This is useful so that it is easier to exit on a signal than to reset the
trap to default and resend the signal. It matches ksh93. POSIX says that
'exit' without args from a trap action uses the exit status from the last
command before the trap, which is different from 'exit $?' and matches this
if the previous command is assumed to have exited on the signal.

If the signal is SIGSTOP, SIGTSTP, SIGTTIN or SIGTTOU, or if the default
action for the signal is to ignore it, a normal _exit(2) is done with exit
status 128+signal_number.


217461 15-Jan-2011 jilles

sh: Fix some things about -- in trap:
* Make 'trap --' do the same as 'trap' instead of nothing.
* Make '--' stop option processing (note that '-' action is not an option).

Side effect: The error message for an unknown option is different.


217425 14-Jan-2011 jilles

sh: Make 'trap -l' look like 'kill -l'.


217209 09-Jan-2011 jilles

sh: Follow-up to r216743, grabstackblock() can be replaced with stalloc().

grabstackblock() was used only once (but it is a very often executed piece
of code).


217206 09-Jan-2011 jilles

sh: Remove special %builtin PATH entry.
All builtins are now always found before a PATH search.

Most ash derivatives have an undocumented feature where the presence of an
entry "%builtin" in $PATH will cause builtins to be checked at that point of
the PATH search, rather than before looking at any directories as documented
in the man page (very old versions do document this feature).

I am removing this feature from sh, as it complicates the code, may violate
expectations (for example, /usr/bin/alias is very close to a forkbomb with
PATH=/usr/bin:%builtin, only /usr/bin/builtin not being another link saves
it) and appears to be unused (all the %builtin google code search finds is
in some sort of ash source code).

Note that aliases and functions took and take precedence above builtins.
Because aliases work on a lexical level they can only ever be overridden on
a lexical level (quoting or preceding 'builtin' or 'command'). Allowing
override of functions via PATH does not really fit in the model of sh and it
would work differently from %builtin if implemented.

Note: POSIX says special builtins are found before functions. We comply to
this because we do not allow functions with the same name as a special
builtin.

Silence from: freebsd-hackers@ (message sent 20101225)
Discussed with: dougb


217192 09-Jan-2011 kib

Move repeated MAXSLP definition from machine/vmparam.h to sys/vmmeter.h.
Update the outdated comments describing MAXSLP and the process
selection algorithm for swap out.

Comments wording and reviewed by: alc


217175 08-Jan-2011 jilles

sh: Make exit without parameters from EXIT trap POSIX-compliant.

It should use the original exit status, just like falling off the
end of the trap handler.

Outside an EXIT trap, 'exit' is still equivalent to 'exit $?'.


217035 05-Jan-2011 jilles

sh: Do not call exitshell() from evalcommand() unless evalcommand() forked
itself.

This ensures that certain traps caused by builtins are executed.


216922 03-Jan-2011 jh

Increase carried_error if we skip a file due to an error. This ensures
that setfacl(1) exits with proper exit status on failure.

PR: bin/149780
Submitted by: Ævar Arnfjörð Bjarmason (original version)
Reviewed by: trasz
MFC after: 3 weeks


216870 01-Jan-2011 jilles

sh: Check readonly status for assignments on regular builtins.

An error message is written, the builtin is not executed, nonzero exit
status is returned but the shell does not abort.

This was already checked for special builtins and external commands, with
the same consequences except that the shell aborts for special builtins.

Obtained from: NetBSD


216851 31-Dec-2010 jilles

sh: Check if dup2 for redirection from/to a file succeeds.

A failure (e.g. caused by ulimit -n being set very low) is a redirection
error.

Example:
ulimit -n 9; exec 9<.


216826 30-Dec-2010 jilles

sh: Avoid side effects from builtins in optimized command substitution.

Change the criterion for builtins to be safe to execute in the same process
in optimized command substitution from a blacklist of only cd, . and eval to
a whitelist.

This avoids clobbering the main shell environment such as by $(exit 4) and
$(set -x).

The builtins jobid, jobs, times and trap can still show information not
available in a child process; this is deliberately permitted. (Changing
traps is not.)

For some builtins, whether they are safe depends on the arguments passed to
them. Some of these are always considered unsafe to keep things simple; this
only harms efficiency a little in the rare case they are used alone in a
command substitution.


216806 29-Dec-2010 jilles

sh: Properly restore exception handler in fc.

If SIGINT arrived at exactly the right moment (unlikely), an exception
handler in a no longer active stack frame would be called.

Because the old handler was not used in the normal path, clang thought it
was a dead value and if an exception happened it would longjmp() to garbage.
This caused builtins/fc1.0 to fail if histedit.c was compiled with clang.

MFC after: 1 week


216778 28-Dec-2010 jilles

sh: Don't do optimized command substitution if expansions have side effects.

Before considering to execute a command substitution in the same process,
check if any of the expansions may have a side effect; if so, execute it in
a new process just like happens if it is not a single simple command.

Although the check happens at run time, it is a static check that does not
depend on current state. It is triggered by:
- expanding $! (which may cause the job to be remembered)
- ${var=value} default value assignment
- assignment operators in arithmetic
- parameter substitutions in arithmetic except ${#param}, $$, $# and $?
- command substitutions in arithmetic

This means that $((v+1)) does not prevent optimized command substitution,
whereas $(($v+1)) does, because $v might expand to something containing
assignment operators.

Scripts should not depend on these exact details for correctness. It is also
imaginable to have the shell fork if and when a side effect is encountered
or to create a new temporary namespace for variables.

Due to the $! change, the construct $(jobs $!) no longer works. The value of
$! should be stored in a variable outside command substitution first.


216761 28-Dec-2010 jilles

sh: Make expansion errors in optimized command substitution non-fatal.
Command substitutions consisting of a single simple command are executed in
the main shell process but this should be invisible apart from performance
and very few exceptions such as $(trap).


216743 27-Dec-2010 jilles

sh: Simplify "stack string" code slightly.

Maintain a pointer to the end of the stack string area instead of how much
space is left. This simplifies the macros in memalloc.h. The places where
the new variable must be updated are only where the memory area is created,
destroyed or resized.


216707 26-Dec-2010 jilles

sh: Fix integer overflow check, it checked an uninitialized variable.


216706 26-Dec-2010 jilles

sh: Allow arbitrary large numbers in CHECKSTRSPACE.
Reduce "stack string" API somewhat and simplify code.
Add a check for integer overflow of the "stack string" length (probably
incomplete).


216630 21-Dec-2010 jilles

sh(1): Explain why it is a bad idea to use aliases in scripts.


216629 21-Dec-2010 jilles

sh: Add kill builtin.

This allows specifying a %job (which is equivalent to the corresponding
process group).

Additionally, it improves reliability of kill from sh in high-load
situations and ensures "kill" finds the correct utility regardless of PATH,
as required by POSIX (unless the undocumented %builtin mechanism is used).

Side effect: fatal errors (any error other than kill(2) failure) now return
exit status 2 instead of 1. (This is consistent with other sh builtins, but
not in NetBSD.)

Code size increases about 1K on i386.

Obtained from: NetBSD


216622 21-Dec-2010 jilles

sh: Add a function to print warnings (with command name and newline).
This is like error() but without raising an exception.
It is particularly useful as a replacement for the warnx macro in
bltin/bltin.h.


216606 20-Dec-2010 jilles

sh: Make warnings in the printf builtin non-fatal, like in the program.

The #define for warnx now behaves much like the libc function (except that
it uses sh command name and output).

Also, it now uses C99 __VA_ARGS__ so there is no need for three different
macros for 0, 1 or 2 parameters.


216547 18-Dec-2010 jilles

sh: arith: Disallow decimal constants starting with 0 (containing 8 or 9).

Constants in arithmetic starting with 0 should be octal only.

This avoids the following highly puzzling result:
$ echo $((018-017))
3
by making it an error instead.


216544 18-Dec-2010 uqs

Remove dead code.

c is assigned 0 and *loc is pointing to NULL, so c!=0 cannot be true,
and dereferencing loc would be a bad idea anyway.

Coverity Prevent: CID 5113
Reviewed by: jilles


216496 16-Dec-2010 jilles

sh: Fix corruption of command substitutions with special chars after newline

The CTLESC byte to protect a special character was output before instead of
after a newline directly preceding the special character.

The special handling of newlines is because command substitutions discard
all trailing newlines.


216404 13-Dec-2010 uqs

Remove duplicate check, turning dead code into live code.

Coverity CID: 5114
Reviewed by: jilles


216400 12-Dec-2010 jilles

sh: Various simplifications to jobs.c:
* Prefer kill(-X) to killpg(X).
* Remove some dead code.
* No additional SIGINT is needed if int_pending() is already true.

No functional change is intended.


216387 12-Dec-2010 jilles

sh: Remove the herefd hack.

The herefd hack wrote out partial here documents while expanding them. It
seems unnecessary complication given that other expansions just allocate
memory. It causes bugs because the stack is also used for intermediate
results such as arithmetic expressions. Such places should disable herefd
for the duration but not all of them do, and I prefer removing the need for
disabling herefd to disabling it everywhere needed.

Here documents larger than 1024 bytes will use a bit more CPU time and
memory.

Additionally this allows a later change to expand here documents in the
current shell environment. (This is faster for small here documents but also
changes behaviour.)

Obtained from: dash


216384 11-Dec-2010 jilles

sh: Replace some macros and repeated code in expand.c with functions.

No functional change is intended, but the binary is about 1K smaller on
i386.


216380 11-Dec-2010 jilles

sh: Use vsnprintf() rather than crafting our own in fmtstr().
Add INTOFF/INTON as longjmp out of vsnprintf may cause memory leaks or
undefined behaviour.


216246 07-Dec-2010 jilles

sh: Improve internal-representation-to-text code to avoid binary output.

The code to translate the internal representation to text did not know about
various additions to the internal representation since the original ash and
therefore wrote binary stuff to the terminal.

The code is used in the jobs command and similar output.

Note that the output is far from complete and mostly serves for recognition
purposes.


216220 05-Dec-2010 jilles

sh: POSIX says there should not be a space between Done and (exitstatus).

(On the other hand, (core dumped) does need a space and so does [1] +.)


216217 05-Dec-2010 jilles

sh: Improve jobs output of pipelines.

If describing the status of a pipeline, write all elements of the pipeline
and show the status of the last process (which would also end up in $?).
Only write one report per job, not one for every process that exits.

To keep some earlier behaviour, if any process started by the shell in a
foreground job terminates because of a signal, write a message about the
signal (at most one message per job, however).

Also, do not write messages about signals in the wait builtin in
non-interactive shells. Only true foreground jobs now write such messages
(for example, "Terminated").


216208 05-Dec-2010 jilles

sh: Avoid marking a job as done before it is fully created.

In r208489, I added code to reap zombies when forking new processes, to
limit the amount of zombies. However, this can lead to marking a job as done
or stopped if it consists of multiple processes and the first process ends
very quickly. Fix this by only checking for zombies before forking the first
process of a job and not marking any jobs without processes as done or
stopped.


216199 05-Dec-2010 jilles

sh: jobs -p: Do not ask the kernel for the pgid.

The getpgid() call will fail if the first process in the job has already
terminated, resulting in output of "-1".

The pgid of a job is always the pid of the first process in the job and
other code already relies on this.


216178 04-Dec-2010 uqs

Move most of the remaining USD/PSD/SMM papers into share/doc


216168 03-Dec-2010 jilles

sh(1): Clean up documentation of built-in commands.

Make sure all built-in commands are in the subsection named such, except
exp, let and wordexp which are deliberately undocumented. The text said only
built-ins that really need to be a built-in were documented there but in
fact almost all of them were already documented.


216100 01-Dec-2010 jilles

sh(1): Document that command's -p option also works with -v/-V.

This was implemented in r201343.


215783 23-Nov-2010 jilles

sh: Code size optimizations to "stack string" memory allocation:
* Prefer one CHECKSTRSPACE with multiple USTPUTC to multiple STPUTC.
* Add STPUTS macro (based on function) and use it instead of loops that add
nul-terminated strings to the stack string.

No functional change is intended, but code size is about 1K less on i386.


215766 23-Nov-2010 jilles

sh: Pass multiple bytes at a time to lex.

This speeds up the expansion/arith6.0 test considerably.


215727 22-Nov-2010 jilles

sh: Fix confusing behaviour if chdir succeeded but getcwd failed in cd -P.

If getcwd fails, do not treat this as an error, but print a warning and
unset PWD. This is similar to the behaviour when starting the shell in a
directory whose name cannot be determined.


215704 22-Nov-2010 brucec

Fix some more warnings found by clang.


215568 20-Nov-2010 jilles

sh: Remove the check that alpha/name/in_name chars are not CTL* bytes.

Since is_alpha/is_name/is_in_name were made ASCII-only, this can no longer
happen.

Additionally, the check was wrong because it did not include the new
CTLQUOTEEND.


215567 20-Nov-2010 jilles

sh: Code size optimizations to buffered output.

This is mainly less use of the outc macro.

No functional change is intended, but code size is about 2K less on i386.


215520 19-Nov-2010 jilles

sh: Add printf builtin.

This was removed in 2001 but I think it is appropriate to add it back:
* I do not want to encourage people to write fragile and non-portable echo
commands by making printf much slower than echo.
* Recent versions of Autoconf use it a lot.
* Almost no software still wants to support systems that do not have
printf(1) at all.
* In many other shells printf is already a builtin.

Side effect: printf is now always the builtin version (which behaves
identically to /usr/bin/printf) and cannot be overridden via PATH (except
via the undocumented %builtin mechanism).

Code size increases about 5K on i386. Embedded folks might want to replace
/usr/bin/printf with a hard link to /usr/bin/alias.


215303 14-Nov-2010 jilles

sh: Add binary buffered output for use by the printf builtin.


215268 13-Nov-2010 jilles

sh: Update the suspend example for the change of the job control flag
from -j to -m, many years ago.

Due to r215266, this function now actually works.


215266 13-Nov-2010 jilles

sh: Do the additional actions if 'local -' restore changes -i/-m/-E/-V.

Example:
f() { local -; set +m; }; f
caused failure to execute external programs because the job control tty fd
was not opened.


215211 12-Nov-2010 jilles

echo(1): Clarify portability and mention literal "--" handling.

MFC after: 1 week


215210 12-Nov-2010 jilles

sh(1): Document r214304 (special builtin is illegal function name).


215209 12-Nov-2010 jilles

sh(1): Update for r214492. "${v+"hi}there"}".

The part hi}there is not a quoted string but nevertheless the closing brace
does not terminate the expansion.


215184 12-Nov-2010 jilles

sh: Remove unused man page for echo builtin.

The information in sh(1) about the echo builtin is equivalent, though less
extensive.

The echo(1) man page (bin/echo/echo.1) is different.

Unfortunately, sh's echo builtin and /bin/echo have gone out of sync and
this probably cannot be fixed any more.

Reported by: uqs (list of untouched files)
MFC after: 1 week


215181 12-Nov-2010 jilles

sh(1): Modernize the introduction a bit.

In particular, remove the text about ksh-like features, which are usually
taken for granted nowadays. The original Bourne shell is fading away and for
most users our /bin/sh is one of the most minimalistic they know.


215022 08-Nov-2010 jilles

test: Move tests to tools/regression/bin/test.
Convert the tests to the perl prove format.
Remove obsolete TEST.README (results of an old TEST.sh for some old Unices)
and TEST.csh (old tests without correct values, far less complete than
TEST.sh).

MFC after: 1 week


214709 02-Nov-2010 jilles

sh: Fix some issues with aliases and case, by importing dash checkkwd code.

This moves the function of the noaliases variable into the checkkwd
variable. This way it is properly reset on errors and aliases can be used
normally in the commands for each case (the case labels recognize the
keyword esac but no aliases).

The new code is clearer as well.

Obtained from: dash


214680 02-Nov-2010 ed

Add a new libc function: cfmakesane(3).

I've noticed various terminal emulators that need to obtain a sane
default termios structure use very complex `hacks'. Even though POSIX
doesn't provide any functionality for this, extend our termios API with
cfmakesane(3), which is similar to the commonly supported cfmakeraw(3),
except that it fills the termios structure with sane defaults.

Change all code in our base system to use this function, instead of
depending on <sys/ttydefaults.h> to provide TTYDEF_*.


214609 31-Oct-2010 jilles

sh(1): Correct synopsis and make precise how $0 is set.

In particular, the extra argument to set $0 with -c was not documented.

MFC after: 1 week


214604 31-Oct-2010 uqs

Fix typo and grammar nit

Submitted by: arundel
MFC after: 7 days (or when the bikeshed has abated)


214600 31-Oct-2010 jilles

sh: Reindent evaltree().


214599 31-Oct-2010 jilles

sh: Use iteration instead of recursion to evaluate semicolon lists.
This reduces CPU and memory usage when executing long lists (such
as long functions).


214596 31-Oct-2010 uqs

Elaborate some more on the non-security implications of using -P

Submitted by: delphij
Discussion at: svn-src-all


214538 29-Oct-2010 jilles

sh: Tweak some string constants to reduce code size.

* Reduce some needless differences.
* Shorten some error messages that should not happen.


214534 29-Oct-2010 jilles

sh: Reject function names ending in one of !%*+-=?@}~

These do something else in ksh: name=(...) is an array or compound variable
assignment and the others are extended patterns.

This is the last patch of the ones tested in the exp run.

Exp-run done by: pav (with some other sh(1) changes)


214531 29-Oct-2010 jilles

sh: Detect various additional errors in the parser.

Apart from detecting breakage earlier or at all, this also fixes a segfault
in the testsuite. The "handling" of the breakage left an invalid internal
representation in some cases.

Examples:
echo a; do echo b
echo `) echo a`
echo `date; do do do`

Exp-run done by: pav (with some other sh(1) changes)


214525 29-Oct-2010 jilles

sh: Error out on various specials/keywords in the wrong place in backticks.

Example:
echo `date)`

Exp-run done by: pav (with some other sh(1) changes)
Obtained from: NetBSD (Christos Zoulas, NetBSD PR 11317)


214524 29-Oct-2010 jilles

sh: Fix some issues with CTL* bytes and ${var#pat}.

subevalvar() incorrectly assumed that CTLESC bytes were present iff the
expansion was quoted. However, they are present iff various processing such
as word splitting is to be done later on.

Example:
v=@$e@$e@$e@
y="${v##*"$e"}"
echo "$y"
failed if $e contained the magic CTLESC byte.

Exp-run done by: pav (with some other sh(1) changes)


214512 29-Oct-2010 jilles

sh: Do IFS splitting on word in ${v+word} and ${v-word}.

The code is inspired by NetBSD sh somewhat, but different because we
preserve the old Almquist/Bourne/Korn ability to have an unquoted part in a
quoted ${v+word}. For example, "${v-"*"}" expands to $v as a single field if
v is set, but generates filenames otherwise.

Note that this is the only place where we split text literally from the
script (the similar ${v=word} assigns to v and then expands $v). The parser
must now add additional markers to allow the expansion code to know whether
arbitrary characters in substitutions are quoted.

Example:
for i in ${$+a b c}; do echo $i; done

Exp-run done by: pav (with some other sh(1) changes)


214492 28-Oct-2010 jilles

sh: Only accept a '}' inside ${v+-=?...} if double-quote state matches.
If double-quote state does not match, treat the '}' literally.

This ensures double-quote state remains the same before and after a
${v+-=?...} which helps with expand.c.

It makes things like
${foo+"\${bar}"}
which I have seen in the wild work as expected.

Exp-run done by: pav (with some other sh(1) changes)


214490 28-Oct-2010 jilles

sh: Make double-quotes quote a '}' inside ${v#...} and ${v%...}.

Exp-run done by: pav (with some other sh(1) changes)
PR: bin/57554


214431 27-Oct-2010 des

Language cleanup.


214305 24-Oct-2010 jilles

sh: Ignore double-quotes in arithmetic rather than treating them as quotes.

This provides similar behaviour, but allows a simpler parser.

This changes r206473.

Exp-run done by: pav (with some other sh(1) changes)


214304 24-Oct-2010 jilles

sh: Do not allow overriding a special builtin with a function.
This is a syntax error.

POSIX does not say explicitly whether defining a function with the same name
as a special builtin is allowed, but it does say that it is impossible to
call such a function.

A special builtin can still be overridden with an alias.

This commit is part of a set of changes that will ensure that when
something looks like a special builtin to the parser, it is one. (Not the
other way around, as it remains possible to call a special builtin named
by a variable or other substitution.)

Exp-run done by: pav (with some other sh(1) changes)


214291 24-Oct-2010 jilles

sh: Make sure defined functions can actually be called.

Add some conservative checks on function names:
- Disallow expansions or quoting characters; these can only be called via
strange control characters
- Disallow '/'; these functions cannot be called anyway, as exec.c assumes
they are pathnames
- Make the CTL* bytes work properly in function names.

These are syntax errors.

POSIX does not require us to support more than names (letters, digits and
underscores, not starting with a digit), but I do not want to restrict it
that much at this time.

Exp-run done by: pav (with some other sh(1) changes)


214290 24-Oct-2010 jilles

sh: Check whether dup2 was successful for >&FD and <&FD.

A failure (usually caused by FD not being open) is a redirection error.

Exp-run done by: pav (with some other sh(1) changes)


214281 24-Oct-2010 jilles

sh: Change ! within a pipeline to start a new pipeline instead.

This is how ksh93 treats ! within a pipeline and makes the ! in
a | ! b | c
negate the exit status of the pipeline, as if it were
a | { ! b | c; }

Side effect: something like
f() ! a
is now a syntax error, because a function definition takes a command,
not a pipeline.

Exp-run done by: pav (with some other sh(1) changes)


213926 16-Oct-2010 jilles

sh(1): Clarify subshells/processes for pipelines.

For multi-command pipelines,
1. all commands are direct children of the shell (unlike the original
Bourne shell)
2. all commands are executed in a subshell (unlike the real Korn shell)

MFC after: 1 week


213925 16-Oct-2010 jilles

sh: Use <stddef.h> rather than <sys/stddef.h>.

<sys/stddef.h> is only for the kernel and conflicts with <stddef.h>.


213815 13-Oct-2010 obrien

We only need to look as far as '..' to find 'test/'.


213814 13-Oct-2010 obrien

Do not assume in growstackstr() that a "precious" character will be
immediately written into the stack after the call. Instead let the caller
manage the "space left".

Previously, growstackstr()'s assumption causes problems with STACKSTRNUL()
where we want to be able to turn a stack into a C string, and later
pretend the NUL is not there.

This fixes a bug in STACKSTRNUL() (that grew the stack) where:
1. STADJUST() called after a STACKSTRNUL() results in an improper adjust.
This can be seen in ${var%pattern} and ${var%%pattern} evaluation.
2. Memory leak in STPUTC() called after a STACKSTRNUL().

Reviewed by: jilles


213811 13-Oct-2010 obrien

In the spirit of r90111, depend on c89 and remove the "STATIC" macro
and its usage.


213798 13-Oct-2010 obrien

If one wishes to set breakpoints of static the functions here, they
cannot be inlined.

Submitted by: jhb


213775 13-Oct-2010 jhb

Make DEBUG traces 64-bit clean:
- Use %t to print ptrdiff_t values.
- Cast a ptrdiff_t value explicitly to int for a field width specifier.

While here, sort includes.

Submitted by: Garrett Cooper


213774 13-Oct-2010 jhb

Suggest that DEBUG_FLAGS be used to enable extra debugging rather than
frobbing CFLAGS directly. DEBUG_FLAGS is something that can be specified
on the make command line without having to edit the Makefile directly.

Submitted by: Garrett Cooper


213760 13-Oct-2010 obrien

Consistently use "STATIC" for all functions in order to be able to set
breakpoints with in a debugger. And use naked "static" for variables.

Noticed by: bde


213744 12-Oct-2010 obrien

If DEBUG is 3 or greater, disable STATICization of functions.
Also correct the documented location of the trace file.


213738 12-Oct-2010 obrien

Allow one to regression test 'sh' changes without having to install
a potentially bad /bin/sh first.


213582 08-Oct-2010 uqs

rm(1): clarify that -P works only when blocks are updated in-place

Suggested by: pjd, ivoras, arundel


213573 08-Oct-2010 uqs

mdoc: drop redundant .Pp and .LP calls

They have no effect when coming in pairs, or before .Bl/.Bd


213536 08-Oct-2010 emaste

Make a thread's address available via the kern proc sysctl, just like the
process address.

Add "tdaddr" keyword to ps(1) to display this thread address.

Distilled from Sandvine's patch set by Mark Johnston.


213398 04-Oct-2010 delphij

Clarify the combination effect of -P and -f to make it clear.

Submitted by: arundel
MFC after: 2 weeks


213012 22-Sep-2010 emaste

Correct sort order.


212515 13-Sep-2010 imp

Merge from tbemd:
Add directory names directly and sort at the end.
Include bsd.arch.inc.mk so we can, in the future, more easily make arch
dependent changes in /bin (unlikely, but is needed for symmetry).


212508 12-Sep-2010 jilles

sh: Add __dead2 to two functions that do not return.

Apart from helping static analyzers, this also appears to reduce the size of
the binary slightly.


212475 11-Sep-2010 jilles

sh: Fix exit status if return is used within a loop condition.


212467 11-Sep-2010 jilles

sh: Apply variable assignments left-to-right in bltinlookup().

Example:
HOME=foo HOME=bar cd


212463 11-Sep-2010 brucec

Revert changes of 'assure' to 'ensure' made in r211936.

Approved by: rrs (mentor)


212419 10-Sep-2010 jilles

test(1): Fix markup, ( and ) must be separate arguments so leave spaces.

MFC after: 1 week


212418 10-Sep-2010 jilles

test(1): Clarify grammar ambiguity and -a/-o vs shell &&/||.


212417 10-Sep-2010 jilles

sh(1): Remove xrefs for expr(1) and getopt(1).

expr(1) should usually not be used as various forms of parameter expansion
and arithmetic expansion replicate most of its functionality in an easier
way.

getopt(1) should not be used at all in new code. Instead, getopts(1) or
entirely manual parsing should be used.

MFC after: 1 week


212390 09-Sep-2010 jilles

expr(1): Add sh(1) versions of examples, remove an incorrect example.

The three examples are better done using sh(1) itself these days.

The example
expr -- "$a" : ".*"
is incorrect in the general case, as "$a" may be an operator.

MFC after: 2 weeks


212339 08-Sep-2010 jilles

sh: Fix 'read' if all chars before the first IFS char are backslash-escaped.

Backslash-escaped characters did not set the flag for a non-IFS character.

MFC after: 2 weeks


212243 05-Sep-2010 jilles

sh: Improve comments in expand.c.


212214 04-Sep-2010 jilles

sh: Get rid of some magic numbers.

MFC after: 1 week


212190 03-Sep-2010 jilles

sh: Do not use locale for determining if something is a name.

This makes it impossible to use locale-specific characters in variable
names.

Names containing locale-specific characters make scripts only work with the
correct locale setting. Also, they did not even work in many practical cases
because multibyte character sets such as utf-8 are not supported.

This also avoids weirdness if LC_CTYPE is changed in the middle of a script.


211965 29-Aug-2010 brian

Touch the man page date after updating the ustar limitations.

MFC after: 3 weeks


211963 29-Aug-2010 brian

Correct an out-by-one error when earlying out ustar filenames that
are too long. Filenames escaping this test are caught later on,
so the bug doesn't cause any breakage.

Document the correct ustar limitations in pax. As I have no access
to the IEEE 1003.2 spec, I can only assume that the limitations
imposed are in fact correct.

Add regression tests for the filename limitations imposed by pax.

MFC after: 3 weeks


211936 28-Aug-2010 brucec

Fix incorrect usage of 'assure' and 'insure'.

Approved by: rrs (mentor)


211864 27-Aug-2010 brian

Fix an off-by-one error where we try to split a path name that's
more than 100 characters long and the 101th last character is a
'/'.

MFC after: 3 weeks


211646 22-Aug-2010 jilles

sh: Remove remnants of '!!' to negate pattern.

This Almquist extension was disabled long ago.

In pathname generation, components starting with '!!' were treated as
containing wildcards, causing unnecessary readdir (which could fail, causing
pathname generation to fail while it should not).


211621 22-Aug-2010 jilles

sh(1): Add a brief summary of arithmetic expressions.


211349 15-Aug-2010 jilles

sh: Fix break/continue/return sometimes not skipping the rest of dot script.

In our implementation and most others, a break or continue in a dot script
can break or continue a loop outside the dot script. This should cause all
further commands in the dot script to be skipped. However, cmdloop() did not
know about this and continued to parse and execute commands from the dot
script.

As described in the man page, a return in a dot script in a function returns
from the function, not only from the dot script. There was a similar issue
as with break and continue. In various other shells, the return appears to
return from the dot script, but POSIX seems not very clear about this.


211287 13-Aug-2010 jilles

sh: Add a forgotten const.


211281 13-Aug-2010 jilles

sh: Fix shadowing of sigset.


211155 10-Aug-2010 jilles

sh: Fix heap-based buffer overflow in pathname generation.

The buffer for generated pathnames could be too small in some cases. It
happened to be always at least PATH_MAX long, so there was never an overflow
if the resulting pathnames would be usable.

This bug may be abused if a script subjects input from an untrusted source
to pathname generation, which a bad idea anyhow. Most shell scripts do not
work on untrusted data. secteam@ says no advisory is necessary.

PR: bin/148733
Reported by: Changming Sun snnn119 at gmail com
MFC after: 10 days


211084 08-Aug-2010 jilles

Remove unnecessary duplicate letters in mksyntax.c,
the table elements would just be overwritten twice.


210829 03-Aug-2010 jilles

sh: Return 0 from eval if no command was given.

This makes a difference if there is a command substitution.

To make this work, evalstring() has been changed to set exitstatus to 0 if
no command was executed (the string contained only whitespace).

Example:
eval $(false); echo $?
should print 0.


210750 02-Aug-2010 kib

Document the new argument parser for sleep(1) and SIGINFO behaviour.
Remove higlight for the unportability notice.

MFC after: 3 weeks


210749 02-Aug-2010 kib

Simplify argument parser by using sscanf(); simplify usage() by not
refusing to use stdio.
Reduce nesting level in the sleep loop by returning earlier for negative
timeouts.
Limit the maximum timeout to INT_MAX seconds.

Submitted by: bde
MFC after: 3 weeks


210736 01-Aug-2010 jilles

sh: Do not enter consecutive duplicates into the history.

This simply sets a flag in libedit. It has a shortcoming in that it does not
apply to multi-line commands.

Note that a configuration option for this is not going to happen, but always
having this seems better than not having it. NetBSD has done the same.

PR: bin/54683
Obtained from: NetBSD
MFC after: 1 month


210702 31-Jul-2010 joel

Spelling fixes.


210696 31-Jul-2010 kib

Deal with proper format for printing time_t.

Reported by: ache
MFC after: 3 weeks


210679 31-Jul-2010 kib

Report the time left for the sleep on SIGINFO.
Be stricter in the checking of interval specification.

PR: bin/139345
MFC after: 3 weeks


210613 29-Jul-2010 jilles

kill: Stop processing if a syntactically invalid pid is encountered.

So a command like
kill _HUP 1
now fails without sending SIGTERM to init.

The behaviour when kill(2) fails remains unchanged: processing continues.
This matches other implementations and POSIX and is useful for killing
multiple processes at once when some of them may already be gone.

PR: bin/40282


210546 27-Jul-2010 bcr

Typo fix: s/ommited/omitted

MFC after: 4 days


210488 25-Jul-2010 jilles

sh: Fix crash due to uninitialized here-document.

If an ; or & token was followed by an EOF token, pending here-documents were
left uninitialized. Execution would crash, either in the main shell process
for literal here-documents or in a child process for expanded
here-documents. In the latter case the problem is hard to detect apart from
the core dumps and log messages.

Side effect: slightly different retries on inputs where EOF is not
persistent.

Note that tools/regression/bin/sh/parser/heredoc6.0 still causes a similar
crash in a child process. The text passed to eval is malformed and should be
rejected.


210448 24-Jul-2010 trasz

Fix alignment for the 'flags' label, and make more room for 'tdev'.

MFC after: 1 month


210447 24-Jul-2010 trasz

Add P_HASTHREADS flag description.


210221 18-Jul-2010 jilles

sh: Allow a background command consisting solely of redirections.

Example:
</dev/null &

MFC after: 2 weeks


210087 14-Jul-2010 jilles

sh: There cannot be a TNOT in simplecmd(), remove checks.

simplecmd() only handles simple commands and function definitions, neither
of which involves the ! keyword. The initial token on entry to simplecmd()
is one of the following: TSEMI, TAND, TOR, TNL, TEOF, TWORD, TRP.


209924 12-Jul-2010 brian

Add -l to the synopsis

Submitted by: jhell at dataix dot net
MFC after: 3 days


209653 02-Jul-2010 jilles

sh: Use $PWD instead of getcwd() for the \w and \W prompt expansions.

This ensures that the logical working directory (which may include
symlinks) is shown and is similar to the default behaviour of the pwd
builtin.


209600 29-Jun-2010 jilles

sh: Forget about terminated background processes sooner.

Unless $! has been referenced for a particular job or $! still contains that
job's pid, forget about it after it has terminated. If $! has been
referenced, remember the job until the wait builtin has reported its
completion (either with the pid as parameter or without parameters).

In interactive mode, jobs are forgotten after termination has been reported,
which happens before primary prompts and through the jobs builtin. Even
then, though, remember a job if $! has been referenced.

This is similar to what is suggested by POSIX and should fix most memory
leaks (which also tend to cause sh to use more CPU time) with long running
scripts that start background jobs.

Caveats:
* Repeatedly referencing $! without ever doing 'wait', like
while :; do foo & echo started foo: $!; sleep 60; done
will still use a lot of memory and CPU time in the long run.
* The jobs and jobid builtins do not cause a job to be remembered for longer
like expanding $! does.

PR: bin/55346


209363 20-Jun-2010 brian

Recognise the -l switch with pkill - list kill command(s) used.

PR: 143558
Submitted by: eitanadlerlist at gmail dot com
MFC after: 3 weeks


209337 19-Jun-2010 jilles

sh: Fix compilation with -DNO_HISTORY.

The LINENO code uses snprintf() and relied on "myhistedit.h" to pull in the
necessary <stdio.h>.

Compiling with -DNO_HISTORY disables all editing and history support and
allows linking without -ledit -ltermcap. This may be useful for embedded
systems.

MFC after: 2 weeks


209221 15-Jun-2010 jilles

sh: Add filename completion.

This uses the new libedit completion function with quoting support.

Unlike NetBSD, there is no 'set +o tabcomplete' option to disable
completion. I do not see any reason for such a special treatment, as
completion is rather useful and it is possible to do
bind ^I ed-insert
to disable completion and insert a tab character instead.

Submitted by: Guy Yur


209034 11-Jun-2010 uqs

More mdoc nitpicking to improve compatibility to mdocml

- .Nd in section NAME is not optional
- .Ed was missing
- "indent" is not a flag, but a literal argument for -offset
- stop switching font sizes for acronyms
- use .Brq instead of rolling our own


208881 06-Jun-2010 jilles

sh: Pass through SIGINT from a child if interactive and job control
is enabled.

This already worked if without job control.

In either case, this depends on it that a process that terminates due to
SIGINT exits on it (so not with status 1, or worse, 0).

Example:
sleep 5; echo continued
This does not print "continued" any more if sleep is aborted via ctrl+c.

MFC after: 1 month


208821 05-Jun-2010 trasz

Don't try to copy a socket after "xxx is a socket (not copied)." message.
Previously, it would either try to copy it anyway and fail (without -R),
or create fifo instead of the socket (with -R).

Found with: Coverity Prevent
CID: 5623
MFC after: 2 weeks


208795 04-Jun-2010 brian

Explain that setting an absolute day value can fail and that the month should
usually be set first when using -v.

Adjust an example that sets the day to 30 before setting the month to 3 in
accordance with this approach as the example would always fail in February!

PR: 147354
MFC after: 2 weeks


208755 02-Jun-2010 jilles

sh: Pass TERM changes to libedit.

I have changed the patch slightly to ignore TERM changes in subshells.

PR: bin/146916
Submitted by: Guy Yur
Obtained from: NetBSD


208730 02-Jun-2010 uqs

Zero struct before reading from it

PR: 140384
Found by: clang static analyzer
MFC after: 3 weeks


208656 30-May-2010 jilles

sh: Fix a crash if a heredoc was not properly ended and parsing continued.

Example (in interactive mode):
cat <<EOF && )
The next command typed caused sh to segfault, because the state for the here
document was not reset.

Like parser_temp, this uses the fact that the parser is not re-entered.


208655 30-May-2010 jilles

sh: Change interaction of command substitution and here documents.

If a command substitution contains a newline token, this no longer starts
here documents of outer commands. This way, we follow POSIX's idea of the
command substitution being a separate script more closely. It also matches
other shells better and is consistent with newline characters in quotes not
starting here documents.

The extension tested in parser/heredoc3.0 ($(cat <<EOF)\ntext\nEOF\n)
continues to be supported.

In particular, this change allows things like
cat <<EOF && echo `pwd`
(a `` command substitution after a here document)
which formerly silently used an empty file as the here document, because the
EOF of the inner command "pwd" also forced an empty here document.


208630 28-May-2010 jilles

sh: Recognize "--" in . and exec.

Although "--" historically has not been required to be recognized for
certain special builtins that do not take options in POSIX, some other
implementations recognize options for them, requiring scripts to use "--" or
avoid operands starting with "-".

Operands starting with "-" can be avoided with eval by prepending a space,
and cannot occur with break, continue, exit, return and shift as they only
take numbers, nor with times as it does not take operands. With . and exec,
avoiding "-" is not so easy as it may require reimplementing the PATH
search; therefore the current proposal for POSIX is to require recognition
of "--" for them.

We continue to accept other strings starting with "-" as operands to . and
exec, and also "--" if it is alone to . (which would otherwise be invalid
anyway).


208505 24-May-2010 jilles

sh(1): Rework documentation of shell variables.

* Move the "environment variables" that do not need exporting to be
effective or that are set by the shell without exporting to a new section
"Special Variables".
* Add special variables LINENO and PPID.
* Add environment variables LANG, LC_* and PWD; also describe ENV under
environment variables.


208501 24-May-2010 jilles

sh(1): Improve wording of 'Special Parameters' section.


208489 24-May-2010 jilles

sh: Reap any zombies before forking for a background command.

This prevents accumulating huge amounts of zombies if a script executes
many background commands but no external commands or subshells.

Note that zombies will not be reaped during long calculations (within
the shell process) or read builtins, but those actions do not create
more zombies.

The terminated background commands will also still be remembered by the
shell.

PR: bin/55346


208484 24-May-2010 uqs

Fix back references in substitute command for pax(1)

pax(1) was trying to copy the back-referenced data from
the match pattern, not the matched data.

PR: bin/118132
Obtained from: Debian bug #451361
Reviewed by: jilles
MFC after: 3 weeks


208035 13-May-2010 trasz

Update authors and history.

MFC after: 1 week


207944 11-May-2010 jilles

sh: Fix pathname expansion with quoted slashes like *\/.

These are git commits 36f0fa8fcbc8c7b2b194addd29100fb40e73e4e9 and
d6d06ff5c2ea0fa44becc5ef4340e5f2f15073e4 in dash.

Because this is the first code I'm importing from dash to expand.c, add the
Herbert Xu copyright notice which is in dash's expand.c.

When pathname expanding *\/, the CTLESC representing the quoted state was
erroneously taken as part of the * pathname component. This CTLESC was then
seen by the pattern matching code as escaping the '\0' terminating the
string.

The code is slightly different because dash converts the CTLESC characters
to backslashes and removes all the other CTL* characters to allow
substituting glob(3).

The effect of the bug was also slightly different from dash (where nothing
matched at all). Because a CTLESC can escape a '\0' in some way, whether
files were included despite the bug depended on memory that should not be
read. In particular, on many machines /*\/ expanded to a strict subset of
what /*/ expanded to.

Example:
echo /*"/null"

This should print /dev/null, not /*/null.

PR: bin/146378
Obtained from: dash


207831 09-May-2010 jilles

sh(1): Fix "reserved word" vs "keyword" inconsistency.
Use "keyword" everywhere, like the output of the 'type' builtin, and only
mention "reserved word" once to say it is the same thing.


207783 08-May-2010 jilles

sh: Have only one copy of _PATH_STDPATH in the binary.


207678 05-May-2010 jilles

sh: Apply locale vars on builtins, recognize LC_MESSAGES as a locale var.

This allows doing things like LC_ALL=C some_builtin to run a builtin under a
different locale, just like is possible with external programs. The
immediate reason is that this allows making printf(1) a builtin without
breaking things like LC_NUMERIC=C printf '%f\n' 1.2

This change also affects special builtins, as even though the assignment is
persistent, the export is only to the builtin (unless the variable was
already exported).

Note: for this to work for builtins that also exist as external programs
such as /bin/test, the setlocale() call must be under #ifndef SHELL. The
shell will do the setlocale() calls which may not agree with the environment
variables.


207206 25-Apr-2010 jilles

sh: Use stalloc for arith variable names.

This is simpler than the custom memory tracker I added earlier, and is also
needed by the dash arith code I plan to import.


207189 25-Apr-2010 jilles

symlink(7): Add lpathconf(2) and *at system calls.

MFC after: 1 week


207188 25-Apr-2010 jilles

symlink(7): The ownership of symlinks is used by the system,
in at least three ways, so do not say it is ignored:
* who may delete/rename a symlink in a sticky directory
* who may do lchflags(2)/lchown(2)/lchmod(2)
* whose inode quota is charged

MFC after: 1 week


207021 21-Apr-2010 jilles

ln: Allow a trailing slash when creating a link to a directory.

In the 'ln source... directory' synopsis, the basename of each source
determines the name of the created link. Determine this using basename(3)
instead of strrchr(..., '/') which is incorrect if the pathname ends in a
slash.

The patch is somewhat changed to allow for basename(3) implementations that
change the passed pathname, and to fix the -w option's checking also.
The code to compare directory entries only applies to hard links, which
cannot be created to directories using ln.

Example:
ln -s /etc/defaults/ /tmp
This should create a symlink named defaults.

PR: 121568
Submitted by: Ighighi
MFC after: 1 week


206773 17-Apr-2010 jilles

ln: Refuse deleting a directory entry by hardlinking it to itself.

Two pathnames refer to the same directory entry iff the directories match
and the final components' names match.

Example: (assuming file1 is an existing file)
ln -f file1 file1
This now fails while leaving file1 intact. It used to delete file1 and then
complain it cannot be linked because it is gone.

With -i, this error is detected before the question is asked.

MFC after: 2 weeks


206759 17-Apr-2010 jilles

sh: On startup of the shell, use PWD from the environment if it is valid.
Unset PWD if it is incorrect and no value for it can be determined.
This preserves the logical current directory across shell invocations.

Example (assuming /home is a symlink):
$ cd
$ pwd
/home/foo
$ sh
$ pwd
/home/foo

Formerly the second pwd would show the physical path (symlinks resolved).


206622 14-Apr-2010 uqs

mdoc: order prologue macros consistently by Dd/Dt/Os

Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by: ru
Approved by: philip, ed (mentors)


206548 13-Apr-2010 kib

Update the list of the process flags for P_WKILLED.

MFC after: 4 weeks


206473 11-Apr-2010 jilles

sh: Partially revert r206146, allowing double-quotes in arithmetic.

These do pretty much nothing (except that parentheses are ignored), but
people seem to use them and allowing them does not hurt much.

Single-quotes seem not to be used and cause silently different behaviour
with ksh93 character constants.


206182 05-Apr-2010 jilles

sh: Automatically enable -o emacs in interactive shells with terminals.

This makes sh a bit more friendly in single user mode, make buildenv, chroot
and the like, and matches other shells.

The -o emacs can be overridden on the command line or in the ENV file.


206158 04-Apr-2010 jilles

sh: Document the expansion changes in the man page.

Note that the following sentence
> Enclosing the full parameter expansion string in double-quotes does not
> cause the following four varieties of pattern characters to be quoted,
> whereas quoting characters within the braces has this effect.
is now true, but used to be incorrect.


206150 03-Apr-2010 jilles

sh: Do tilde expansion in substitutions.

This applies to word in ${v-word}, ${v+word}, ${v=word}, ${v?word} (which
inherits quoting from the outside) and in ${v%word}, ${v%%word}, ${v#word},
${v##word} (which does not inherit any quoting).

In all cases tilde expansion is only attempted at the start of word, even if
word contains spaces. This agrees with POSIX and other shells.

This is the last part of the patch tested in the exp-run.

Exp-run done by: erwin (with some other sh(1) changes)


206147 03-Apr-2010 jilles

sh: Allow quoting pattern match characters in ${v%pat} and ${v#pat}.

Note that this depends on r206145 for allowing pattern match characters to
have their special meaning inside a double-quoted expansion like "${v%pat}".

PR: bin/117748
Exp-run done by: erwin (with some other sh(1) changes)


206146 03-Apr-2010 jilles

sh: Remove special handling for ' and " in arithmetic.
They will be treated like normal characters, resulting in a runtime
arithmetic expression error.

Exp-run done by: erwin (with some other sh(1) changes)


206145 03-Apr-2010 jilles

sh: Fix various things about expansions:
* remove the backslash from \} inside double quotes inside +-=?
substitutions, e.g. "${$+\}a}"
* maintain separate double-quote state for ${v#...} and ${v%...};
single and double quotes are special inside, even in a double-quoted
string or here document
* keep track of correct order of substitutions and arithmetic

This is different from dash's approach, which does not track individual
double quotes in the parser, trying to fix this up during expansion.
This treats single quotes inside "${v#...}" incorrectly, however.

This is similar to NetBSD's approach (as submitted in PR bin/57554), but
recognizes the difference between +-=? and #% substitutions hinted at in
POSIX and is more refined for arithmetic expansion and here documents.

PR: bin/57554
Exp-run done by: erwin (with some other sh(1) changes)


206144 03-Apr-2010 jilles

sh: Treat unexpected newlines in substitutions as a syntax error.

The old approach was wrong because PS2 was not used and seems unlikely to
parse extensions (ksh93's ${ COMMAND} may well fail to parse).

Exp-run done by: erwin (with some other sh(1) changes)


205942 30-Mar-2010 delphij

Merge OpenBSD revisions 1.4 through 1.9, mostly style cleanups.

Obtained from: OpenBSD
MFC after: 3 month


205940 30-Mar-2010 delphij

Remove unused files.


205793 28-Mar-2010 ed

Change all our own code to use st_*tim instead of st_*timespec.

Also remove some local patches to diff(1) which are now unneeded.


205271 17-Mar-2010 jmallett

o) Add a keyword to displaying elapsed time in integer seconds, "etimes".
o) Give slightly better (i.e. any) documentation of the format of "etime".

Reviewed by: jilles


205154 14-Mar-2010 jilles

sh: Do not abort on a redirection error on a compound command.

Redirection errors on subshells already did not abort the shell because
the redirection is executed in the subshell.

Other shells seem to agree that these redirection errors should not abort
the shell.

Also ensure that the redirections will be cleaned up properly in cases like
command eval '{ shift x; } 2>/dev/null'

Example:
{ echo bad; } </var/empty/x; echo good


205138 13-Mar-2010 jilles

sh: Do not abort on a redirection error if there is no command word.

Although simple commands without a command word (only assignments and/or
redirections) are much like special builtins, POSIX and most shells seem to
agree that redirection errors should not abort the shell in this case. Of
course, the assignments persist and assignment errors are fatal.

To get the old behaviour portably, use the ':' special builtin.
To get the new behaviour portably, given that there are no assignments, use
the 'true' regular builtin.


205130 13-Mar-2010 jilles

sh: Fix longjmp clobber warnings in parser.c.

Make parsebackq a function instead of an emulated nested function.
This puts the setjmp usage in a smaller function where it is easier to avoid
bad optimizations.


204819 07-Mar-2010 joel

Switch to our preferred license text.

Approved by: jedgar


204802 06-Mar-2010 jilles

sh: Make sure to popredir() even if a function caused an error.


204801 06-Mar-2010 jilles

sh: Make sure to popredir() even if a special builtin caused an error.


204800 06-Mar-2010 jilles

sh: Improve the command builtin:
* avoid unnecessary fork
* allow executing builtins via command
* executing a special builtin via command removes its special properties

Obtained from: NetBSD (parts)


204755 05-Mar-2010 kib

Update the list of the process flags. Note that the lists of pending
signals for process and its threads are distinct.

Reviewed by: jilles
MFC after: 2 weeks


204711 04-Mar-2010 uqs

ed(1): make WARNS=6 clean

Although argc and argv are never read after the longjmp is complete,
gcc is not clever enough to see that and needlessly warns about it.
So add volatile to silence the compiler.

Approved by: ed (the co-mentor, not ed(1))


204553 02-Mar-2010 joel

The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Approved by: pjd
Obtained from: NetBSD


204308 25-Feb-2010 kib

Do not restrict the allowed signals that can be specified by number
to the list of signals that has symbolic name. It was impossible to
send rt signals with kill(1) due to the check.

MFC after: 1 week


204276 24-Feb-2010 jh

Fix expansion of \W in prompt strings when the working directory is "/".
The prompt string was truncated after \W when the working directory was "/".

PR: bin/89410
Submitted by: Dr Balwinder Singh Dheeman
MFC after: 1 week


203916 15-Feb-2010 uqs

Bump WARNS where possible.

Checked by: make universe
Approved by: ed (co-mentor)


203802 12-Feb-2010 pjd

- Implement -q option for pgrep(1).
- Add regression test to test -q option.


203688 08-Feb-2010 brucec

Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This allows the -M option to be used without specifying -N.

PR: bin/138146
Approved by: rrs (mentor)
MFC after: 3 days


203665 08-Feb-2010 jh

Make sure that FTS_COMFOLLOW is not set when the -P option is in effect.
Otherwise the -i option will show the inode number of the referenced file
for symbolic links given on the command line. Similarly, the file color
was printed according to the link target in colorized output.

PR: bin/102394
Reviewed by: jilles
MFC after: 2 weeks


203613 07-Feb-2010 imp

Tell the compiler these structures are aligned to a byte boundary.
All the elements of these structs are char anyway, so it won't hurt
performance.

Bump warns back up to the default.

# we likely should have CTASSERTS to make sure they are the right size.
# but with libarchive based tar maybe we shouldn't bother.


203576 06-Feb-2010 jilles

sh: Do not stat() $MAIL/$MAILPATH in non-interactive shells.

These may be NFS mounted, and we should not touch them unless we are going
to do something useful with the information.


203480 04-Feb-2010 imp

Arm doesn't seem to need such kit gloves. Bump the warnings to 3 here
as well.


202945 24-Jan-2010 jh

Fixes for ls(1) long format (-l) output:

- Allow -h option to work if the listing contains at least one device
file.
- Align major and minor device numbers correctly to the size field.

PR: bin/125678
Approved by: trasz (mentor)
MFC after: 1 month


202944 24-Jan-2010 jh

Print full path in the error message. It's possible that fts(3)
provides an empty fts_name and reporting the full path is more
appropriate especially with the -R option.

PR: bin/107515
Submitted by: bde
Approved by: trasz (mentor)
MFC after: 1 week


202756 21-Jan-2010 ed

Remove stale references to utmp(5) and its corresponding filenames.

I removed utmp and its manpage, but not other manpages referring to it.


202532 17-Jan-2010 ed

Raise WARNS for various tools where possible.

Submitted by: Marius Nünnerich <marius@nuenneri.ch>


202461 17-Jan-2010 gavin

Implement an "-x" option to cp(1), for compatibility with Linux and
feature parity with du(1) and similar: When set, cp(1) will not traverse
mount points.

Initial patch by: Graham J Lee leeg teaching.physics.ox.ac.uk

PR: bin/88056
Initial patch by: Graham J Lee leeg teaching.physics.ox.ac.uk
Approved by: ed (mentor)
MFC after: 1 month


202193 13-Jan-2010 ed

Port everything in bin/ from utmp to utmpx.

date: use libc utmpx routines instead of the ones provided by libulog.
pax: don't depend on <utmp.h>


202190 13-Jan-2010 ed

Let csh(1) use utmpx instead of utmp.

csh allows you to monitor the utmp(x) file to monitor certain user
logins. Unfortunately it needs to directly stat() this file. I don't
want to break this module , but eventually it shouldn't do that. The
idea of the getutxent(3) API is to hide file access.

Approved by: mp


201487 04-Jan-2010 obrien

Committed the wrong version in r201484. This time really fix the "-t"
functionality. Per the regression tests (pgrep-t.t & pkill-t.t), "-t"
should accept "v1", which means a plain number should be accepted for
UNIX98-style PTY's.


201484 04-Jan-2010 obrien

Fix the "-t" functionality. Per the regression tests (pgrep-t.t & pkill-t.t),
"-t" should accept "v1", which means a plain number should be accepted for
UNIX98-style PTY's.


201431 03-Jan-2010 jilles

sh: Send the "not found" message for builtin <cmd> to redirected fd 2.


201366 01-Jan-2010 jilles

sh: Fix some bugs with backquoted builtins:
- correctly handle error output in $(builtin 2>&1), clarify out1/out2 vs
output/errout in the code
- treat all builtins as regular builtins so errors do not abort the shell
and variable assignments do not persist
- respect the caller's INTOFF

Some bugs still exist:
- expansion errors may still abort the shell
- some side effects of expansions and builtins persist


201355 31-Dec-2009 jilles

sh(1): document ulimit -w (swapuse rlimit).

MFC after: 1 week


201354 31-Dec-2009 jilles

sh(1): Correct two places where "$@" lacked necessary quotes.

MFC after: 1 week


201344 31-Dec-2009 jilles

sh: Use PATH= assignment in type.

Example:
PATH=/var/empty; PATH=/bin type ls


201343 31-Dec-2009 jilles

sh: Allow command -pv and command -pV (lookup using _PATH_STDPATH).


201283 30-Dec-2009 jilles

sh: Ensure funcnest is decremented if there was an error in the function.

This will be important when things like 'command eval f' will be possible.
Currently, the funcnest = 0 assignment in RESET (called when returning to
the top level after an error in interactive mode) is really sufficient.


201262 30-Dec-2009 jilles

Fix memory leak when parsing backticks (``).


201259 30-Dec-2009 jilles

sh: arith: Return only 0 and 1 from && and ||.

This agrees with C, POSIX and other shells.


201179 29-Dec-2009 ed

Add missing `void' for function without arguments.


201177 29-Dec-2009 ed

Add missing `void' for function without arguments.


201145 28-Dec-2009 antoine

(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
Fix some wrong usages.
Note: this does not affect generated binaries as this argument is not used.

PR: 137213
Submitted by: Eygene Ryabinkin (initial version)
MFC after: 1 month


201056 27-Dec-2009 jilles

sh: Change varinit to use const better.


201053 27-Dec-2009 jilles

sh: Various warning fixes (from WARNS=6 NO_WERROR=1):
- const
- initializations to silence -Wuninitialized (it was safe anyway)
- remove nested extern declarations
- rename "index" locals to "idx"


201020 26-Dec-2009 jilles

Remove declaration of function that no longer exists.


201018 26-Dec-2009 trasz

Fix breakage introduced in last commit.


201016 26-Dec-2009 trasz

Improve ACL branding mismatch detection and reporting in some rare cases,
such as "setfacl -m ''".


200998 25-Dec-2009 jilles

sh: Do not run callers' exception handlers in subshells.

Reset the exception handler in the child to main's.

This avoids inappropriate double cleanups or shell duplication when the
exception is caught, such as 'fc' and future 'command eval' and 'command .'.


200988 25-Dec-2009 jilles

sh: Do not consider a tilde-prefix with expansions in it.

That is, do not do tilde expansion if any of the CTL* bytes (\201-\210), not
only CTLESC and CTLQUOTEMARK, are encountered. Such an expansion would look
up a user name with sh's internal representation.

The parser does not currently distinguish between backslashed and
unbackslashed \201-\210, so tilde expansion of user names with these bytes
in them is not so easy to fix.


200967 24-Dec-2009 jilles

sh: Add some __dead2 to indicate functions that do not return.


200956 24-Dec-2009 jilles

sh: Constify various strings.

Most of this is adding const keywords, but setvar() in var.c had to be
changed somewhat more.


200943 24-Dec-2009 jilles

sh: Remove setting variables from dotcmd/exportcmd.

It is already done by evalcommand(), unless special-ness has been removed,
in which case variable assignments should not persist. (These are currently
always special builtins, but this will change later: command builtin,
command substitution.)

This also fixes a memory leak when calling . with variable assignments.

Example:
valgrind --leak-check=full sh -c 'x=1 . /dev/null; x=2'


200794 21-Dec-2009 delphij

Plug a memory leak.

PR: bin/141835
Submitted by: Henning Petersen <henning.petersen t-online.de>
MFC after: 2 weeks


200157 05-Dec-2009 ed

Let date(1) use utmpx instead of logwtmp().

utmpx also has OLD_TIME/NEW_TIME messages, which seem to be intended for
the same purpose as how we call logwtmp() here.


199953 29-Nov-2009 jilles

Fix some cases where file descriptors from redirections leak to programs.

- Redirecting fds that were not open before kept two copies of the
redirected file.
sh -c '{ :; } 7>/dev/null; fstat -p $$; true'
(both fd 7 and 10 remained open)
- File descriptors used to restore things after redirection were not
set close-on-exec, instead they were explicitly closed before executing
a program normally and before executing a shell procedure. The latter
must remain but the former is replaced by close-on-exec.
sh -c 'exec 7</; { exec fstat -p $$; } 7>/dev/null; true'
(fd 10 remained open)

The examples above are simpler than the testsuite because I do not want to
use fstat or procstat in the testsuite.


199660 22-Nov-2009 jilles

Fix various things about SIGINT handling:
* exception handlers are now run with interrupts disabled, which avoids
many race conditions
* fix some cases where SIGINT only aborts one command and continues the
script, in particular if a SIGINT causes an EINTR error which trumped the
interrupt.

Example:
sh -c 'echo < /some/fifo; echo This should not be printed'
The fifo should not have writers. When pressing ctrl+c to abort the open,
the shell used to continue with the next command.

Example:
sh -c '/bin/echo < /some/fifo; echo This should not be printed'
Similar. Note, however, that this particular case did not and does not work
in interactive mode with job control enabled.


199647 22-Nov-2009 jilles

sh: Ensure the same command input file is on top after executing a builtin.

This avoids weirdness when 'fc -e vi' or the like is done and there is a
syntax error in the file. Formerly an interactive shell tried to execute
stuff after the syntax error and exited.

This should also avoid similar issues with 'command eval' and 'command .'
when 'command' is implemented properly as in NetBSD sh.

Special builtins did not have this problem since errors in them cause the
shell to exit or to reset various state such as the current command input
file.


199641 21-Nov-2009 jilles

trap: do not consider a bad signal name a fatal error.
POSIX explicitly prescribes this.
Continue processing any other signals and return status 1.


199631 21-Nov-2009 stefanf

Handle current work directories of arbitrary length. The argument to cd
continues to be limited by PATH_MAX (1024).

Obtained from: NetBSD
PR: 104456


199629 21-Nov-2009 jilles

sh: Some changes to stderr flushing:
* increase buffer size from 100 to 256 bytes
* remove implied flush from out2str(), in particular this avoids unnecessary
flushing in the middle of a -x tracing line
* rename dprintf() to out2fmt_flush(), make it flush out2 and use this
function in various places where flushing is desired after an error
message


199458 17-Nov-2009 jilles

Add pwait utility, which waits for any process to terminate.

This is similar to the Solaris utility of the same name.

Some use cases:
* rc.subr's wait_for_pids
* interactive use, e.g. to shut down the computer when some task is done
even if the task is already running

Discussed on: hackers@


199351 17-Nov-2009 netchild

Fix small resource leak (memory).

Reviewed by: gad
MFC after: 1 week


199282 14-Nov-2009 jilles

sh: Allow a newline before "in" in a for command, as required by POSIX.


199205 11-Nov-2009 jilles

sh: Use sigaction instead of signal/siginterrupt combination.


198963 05-Nov-2009 jilles

sh: Fix memory leak when using a variable in arithmetic like $((x)).

MFC after: 3 weeks


198848 03-Nov-2009 delphij

Increase width for %CPU, RSS and VSZ columns for now. Modern systems
tend to have larger memory, larger process, and more CPU.


198788 02-Nov-2009 brueffer

Use our canonical .Dd format.

Submitted by: Ulrich Spoerlein


198454 24-Oct-2009 jilles

sh: Exempt $@ and $* from set -u

This seems more useful and will likely be in the next POSIX standard.

Also document more precisely in the man page what set -u does (note that
$@, $* and $! are the only special parameters that can ever be unset, all
the others are always set, although they may be empty).


198189 17-Oct-2009 ume

Check error of dlfunc(3).

MFC after: 3 days


198173 16-Oct-2009 jilles

sh: Show more information about syntax errors in command substitution:
the line number where the command substitution started.
This applies to both the $() and `` forms but is most useful for ``
because the other line number is relative to the enclosed text there.
(For older versions, -v can be used as a workaround.)


198148 15-Oct-2009 ru

Removed redundant WARNS setting.

Submitted by: Ulrich Spörlein


198056 13-Oct-2009 jilles

ls: Make -p not inhibit following symlinks.

According to the man page, when neither -H/-L nor -F/-d/-l are given, -H is
implied. This agrees with POSIX, GNU ls and Solaris ls. This means that -p,
although it is very similar to -F, does not prevent the implicit following
of symlinks.

PR: standards/128546


197848 07-Oct-2009 jilles

Clarify quoting of word in ${v=word} in sh(1).


197820 06-Oct-2009 jilles

sh: Send the "xyz: not found" message to redirected fd 2.
This also fixes that trying to execute a non-regular file with a command
name without '/' returns 127 instead of 126.
The fix is rather simplistic: treat CMDUNKNOWN as if the command were found
as an external program. The resulting fork is a bit wasteful but executing
unknown commands should not be very frequent.

PR: bin/137659


197691 01-Oct-2009 jilles

sh: Disallow mismatched quotes in backticks (`...`).

Due to the amount of code removed by this, it seems that allowing unmatched
quotes was a deliberate imitation of System V sh and real ksh. Most other
shells do not allow unmatched quotes (e.g. bash, zsh, pdksh, NetBSD /bin/sh,
dash).

PR: bin/137657


197371 20-Sep-2009 jilles

Mention that NUL characters are not allowed in sh(1) input.

I do not consider this a bug because POSIX permits it and argument strings
and environment variables cannot contain '\0' anyway.

PR: bin/25542
MFC after: 2 weeks


196936 07-Sep-2009 trasz

Add NFSv4 support to setfacl(1).

Reviewed by: rwatson


196841 04-Sep-2009 trasz

Add NFSv4 ACL support to mv(1).

Reviewed by: rwatson


196827 04-Sep-2009 trasz

Add NFSv4 ACL support to getfacl(1).

Reviewed by: rwatson


196773 02-Sep-2009 trasz

Fix regression introduced in r196712 - the 'name' string needs
to be rewritten for each file we want to check ACL on. Without
this change, ls(1) would check only the ACL on the first file
to list.


196754 02-Sep-2009 trasz

Add NFSv4 ACL support to cp(1) and fix a few memory leaks.

Note that this changes error reporting behaviour somewhat - before,
no error was reported if ACL couldn't be copied because the target
filesystem doesn't support ACLs. Now, it will be reported - of course,
only if there actually is an ACL to copy.

Reviewed by: rwatson


196753 02-Sep-2009 trasz

- Don't include both <sys/types.h> and <sys/param.h>

- Keep variables sorted

- Fix logic error with -f and -v options - don't print
the usual -v output if there was an error, whether or not
we were passed -f

- Don't call free(3) just before exit(2)

- Whitespace fixes

Submitted by: bde


196712 31-Aug-2009 trasz

Add NFSv4 ACL support to ls(1).


196711 31-Aug-2009 trasz

Make the code more readable and fix chmod(1) on symlinks with
NFSv4 enabled.


196634 28-Aug-2009 jilles

sh: Fix crash with empty functions (f() { }) introduced in r196483

Empty pairs of braces are represented by a NULL node pointer, just like
empty lines at the top level.

Support for empty pairs of braces may be removed later. They make the code
more complex, have inconsistent behaviour (may or may not change $?), are
not specified by POSIX and are not allowed by some other shells like bash,
dash and ksh93.

Reported by: kan


196483 23-Aug-2009 jilles

sh: Fix crash when undefining or redefining a currently executing function.

Add a reference count to function definitions.
Memory may leak if multiple SIGINTs arrive in interactive mode,
this will be fixed later by changing SIGINT handling.

PR: bin/137640


195830 23-Jul-2009 brian

Add the -d switch to the usage message.

Submitted by: Emil Mikulic - emil at dmr dot ath dot cx
Approved by: re (kib)
MFC after: 1 week


195768 19-Jul-2009 jilles

Allow creating hard links to symlinks using ln(1).

This implements the POSIX.1-2008 -L and -P flags.

The default remains to create hard links to the target of symlinks.

Approved by: re (kib), ed (mentor)


195502 09-Jul-2009 trasz

Add manual page links to advertise procstat(1) a little better.

Approved by: re (kib)


195243 01-Jul-2009 trasz

With NFSv4 ACLs, it is possible that applying a mode to an ACL which
is identical to the mode computed from that ACL will modify the ACL.
For example, mode computed from the following ACL is 0600:

user:kamila:rwx--------C--:------:allow
owner@:--x-----------:------:deny
owner@:rw-p---A-W-Co-:------:allow
group@:rwxp----------:------:deny
group@:--------------:------:allow
everyone@:rwxp---A-W-Co-:------:deny
everyone@:------a-R-c--s:------:allow

However, applying that mode (chmod 0600) changes the ACL into this:

user:kamila:rwx-----------:------:deny
user:kamila:rwx--------C--:------:allow
owner@:--x-----------:------:deny
owner@:rw-p---A-W-Co-:------:allow
group@:rwxp----------:------:deny
group@:--------------:------:allow
everyone@:rwxp---A-W-Co-:------:deny
everyone@:------a-R-c--s:------:allow

In chmod(1) utility, there is an optimisation, which makes it not
call chmod(2) if the mode of the file is the same as the new mode.
Disable that optimisation for files which may have NFSv4 ACLs.

Reviewed by: rwatson
Approved by: re (kib)


194977 25-Jun-2009 jilles

Fix some weirdnesses in the NetBSD IFS code,
in particular "$@"$ifschar if the final positional parameter is empty.
With the NetBSD code, adding the $ifschar removes a parameter.

PR: standards/79067
Approved by: ed (mentor) (implicit)


194975 25-Jun-2009 jilles

Improve IFS expansion using code from NetBSD.

We now pass the ifs.sh testsuite.

PR: standards/79067
Approved by: ed (mentor) (implicit)
Obtained from: NetBSD


194922 24-Jun-2009 jilles

Designate special builtins as such in command -V and type.
Also document various properties of special builtins that we implement.

Approved by: ed (mentor) (implicit)


194795 23-Jun-2009 delphij

Staticify internal routines.


194786 23-Jun-2009 jilles

Quote -x tracing output so it is unambiguous.

It is usually but not always suitable for re-input to the shell.

Approved by: ed (mentor) (implicit)


194774 23-Jun-2009 jilles

Do not fork for a subshell if it is the last thing this shell is doing
(EV_EXIT). The fork is still done as normal if any traps are active.

In many cases, the fork can be avoided even without this change by using {}
instead of (), but in practice many scripts use (), likely because the
syntax is simpler.

Example:
sh -c '(/bin/sleep 10)& sleep 1;ps -p $! -o comm='
Now prints "sleep" instead of "sh". $! is more useful this way.
Most shells (dash, bash, pdksh, ksh93, zsh) seem to print "sleep" for this.

Example:
sh -c '( ( ( (ps jT))))'
Now shows no waiting shell processes instead of four.
Most shells (dash, bash, pdksh, ksh93, zsh) seem to show zero or one.

PR: bin/74404
Approved by: ed (mentor) (implicit)


194767 23-Jun-2009 kib

Usermode portion of the support for swap allocation accounting:
- update for getrlimit(2) manpage;
- support for setting RLIMIT_SWAP in login class;
- addition to the limits(1) and sh and csh limit-setting builtins;
- tuning(7) documentation on the sysctls controlling overcommit.

In collaboration with: pho
Reviewed by: alc
Approved by: re (kensmith)


194765 23-Jun-2009 jilles

sh: Improve handling of setjmp/longjmp volatile:
- remove ineffective and unnecessary (void) &var; [1]
- remove some unnecessary volatile keywords
- add a necessary volatile keyword
- save the old handler before doing something that could use the saved
value

Submitted by: Christoph Mallon [1]
Approved by: ed (mentor)


194560 20-Jun-2009 jilles

Fix race condition in noclobber option.

Formerly, it was possible for the file to be created between the check if it
existed and the open; the contents would then be lost.

Because this must use O_EXCL, noclobber > will not create a file through a
symlink anymore. This agrees with behaviour of other shells.

Approved by: ed (mentor) (implicit)


194516 19-Jun-2009 jilles

Fix some issues with quoted output and shorten it in some cases.

Output quoted suitable for re-input to the shell occurs in
various cases such as 'set', 'trap'.

Bugfix: *, ? and [ must be quoted (except sole [)
Bugfix: ~ and # must be quoted (really only sometimes, but keep it simple)
Bugfix: space, tab and newline must always be quoted
Shortening: other IFS characters do not need quoting
Bugfix: send to correct output file, not hard-coded stdout
Shortening: avoid unnecessary '' with \'

Approved by: ed (mentor)


194406 17-Jun-2009 jilles

Properly flush input after an error in backquotes in interactive mode.

For parsing an old-style backquote substitution (`...`),
a string "file" is used to store the contents of the
substitution (with the special backslash processing done).
If an error occurs, the shell cleans up all these files
(returning to the top level) and flush the top level
file. Erroneously, it first flushed the current file and
then cleaned up all extra files, so that the top level
file (i.e. the terminal) was not flushed.

Example (in interactive mode):
echo `for` echo This should not be printed

Also noticeable in (in interactive mode):
echo `(`
The old version prints an extraneous prompt.

Approved by: ed (mentor)


194128 13-Jun-2009 jilles

Avoid leaving unnecessary waiting shells in many forms of sh -c COMMAND.

This change only affects strings passed to -c, when the -s
option is not used.

The approach is to check if there may be additional data
in the string after parsing each command. If there is none,
use the EV_EXIT flag so that a fork may be omitted in
specific cases.

If there are empty lines after the command, the check will
not see the end and forks will not be omitted. The same
thing seems to happen in bash.

Example:
sh -c 'ps lT'
No longer shows a shell process waiting for ps to finish.

PR: bin/113860
Reviewed by: stefanf
Approved by: ed (mentor)


194127 13-Jun-2009 jilles

Don't skip forking for an external command if any traps are active.

Example:
sh -c '(trap "echo trapped" EXIT; sleep 3)'
now correctly prints "trapped".

With this check, it is no longer necessary to check for -T
explicitly in that case.

This is a useful bugfix by itself and also important because I plan to
skip forking more often.

PR: bin/113860 (part of)
PR: bin/74404 (part of)
Reviewed by: stefanf
Approved by: ed (mentor)


193636 07-Jun-2009 jilles

Mention the range for the exit status for the exit special builtin.

The exit status may exceed 255 in some cases (return); even though it seems
unwise to rely on this, it is also unwise to assume that $? is always
between 0 and 255.

This resolves bin/124748 by documenting that 'exit -1' is not valid.

PR: bin/124748
Approved by: ed (mentor)


193629 07-Jun-2009 simon

Make "human-readable" (-H/-h) output also "humanize" inode counts.
Base 10 is always used for the inode counts as I could not think of any
reason base 2 inode counts would be useful.

Minor mdoc markup fix to df(1) while here anyway.

MFC after: 3 weeks


193225 01-Jun-2009 rse

use explicit 'unsigned int' instead of just the implicit-style 'unsigned' to make linting tools (e.g. FlexeLint) happy, too


193223 01-Jun-2009 rse

align coding style with style(9) to avoid misunderstandings


193222 01-Jun-2009 rse

correctly test for __GNUC__ macro (non-GCC compilers do not have it defined at all)


193221 01-Jun-2009 rse

be more type correct and align local ckmalloc() with its underlying malloc(3) by using a "size_t" instead of an "int" argument


193185 31-May-2009 jilles

sh: Make read's timeout (-t) apply to the entire line, not only the first
character.

This avoids using non-standard behaviour of the old (upto FreeBSD 7) TTY
layer: it reprocesses the input queue when switching to canonical mode. The
new TTY layer does not provide this functionality and so read -t worked
very poorly (first character is not echoed, cannot be backspaced but is
still read).

This also agrees with what most other shells with read -t do.

PR: bin/129566
Reviewed by: stefanf
Approved by: ed (mentor)


193169 31-May-2009 stefanf

Fix the eval command in combination with set -e. Before this change the shell
would always terminate if eval returned with a non-zero exit status regardless
if the status was actually tested. Unfortunately a new file-scope variable
is needed, the alternative would only be to add a new parameter to all
built-ins.

PR: 134881


193087 30-May-2009 jilles

rm, find -delete: fix removing symlinks with uchg/uappnd set.

Formerly, this tried to clear the flags on the symlink's target
instead of the symlink itself.

As before, this only happens for root or for the unlink(1) variant of rm.

PR: bin/111226 (part of)
Submitted by: Martin Kammerhofer
Approved by: ed (mentor)
MFC after: 3 weeks


193086 30-May-2009 jilles

Preserve file flags on symlinks in cp -Rp.
This reported ENOSYS before.

PR: bin/111226 (part of)
Submitted by: Martin Kammerhofer
Approved by: ed (mentor)
MFC after: 3 weeks


192862 26-May-2009 jilles

Fix various cases with 3 or 4 parameters in test(1) to be POSIX compliant.
More precisely, this gives precedence to an interpretation not using the
'(', ')', '-a' and '-o' in their special meaning, if possible. For example,
it is now safe to write [ "$a" = "$b" ] and assume it compares the two
strings.

The man page already says that test(1) works this way, so does not need to
be changed.

Interpretation of input with more parameters tries a bit harder to find a
valid parse in some cases.

Add various additional test cases to TEST.sh.

PR: standards/133369
Approved by: ed (mentor)


192688 24-May-2009 jilles

Fix elapsed (etime) field for swapped out processes in ps:
show '-' instead of time since the Epoch.

PR: bin/123069
Submitted by: Vladimir Kozbin
Approved by: ed (mentor)
MFC after: 3 weeks


192687 24-May-2009 jilles

Fix chflags -h in various cases: do not use link target's flags as original.

Patch slightly changed to align more with chmod.c.

PR: bin/131999
Submitted by: bde
Approved by: ed (mentor)
MFC after: 3 weeks


192586 22-May-2009 trasz

Make 'struct acl' larger, as required to support NFSv4 ACLs. Provide
compatibility interfaces in both kernel and libc.

Reviewed by: rwatson


192280 18-May-2009 brian

Remove redundant whitespace


192242 17-May-2009 brian

When finding processes, ignore ourself and our ancestors. It is almost
always surprising when you kill a 'sh -c ...' ancestor or when you kill
yourself when using -f.

Add a -a switch for backwards compatibility.

MFC after: 3 weeks


192239 17-May-2009 brian

Add a -d option to ps to display descendant info with the output.
This is similar to linux's -H (or -f) switch.

MFC after: 3 weeks


191670 29-Apr-2009 imp

Implement ^T support for rm: now it will report the next file it
removes when you hit ^T. This is similar to what's done for cp. The
signal handler and type definitions for "info" were borrowed directly
from cp.


191009 13-Apr-2009 stefanf

Parse 'cmd1 && ! cmd2 | cmd3' correctly, the bang should apply to the entire
pipeline cmd2 | cmd3 and not just cmd2.

PR: 130298
Submitted by: Jilles Tjoelker


191003 13-Apr-2009 trasz

Add reference to strmode(3).


190698 04-Apr-2009 stefanf

Don't let trailing empty lines overwrite the result of the last command with 0.
This affects the built-ins eval, fc, and trap and also the string passed to sh
with the -c option.

Submitted by: Jilles Tjoelker


190298 22-Mar-2009 stefanf

Fix the behaviour of the read built-in when IFS is unset.

Obtained from: NetBSD


190295 22-Mar-2009 stefanf

Improve the IFS handling of the read built-in.

Obtained from: NetBSD
Submitted by: Jilles Tjoelker


190284 22-Mar-2009 stefanf

- Apply the r190270 changes to printing of single aliases too.
- Sort the aliases before printing them.


190270 22-Mar-2009 stefanf

Make the output of the alias built-in POSIX-compliant: Drop the leading 'alias'
and suppress printing the trailing space which is added for internal purposes.


189875 16-Mar-2009 des

cat(1) compiles fine at WARNS level 6.


189542 08-Mar-2009 ed

Don't disable CR-to-NL translation when waiting for data to arrive.

A difference between the old and the new TTY layer is that the new
implementation does not perform any post-processing before returning
data back to userspace when calling read().

sh(1)'s read turns the TTY into a raw mode before calling select(). This
means that the first character will not receive any ICRNL processing.
Inherit this flag from the original terminal attributes.

Even though this issue is not present on RELENG_*, I'm MFCing it to make
sh(1) in jails behave better.

PR: bin/129566
MFC after: 2 weeks


189078 26-Feb-2009 attilio

[1] When showing threads, the thread name just appears if the comm
label is choosen as last printout (ucomm suffers of this such bug
too). That bug is caused by the fact that the fixed size of
printout doesn't leave enough space for them to be printed out.
Implement ucomm and comm commands with a dynamic size lenght for
buffers.

[2] On AMD64 architecture pointers don't have enough chars space to
be shown (8 chars while they need 16). Fix them by providing
a variadic space so that it fits well on both 64 and 32 bits
architectures.

[3] Check a return value of malloc() that wasn't checked before.

PR: bin/128841, bin/128842
Reviewed by: jhb, emaste
Sponsored by: Sandvine Incorporated


187976 01-Feb-2009 kientzle

Before this fix, pax would stop the restore sequence for
symlinks after setting the owner. As a result, mode
and timestamp were not restored. This patch corrects the
problem by simply removing the short-circuit for symlinks
and using lchown()/lchmod()/lutimes() always for restoring
metadata.

PR: bin/91316
Submitted by: Jaakko Heinonen
Reviewed by: Joerg Sonnenberger
MFC after: 14 days


187922 30-Jan-2009 keramida

Bump .Dd for r187609


187734 26-Jan-2009 trhodes

Make the Monty Python quote more google friendly instead of
hacking it apart.

Discussed with: Christoph Mallon <christoph.mallon@gmx.de>


187627 23-Jan-2009 trhodes

Note the implication of setting the 'w' permission on directories,
while here, expand the 'naughty bits' comment in BUGS.

PR: 84265 and 84268
Reviewed by: keramida
Obtained from: hints from ceri, keramida


187609 23-Jan-2009 keramida

Add an example of using bs=2048 to duplicate data CD-ROMs.

This should be a bit useful for users who look at the manpage and
then try to copy data CD-ROM disks using dd. A lot of us know
that bs=2048 is required, but it still manages to cause a bit of
grief to those who haven't heard about it.

PR: bin/130857
Submitted by: Tri Brotoharsono < mail at tribrotoharsono.net >
MFC after: 3 days


187159 13-Jan-2009 maxim

o Fix a typo. Bump .Dd for the previous delta.


187148 13-Jan-2009 trhodes

Clean up a bit of confusing language and improve .Nd.

PR: 47818
Reviewed by: keramida


187145 13-Jan-2009 luigi

fix typo

Submitted by: Colin Percival


187142 13-Jan-2009 luigi

Document how kernel environment can be statically compiled in,
and reference a few related manpages.

MFC after: 3 days


186849 07-Jan-2009 danger

- rename the RETURN VALUES section to EXIT STATUS
- not bumping a date as this is not a real content change

Approved by: ru
MFC after: 3 days


185401 28-Nov-2008 stefanf

Report error messages of the builtins 'type' and 'command -V' to stderr instead
of stdout.

Noticed by: Zajcev Evgeny


185231 23-Nov-2008 stefanf

Fix $? at the first command of a function. The previous exit status was saved
twice and thus lost.


185200 23-Nov-2008 pjd

Implement -T option as found in Linux df(1). When given, file system type
will be included in output.

Reviewed and tested by: keramida
MFC after: 2 weeks


184925 13-Nov-2008 emaste

Fix whitespace.


184484 30-Oct-2008 joerg

When running a "chio return" operation using a physical source unit
rather than a voltag name, do not set the CESR_VOLTAGS flags in the
CHIOGSTATUS command requesting the current status. As voltags are an
optional feature that must be handled as "reserved" by media changers
not implementing the feature, always setting CESR_VOLTAGS resulted in
the command being aborted with an `Invalid field in CDB', and
consequently the "chio return" failed, for media changers that do not
support voltags.

MFC after: 1 week


184471 30-Oct-2008 ivoras

Teach cat(1) and cp(1) to use a larger buffer if enough memory is present
in the system. A simple heuristics is used to detect what is "enough"
memory: if number of physmem pages is greater than 32k (equalling 128 MB
on machines with 4 kB pages).

Typical immediate result of these changes is reduction in context switches
and the goal is to increase efficiency by using large buffers:
before: /usr/bin/time -hlp cat file1 > file2
...
163 voluntary context switches
11194 involuntary context switches
after: /usr/bin/time -hlp ./cat file1 > file2
...
417 voluntary context switches
272 involuntary context switches

Reviewed by: hackers@ (no objections to earlier version of cat patch)
Approved by: gnn (mentor)
MFC after: 4 months


184418 28-Oct-2008 rdivacky

Remove superfluous va_end which was left there in rev 1.38.

Approved by: kib (mentor)


184342 27-Oct-2008 dds

Add fallback when mmap fails on regular files. Some filesystems,
like smbnetfs, do not support mmap.

Reported by: Harti Brandt
MFC after: 1 month


183502 30-Sep-2008 ed

Improve the `pkill -t' handling, which I changed in my previous commit.

In my previous commit I disabled pkill(1)'s automatic prepending of the
"tty" string when `pkill -t' was being used. Re-enable it and stat()
both possible device names when called.

Requested by: jhb, rwatson (MFC)
MFC after: 1 month


183438 28-Sep-2008 ed

Don't automatically prepend the "tty" prefix to `pkill -t' arguments.

Because we now enforce UNIX98-style PTY's, we now use a lot of TTY's
that don't have the traditional /dev/ttyXX naming scheme. pkill(1)'s -t
flag automatically prepended the word "tty" to each TTY that was passed
on the command line. This meant that `pkill -t pts/0' was actually
converted to /dev/ttypts/0. Disable this broken behaviour for now.

Reported by: erwin


182889 09-Sep-2008 trasz

Remove redundant close(2).

Submitted by: kensmith
Approved by: rwatson (mentor)


182813 06-Sep-2008 trasz

Fix double free in setfacl(1). Description from the author:

Initially, 'acl' (an 'acl_t *') is allocated, and its ACCESS_ACL and
DEFAULT_ACL fields are passed to the 'libc' ACL routines for subsequent
allocation. If the '-m' option (merge existing ACL with a new one) is
specified, then 'set_acl_mask()' will be called and passed one of the
two ACLs. This function, in turn, replaces this given ACL structure by
another, freshly allocated. However, the pointer in the 'acl' variable
in the caller is not updated. The caller then proceeds to free the ACL,
incurring in a double free condition.

Submitted by: Pedro Martelletto <pedro at ambientworks.net>
Approved by: rwatson (mentor)


182543 31-Aug-2008 yar

pkill(1) first appeared in /usr/bin, but later it was moved to /bin
for the convenience of rc.d. Now it has happily lived there for quite
a while. So move the pkill(1) source files from usr.bin to bin, too.

Approved by: gad


182489 30-Aug-2008 ed

Document the ulimit -p option in the sh(1) manual page.

When I imported the MPSAFE TTY code, I added the -p flag to sh(1)'s
ulimit, but I forgot to document it in the appropriate manual page.

Requested by: stefanf


182300 27-Aug-2008 stefanf

Fix a bug in r177497 which caused the getopts state to be reset when 'set'
was used to set a shell option (and not to change the positional parameters).

Submitted by: Martin Kammerhofer


182052 23-Aug-2008 ed

Make stty(1) use tab0 and tab3 to handle tab completion.

After the MPSAFE TTY import, we have support for the TAB0 and TAB3 flags
to handle tab expansion, while we only used to support OXTABS. Switch
stty(1) to use tab0 and tab3 to print whether tab expansion is turned on
or off. Implement the oxtabs and tabs switches by setting the
appropriate TABx value.

Even though POSIX only lists this as being XSI, we'd better follow it.


181905 20-Aug-2008 ed

Integrate the new MPSAFE TTY layer to the FreeBSD operating system.

The last half year I've been working on a replacement TTY layer for the
FreeBSD kernel. The new TTY layer was designed to improve the following:

- Improved driver model:

The old TTY layer has a driver model that is not abstract enough to
make it friendly to use. A good example is the output path, where the
device drivers directly access the output buffers. This means that an
in-kernel PPP implementation must always convert network buffers into
TTY buffers.

If a PPP implementation would be built on top of the new TTY layer
(still needs a hooks layer, though), it would allow the PPP
implementation to directly hand the data to the TTY driver.

- Improved hotplugging:

With the old TTY layer, it isn't entirely safe to destroy TTY's from
the system. This implementation has a two-step destructing design,
where the driver first abandons the TTY. After all threads have left
the TTY, the TTY layer calls a routine in the driver, which can be
used to free resources (unit numbers, etc).

The pts(4) driver also implements this feature, which means
posix_openpt() will now return PTY's that are created on the fly.

- Improved performance:

One of the major improvements is the per-TTY mutex, which is expected
to improve scalability when compared to the old Giant locking.
Another change is the unbuffered copying to userspace, which is both
used on TTY device nodes and PTY masters.

Upgrading should be quite straightforward. Unlike previous versions,
existing kernel configuration files do not need to be changed, except
when they reference device drivers that are listed in UPDATING.

Obtained from: //depot/projects/mpsafetty/...
Approved by: philip (ex-mentor)
Discussed: on the lists, at BSDCan, at the DevSummit
Sponsored by: Snow B.V., the Netherlands
dcons(4) fixed by: kan


181361 07-Aug-2008 trasz

Fix ACL preservation, apparently broken in 1.47.

Approved by: rwatson
MFC after: 3 weeks


181269 04-Aug-2008 cperciva

Mark functions as __dead2 in order to help the LLVM static checker
understand which code paths aren't possible.

This commit eliminates 117 false positive bug reports of the form
"allocate memory; error out if pointer is NULL; use pointer".


181017 30-Jul-2008 stefanf

Pass the correct flags to expandarg() for NFROMFD and NTOFD. This fixes a
segmentation fault when the argument expands to an empty string.

Reported by: simon
MFC after: 3 weeks


180604 19-Jul-2008 delphij

Staticify symbols that will not be used in other
places.


180596 18-Jul-2008 kevlo

Remove unnessasary cast


180559 16-Jul-2008 ed

Remove OTTYDISC, NETLDISC and NTTYDISC definitions.

When I ported most applications away from <sgtty.h>, I noticed none of
them were actually using these definitions. I kept them in place,
because I didn't want to touch tools like pstat(8) and stty(1).

In preparation for the MPSAFE TTY layer, remove these definitions. This
doesn't have any impact with respect to binary compatibility (see
tty_conf.c).

We couldn now add an #error to <sys/ioctl_compat.h> when included
outside the kernel. Unfortunately, kdump's mkioctls includes this file
unconditionally.

Approved by: philip (mentor)


180334 06-Jul-2008 csjp

Add hard sentence breaks.

Pointed out by: rwatson
MFC after: 1 week


180330 06-Jul-2008 csjp

Document default ACLs and how to use them.
MFC after: 1 week


179639 07-Jun-2008 rse

use 'const' for the parameters of the two static functions unalias() and hashalias()


179638 07-Jun-2008 rse

remove an unnecessary include


179636 07-Jun-2008 keramida

Unbreak last commit to ln for amd64.

Cast string precision to `int'. amd64 systems warn about the
field precision being `long int' if we don't, and pathnames are
normally short enough to fit in an `int'.

Noticed by: pav


179603 06-Jun-2008 keramida

Add a -w warning flag to ln(1). When the -w option is enabled,
ln(1) checks to see if the source of a symlink, i.e. the file it
should point to actually exists. The default is the old ln
behavior, that does not check, to avoid surprising people who may
be using ln(1) in scripts or other non-interactive places.

PR: bin/7265
Submitted by: Joel Ray Holveck, detlev!joelh at mail.camalott.com
MFC after: 2 weeks


179387 28-May-2008 stefanf

Fix checking if a variable name is LINENO. As STPUTC changes the pointer if it
needs to enlarge the buffer, we must not keep a pointer to the beginning.

PR: ports/123879


179022 15-May-2008 stefanf

Expand $LINENO to the current line number. This is required by SUSv3's "User
Portability Utilities" option.

Often configure scripts generated by the autotools test if $LINENO works and
refuse to use /bin/sh if not.

Package test run by: pav


178631 28-Apr-2008 stefanf

Sigh, when reapplying the patch to HEAD, I somehow forgot to commit this file.

Reported by: Jaakko Heinonen


178625 27-Apr-2008 stefanf

- Fix bugs where the value of arithmetic expansion$((...)) was trucated
to type int.
- Change the type used for arithmetic expansion to intmax_t (ie. 64 bit on all
currently supported FreeBSD architectures). SUSv3 requires at least type
long but allows for larger types. Other shells (eg. bash, zsh, NetBSD's sh)
do that too.

PR: 122659
Submitted by: Jaakko Heinonen (minor modifications by me)


177942 05-Apr-2008 imp

Turn a tab into a space. This fixes a misalignment for ls -l.

Tabs Noticed by: Antoine Brodin


177908 04-Apr-2008 ru

- Add -D to usage().
- Bump document date for the addition of the -D option.
- Reformat a sentence to look like a real sentence.


177907 04-Apr-2008 grog

Add -D option to specify exact format of date and time output with ls -l.


177497 22-Mar-2008 stefanf

Reset the internal state used for the 'getopts' built-in when 'shift' or 'set'
are used to modify the arguments. Not doing so caused random memory reads or
null pointer dereferences when 'getopts' was called again later (SUSv3 says
getopts produces unspecified results in this case).

PR: 48318


177151 13-Mar-2008 obrien

uuidgen has been repo-copied from usr.bin/ to bin/ to match its "new"
(2007/04/09) installation location.


177090 12-Mar-2008 jeff

- P_SA has been removed.


177036 10-Mar-2008 jhb

Add an '-a' option which is identical to specifying '-RpP' for
compatibility with other implementations.

MFC after: 1 month


176977 09-Mar-2008 rwatson

Enhance realpath(1) in a number of ways:

- Allow realpath to accept multiple paths on the command line.
- Add -q to suppress warnings if some paths can't be processed, and use
getopt(3) to process flags.
- Print the path being requested rather than a possibly partially
processed path when a failure occurs so that you can tell which of
several passed paths did fail.

MFC after: 1 week
PR: 112920
Submitted by: Ighighi <ighighi@gmail.com>


176976 09-Mar-2008 rwatson

Make chflags(1) more chmod(1)-like (and more feature complete):

- Add -v to print file names as they are processed; -vv prints the flags
change as well.
- Add -f to ignore failures with the same semantics as chflags(1), neither
printing an error nor affecting the return code.
- Don't try to set the flags if they won't change.

I made minor cosmetic tweaks to the code in the patch.

MFC after: 1 week
PR: 112827
Submitted by: Ighighi <ighighi at gmail.com>


176521 24-Feb-2008 stefanf

Split updatepwd() into two smaller functions. The first one, findpwd(),
computes the new path and the second one, updatepwd(), updates the variables
PWD, OLDPWD and the path used for the pwd builtin according to the new
directory. For a logical directory change, chdir() is now called between
those two functions, no longer causing wrong values to be stored in PWD etc. if
it fails.

PR: 64990, 101316, 120571


176392 18-Feb-2008 marcel

Fix "warning: comparison is always false due to limited range of data type"
on platforms with unsigned chars. The comparison in question is there to
determine whether chars are unsigned or not and is based on comparing a
char, initialized to -1, for less than 0. Change the comparison to check
for geater than 0 instead...


176094 07-Feb-2008 ru

Don't reset DST computed by strptime() (when e.g. setting the
date via -f %s).

Reported by: Eugene Grosbein
Diagnosed by: Miguel Lopes Santos Ramos


174935 27-Dec-2007 dds

- Roll-back attempts to mimic rename(2) atomicity introduced in 1.47,
and follow the letter of the POSIX specification.

- Moving a directory to an existing non-empty directory will now fail,
as required.

- Improve consistency and remove some style bugs of earlier versions.

This version passes all tests of tools/regression/bin/mv/regress.sh 1.6

Reviewed by: bde
MFC after: 1 month


174912 26-Dec-2007 edwin

As suggested, replace earlier changed warnx() / exit() with an errx()

Submitted by: Peter Jeremy <peterjeremy@optushome.com.au>


174890 25-Dec-2007 edwin

When copying multiple files to a directory, make sure that a proper
warning is given when the directory doesn't exist.

PR: bin/50656
Submitted by: Edwin Groothuis <edwin@mavetju.org>
Approved by: grog@
Not reviewed by: grog@


174709 17-Dec-2007 dds

Calling any function from vfork other than exec* and _exit yields
undefined behavior.

Noted by: alfred


174667 16-Dec-2007 dds

Eliminate gcc "variable clobbered" warnings by declaring the variables
living across the vfork as volatile.

Noted by: kan


174664 16-Dec-2007 dds

When moving a directory across devices to a place where a directory
with the same name exists, delete that directory first, before performing
the copy. This ensures that mv(1) across devices follows the semantics
of rename(2), as required by POSIX.

This change could introduce the potential of data loss, even if the
copy fails, violating the atomicity properties of rename(2). This is
(mostly) mitigated by first renaming the destination and obliterating
it only after a succesfull copy.

The above logic also led to the introduction of code that will cleanup
the results of a partial copy, if a cross-device copy fails.

PR: bin/118367
MFC after: 1 month


174469 09-Dec-2007 marius

Move WARNS as ed(1) also is only WARNS = 2 clean in the !DES case.
This fixes its compilation if MK_OPENSSL == no and also obsoletes
release/Makefile rev. 1.192. The latter isn't reverted though as
support for the fixit floppy and the rest of the boot floppies is
scheduled to be deorbited anyway.

Discussed with: kensmith


174287 05-Dec-2007 ru

Revise the markup.


173718 18-Nov-2007 jb

Reduce the WARNS level to avoid a compiler warning about a variable
possibly being clobbered by a longjmp or a fork with gcc4.


173702 17-Nov-2007 ru

Express in the usage() and SYNOPSIS that -F depends on -s, and
that -f and -i are exclusive.


173701 17-Nov-2007 ru

Swap "source"/"target" where appropriate, to match documentation.


173492 08-Nov-2007 jhb

Teach ps(1) to parse pts TT values (i.e. '0', '1') for the -t flag.

MFC after: 1 week
Reported by: kris


173248 01-Nov-2007 ru

Bump document date on behalf of previous revision.


173100 28-Oct-2007 julian

fix sorting of 'tdnam' keyword in keyword list.


173004 26-Oct-2007 julian

Introduce a way to make pure kernal threads.
kthread_add() takes the same parameters as the old kthread_create()
plus a pointer to a process structure, and adds a kernel thread
to that process.

kproc_kthread_add() takes the parameters for kthread_add,
plus a process name and a pointer to a pointer to a process instead of just
a pointer, and if the proc * is NULL, it creates the process to the
specifications required, before adding the thread to it.

All other old kthread_xxx() calls return, but act on (struct thread *)
instead of (struct proc *). One reason to change the name is so that
any old kernel modules that are lying around and expect kthread_create()
to make a process will not just accidentally link.

fix top to show kernel threads by their thread name in -SH mode
add a tdnam formatting option to ps to show thread names.

make all idle threads actual kthreads and put them into their own idled process.
make all interrupt threads kthreads and put them in an interd process
(mainly for aesthetic and accounting reasons)
rename proc 0 to be 'kernel' and it's swapper thread is now 'swapper'

man page fixes to follow.


172440 04-Oct-2007 stefanf

The exit status of a case statement where none of the patterns is matched
is supposed to be 0, not the status of the previous command.

Reported by: Eygene Ryabinkin
PR: 116559
Approved by: re (gnn)


172237 19-Sep-2007 kevlo

Use owner name and owning group name instead of uid and gid
for displaying the three-line comment header by default.

Reviewed by: kientzle
Approved by: re (bmah)


172207 17-Sep-2007 jeff

- Move all of the PS_ flags into either p_flag or td_flags.
- p_sflag was mostly protected by PROC_LOCK rather than the PROC_SLOCK or
previously the sched_lock. These bugs have existed for some time.
- Allow swapout to try each thread in a process individually and then
swapin the whole process if any of these fail. This allows us to move
most scheduler related swap flags into td_flags.
- Keep ki_sflag for backwards compat but change all in source tools to
use the new and more correct location of P_INMEM.

Reported by: pho
Reviewed by: attilio, kib
Approved by: re (kensmith)


171268 06-Jul-2007 scf

Take care that the input to setenv() may actually be a pointer straight
from environ; make a copy before manipulating it and passing it to
setenv().

Approved by: wes
Approved by: re (kensmith)


171195 04-Jul-2007 scf

Significantly reduce the memory leak as noted in BUGS section for
setenv(3) by tracking the size of the memory allocated instead of using
strlen() on the current value.

Convert all calls to POSIX from historic BSD API:
- unsetenv returns an int.
- putenv takes a char * instead of const char *.
- putenv no longer makes a copy of the input string.
- errno is set appropriately for POSIX. Exceptions involve bad environ
variable and internal initialization code. These both set errno to
EFAULT.

Several patches to base utilities to handle the POSIX changes from
Andrey Chernov's previous commit. A few I re-wrote to use setenv()
instead of putenv().

New regression module for tools/regression/environ to test these
functions. It also can be used to test the performance.

Bump __FreeBSD_version to 700050 due to API change.

PR: kern/99826
Approved by: wes
Approved by: re (kensmith)


171154 02-Jul-2007 kensmith

Don't include encryption features of ed(1) when building for the
"rescue media" bundled with releases.

Suggested by: ru
Approved by: re (hrs)


170215 02-Jun-2007 remko

Correct the referenced securelevel document, it's now securelevel 7.

Pointed out by: ru


170045 28-May-2007 pjd

Fix probably copy&paste from chmod(1) - we change file flags here, not mode.


169993 25-May-2007 brian

Remove unnecessary free argument casts.
Don't abuse arcname's constness.


169926 24-May-2007 rse

Cleanup pax(1) sources a little bit while I poked around in them:
- remove a superfluous doubled trailing semicolon.
- remove the extra void casts on calls to void-function free(3).


169848 22-May-2007 cperciva

In the error handling path, don't call close(fd) if the error we're
handling is that fd = open(foo) is -1. This bug is harmless since
close(-1) just returns an error (which the code ignores).

Found by: Coverity Prevent(tm)
CID: 1503 (in userland test run)


169626 16-May-2007 mp

Work around a vendor issue that was causing the builtin malloc to be
used instead of the system malloc.

Submitted by: ume


169510 12-May-2007 pav

Replace a fairly opaque sentence with a much clearer wording from NetBSD.

PR: docs/101330 (inspired by)
Submitted by: Peter Gildea <peter@gildea.com>
Obtained from: NetBSD


169177 01-May-2007 ache

Back out all POSIXified *env() changes.

Not because I admit they are technically wrong and not because of bug
reports (I receive nothing). But because I surprisingly meets so
strong opposition and resistance so lost any desire to continue that.

Anyone who interested in POSIX can dig out what changes and how
through cvs diffs.


169133 30-Apr-2007 ache

Simplify previous fix and disallow VTEXTFIXED direct pass for putenv() too,
just use savestr()


169118 30-Apr-2007 ache

Put some safeguards:
1) Under POSIX unsetenv("foo=bar") is explicit error and not equal
to unsetenv("foo")
2) Prepare for upcomig POSIXed putenv() rewrite: make putenv() calls
portable and conforming to standard.


169112 30-Apr-2007 ache

Eliminate error with -W* strict flags and make putenv() calls conforming to
standard in the same way as f.e. gcc internal portable code does.


168544 09-Apr-2007 pjd

Move uuidgen(1) from /usr/bin/ to /bin/. It will be used in rc.d/hostid
script, which will be executed before /usr/ mount.

Reviewed by: mlaier, rink, brooks, rwatson


168428 06-Apr-2007 kan

getblocksize expects pointer to long as a second argument, not
a pointer to u_long.


167469 11-Mar-2007 mp

Build updates for tcsh-6.15.00 import.

Reviewed by: ume
Reminded by: Divacky Roman
MFC after: 1 week


167326 08-Mar-2007 will

Fix a bug where the mutual exclusivity of the -l and -t options is not
recognized properly if -l is specified first.

PR: bin/105721
MFC after: 1 week


167210 04-Mar-2007 ru

Fix markup.


167196 04-Mar-2007 ru

Fix markup.


167105 28-Feb-2007 ru

Fix markup.


167063 27-Feb-2007 ru

Fix markup.


167000 26-Feb-2007 mckusick

Implement the -h flag (set an ACL on a symbolic link).
Before this fix the -h flag was ignored (i.e. setfacl
always set the ACL on the file pointed to by the symbolic
link even when the -h flag requested that the ACL be set
on the symbolic link itself).


166813 18-Feb-2007 ceri

Correct typos containing my login name (plus one more in expr.y).
Found courtesy of a recursive grep in the wrong directory.


166101 18-Jan-2007 stefanf

Use eaccess() instead of access() for the type builtin, like we do for the
test builtin.

Submitted by: Martin Kammerhofer


165930 11-Jan-2007 stefanf

Return an error status (127) from the builtins 'type' and 'command' (with
either -v or -V) if a file with a slash in the name doesn't exist (if there is
no slash we already did that).

Additionally, suppress the error message for command -v for files with a slash.

PR: 107674
Submitted by: Martin Kammerhofer


165564 27-Dec-2006 ru

Fix markup.


165563 27-Dec-2006 ru

More markup fixes.


165562 27-Dec-2006 ru

Fix markup.


165555 26-Dec-2006 ru

Give a hint to the reader as to what the "whiteout" actually means.


165554 26-Dec-2006 ru

Fix markup, add the EXIT STATUS section.


165486 23-Dec-2006 ru

One more nit.


165485 23-Dec-2006 ru

Fix markup.


165463 22-Dec-2006 ru

- Mention umask(2) when first referring to it.
- Add missing markup.

Submitted by: Eugene Grosbein <eugen@grosbein.pp.ru>


165332 18-Dec-2006 ru

Use a standard section name.


165202 14-Dec-2006 ru

Simplify some markup.


165006 08-Dec-2006 kientzle

Style(9) fixes, thanks to Ruslan.


165004 08-Dec-2006 kientzle

Support the "-f" option by simply ignoring it.
This allows script compatibility with Linux, whose
"hostname" is the same as BSD "hostname -s".
With this change, "hostname -f" is the same on
both systems.

MFC after: 7 days


164913 05-Dec-2006 ru

Once upon a time, the hostname was being set in the /etc/netstart,
which can be called a "network initialization script", now that it
is set in /etc/rc.d/hostname, "network" sounds confusing, so remove
it.


164699 27-Nov-2006 ru

Fix some of the alignment warnings on ARM.


164081 07-Nov-2006 stefanf

Fix expanding of quoted positional parameters in case patterns.

Obtained from: NetBSD (expand.c 1.58 and 1.59)
Submitted by: Paul Jarc
PR: 56147


164003 05-Nov-2006 stefanf

When parsing an invalid parameter expansion (eg. ${} or ${foo@bar}) do not
issue a syntax error immediately but save the information that it is erroneous
for later when the parameter expansion is actually done. This means eg. "false
&& ${}" will not generate an error which seems to be required by POSIX.
Include the invalid parameter expansion in the error message (sometimes
abbreviated with ... because recovering it would require a lot of code).

PR: 105078
Submitted by: emaste


163919 02-Nov-2006 ceri

Fix typo.


163812 31-Oct-2006 delphij

Correct a security issue introduced in previous commit:
instead of removing the file and issue a warning about
the removal, do not do any operation at all in case -P
is specified when the dinode has hard links.

With -f and -P specified together, we assume that the
user wants rm to overwrite the contents of the file
and remove it (destroy the contents of file but leave
its hard links as is).

The reason of doing it this way is that, in case where
a hard link is created by a malicious user (currently
this is permitted even if the user has no access to the
file). Losing the link can potentially mean that the
actual owner would lose control completely to the user
who wants to obtain access in a future day.

Discussed with: Peter Jermey


163777 30-Oct-2006 delphij

Be more reasonable when overwrite mode is specified while there
is hard links. Overwritting when links > 1 would cause data
loss, which is usually undesired.

Inspired by: discussion on -hackers@
Suggested by: elessar at bsdforen de
Obtained from: OpenBSD


163716 27-Oct-2006 trhodes

Wording nits.


163666 24-Oct-2006 trhodes

Flesh out the compatibility section a little bit. Bump doc date.


163485 18-Oct-2006 maxim

o Backout rev. 1.55. Don't waste cpu cycles for bzero(), do not
call chflags() for whiteouted files.

Prodded by: ru


163480 18-Oct-2006 ru

Avoid a spurious warning for each whiteout found during "ls -lW".

# ls -lW
total 2
-rw-r--r-- 1 root wheel 6 Oct 18 14:46 file1
ls: ./file2: No such file or directory
w--------- 0 root wheel 0 Jan 1 1970 file2


163476 18-Oct-2006 maxim

o Zero out struct stat before usage. lstat(2) can fail and
leave garbage there which will break -W code path.

PR: bin/84569
Submitted by: Igor
MFC after: 2 weeks


163263 12-Oct-2006 ru

- Improve description of the -A option.
- Document how whiteouts look in the long output. [1]
- Sort entry types.
- Fix description of the socket type.

PR: docs/51921 [1]


163233 11-Oct-2006 trhodes

Fix style(9) bugs in previous commit.

Lesson from: bde


163213 10-Oct-2006 ru

Adhere to POSIX: the -m option only applies to the newly created
directories; it should not change the permission bits of already
existing directories.

Submitted by: Alex Unleashed (modified by me)


163109 07-Oct-2006 trhodes

Make -r a synonym for -R, similar to behavior on Linux while being backwards
compatible with old -r behavior with regards to -L. You can now copy fifos
and other special files with -r.

Reviewed by: -standards (long ago), das, bde
Approved by: bde (recently)


163085 07-Oct-2006 stefanf

Add the POSIX option -p to the jobs builtin command. It prints the PID of the
process leader for each job. Now the last specified option for the output
format (-l, -p or -s) wins, previously -s trumped -l.

PR: 99926
Submitted by: Ed Schouten and novel (patches modified by me)


163075 07-Oct-2006 maxim

o Style(9).

Submitted by: bde


163074 07-Oct-2006 maxim

o Avoid division by zero.
o Place error checking code near to the syscall.

Submitted by: bde


163049 06-Oct-2006 maxim

o Hold copied bytes counter in off_t. This prevents statistics
displayed by SIGINFO handler from overflow.

PR: bin/104039
Submitted by: Geoffrey Giesemann
MFC after: 2 weeks


162763 29-Sep-2006 ru

Move the -l option processing to where it belongs.
Overall still not kosher but better matches style(9).


162483 20-Sep-2006 csjp

Based on The Open Group Base Specifications Issue 6 IEEE Std 1003.1, our
current implementation of df(1) is does not properly format the output under
certain conditions. Right now -kP and -Pk are not the same thing. Further,
when we set the BLOCKSIZE environment variable, we use "1k" instead of "1024",
making the header display incorrectly.

To quote the specification:

"When both the -k and -P options are specified, the following header line
shall be written (in the POSIX locale):

"Filesystem 1024-blocks Used Available Capacity Mounted on\n"

- If -P has been specified, check to make sure that -k has not already been
specified, if so, simply break instead of clobbering the previous blocksize
- Use 1024 instead of 1k to make the header POSIX compliant

Reported by: Andriy Gapon
Discussed with: bde, ru
MFC after: 1 week


162379 17-Sep-2006 ru

Markup fixes.


161608 25-Aug-2006 ru

- Fix options order.
- Touch manpage's document date.


161607 25-Aug-2006 ru

Remove a stray -a option that probably sneaked in from julian's
attempt to enter append mode twice in vi(1). :-)


161586 24-Aug-2006 julian

Add an option to allow copying of a hierarchy while linking he regular files.
Bikeshedded to death on: hackers
Submitted by:andersonatcenttech.com
MFC in: 1 month


161491 21-Aug-2006 yar

For the sake of clarity, explicitly tell that comma and space
characters can be included in a custom column title string --
that's why it may appear at the end of a keyword list argument
only.


161470 20-Aug-2006 imp

Prefer strlcpy to strncpy. In one case, this saves us from re-zeroing
data that's alreday 0. In another, it saves us from zeroing data that
will be overwritten again.


161469 20-Aug-2006 imp

Use strlcpy in place of strncpy + setting the last character NUL. To
be safe, memset the entire msg to '0'.


161442 18-Aug-2006 yar

Document a detail in the present syntax of "ps -o foo=bar". Now
the header title string "bar" extends to the end of the argument
even if it contains commas or spaces, unlike in RELENG_4 or earlier.
The modern syntax agrees with SUSv3.

MFC after: 3 days


161427 17-Aug-2006 imp

while(0); -> while (0) in multiline macro


160964 04-Aug-2006 yar

Commit the results of the typo hunt by Darren Pilgrim.
This change affects documentation and comments only,
no real code involved.

PR: misc/101245
Submitted by: Darren Pilgrim <darren pilgrim bitfreak org>
Tested by: md5(1)
MFC after: 1 week


160849 31-Jul-2006 yar

Do not forget to increment the input line counter
when reading a word spanning multiple lines.

PR: bin/101094
MFC after: 5 days


160848 31-Jul-2006 yar

Granting the amount of misunderstanding the last change received,
extend it with an example to clarify the point.


160812 29-Jul-2006 yar

Tell more of the sh(1) history.
Acknowledge Kenneth Almquist's contribution in AUTHORS.

MFC after: 5 days


160760 27-Jul-2006 yar

Document that both sides of -a or -o are always evaluated. This
"feature" doesn't seem to be in the standards or elsewhere, and
it is against what we are used to in C and sh(1), so put the
paragraph under BUGS.

Pointed out by: dougb
MFC after: 3 days


160694 26-Jul-2006 yar

Make it easier to find that we have test(1) built-in in sh(1).

MFC after: 3 days


160218 09-Jul-2006 markm

More inactive maintainers.


160098 04-Jul-2006 maxim

o Call fts_close() before exit.

Obtained from: NetBSD, Coverity ID 1754


159836 21-Jun-2006 yar

Document the fact that 'true' and 'false' are among sh(1) built-in commands.

MFC after: 3 days


159633 15-Jun-2006 stefanf

Merge NetBSD's revision 1.86: Don't crash on "<cmd> | { }".


159632 15-Jun-2006 stefanf

Implement the PS4 variable which is defined by the POSIX User Portability
Utilities option. Its value is printed at the beginning of the line if tracing
(-x) is active. PS4 defaults to the string "+ " which is compatible with the
old behaviour to always print "+ ".

We still need to expand variables in PS1, PS2 and PS4.

PR: 46441 (part of)
Submitted by: schweikh
Obtained from: NetBSD


159551 12-Jun-2006 stefanf

Don't strip a leading ./ from the path for the cd builtin to avoid interpreting
.//dir as /dir. Rather strip it only for the purpose of checking if the
directory path should be printed.

PR: 88813
Submitted by: Josh Elsasser
Patch from: NetBSD (cd.c rev 1.38)
MFC after: 2 weeks


159465 09-Jun-2006 maxim

o Fix grammar, format.


159464 09-Jun-2006 kib

Document the way to get list of files to process from the stdin.

MFC after: 1 week
Approved by: kan (mentor)


159463 09-Jun-2006 kib

Copy filename read from the stdin into the private buffer. Otherwise,
next read filename overwrite previous one, resulting in acl being
applied only to the last name in the list.

Submitted by: Oleg Lomaka <oleg.lomaka at gmail com>
MFC after: 1 week
Approved by: kan (mentor)


158414 10-May-2006 cokane

Fix the wording about the blocksize (-b) parameter. The existing
wording makes it look like pax archives > 32256 bytes are not
POSIX-compliant! Correct this to state that pax archives with
block sizes > 32256 are not POSIX compliant...and settle our fears.

PR: docs/97059
Reviewed by: Giorgos Keramidas <keramida>


158145 29-Apr-2006 stefanf

POSIX demands that set's output (when invoked without arguments) should be
sorted. Sort the variables before printing.

PR: 96415


158143 29-Apr-2006 stefanf

Check the buffer size when copying the line returned by el_gets() into our
own buffer. Interactively typing in long lines (>1023 characters)
previously overflowed the buffer. Unlike the NetBSD people I don't see the
need to subtract 8 from BUFSIZ, so I just used BUFSIZ-1.

Obtained from: NetBSD
PR: 91110


157811 17-Apr-2006 schweikh

Whitespace nits.


157789 16-Apr-2006 schweikh

Correct assorted grammos and typos.


157770 15-Apr-2006 maxim

o Be pedantic and do fts_close() when done.

PR: bin/95292
Submitted by: Charles Hardin
Obtained from: NetBSD via OpenBSD, PR


157750 14-Apr-2006 schweikh

Output something reasonable for regular and expanded here-documents.
I would have chosen the EOF markers, but they are no longer available
AFAICS, so output "<<HERE" and "<<XHERE" instead.
(NOTE: These changes only affect DEBUG output.)


157601 09-Apr-2006 stefanf

Implement some of the differences between special built-ins and other builtins
demanded by POSIX.
- A redirection error is only fatal (meaning the execution of a shell script is
terminated) for special built-ins. Previously it was fatal for all shell
builtins, causing problems like the one reported in PR 88845.
- Variable assignments remain in effect for special built-ins.
- Option or operand errors are only fatal for special built-ins.
This change also makes errors from 'fc' non-fatal (I could not find any reasons
for this behaviour).

Somewhat independently from the above down-grade the error handling in the
shift built-in if the operand is bigger than $# from an error() call (which is
now fatal) to a return 1. I'm not sure if this should be considered a POSIX
"operand error", however this change is needed for now as we trigger that error
while building libncurses. Comparing with other shells, zsh does the same as
our sh before this change (write a diagnostic, return 1), bash behaves as our
sh after this commit (no diagnostic, return 1) and ksh93 and NetBSD's sh treat
it as a fatal error.


157559 06-Apr-2006 gad

Re-correct commit 1.73, but this time in a way that does not cause
all column-headers to print in lowercase by default. I was in too
much of a rush in committing 1.75, and didn't notice that the case
had changed. This time I did considerably more testing, and used
'diff' instead of just quickly eyeballing the results...

Apologies. I expect this means the dunce cap is mine for awhile.
If this doesn't work, I'll just drop back to 1.72 and hide under
my desk for awhile.


157538 05-Apr-2006 gad

Fix a problem introduced by change 1.73, which causes a seg-fault if
the user specifies a keyword which is an alias to some other keyword.
E.g.: stat (for state) or pcpu (for %cpu)..

Submitted by: Kostik Belousov
MFC plans: "soon"


157414 02-Apr-2006 stefanf

Issue an error when . (dot) is invoked without a filename. The synopsis
is just ". file" according to POSIX, however many other shells allow
arguments to be passed after the file. For compatibility (we even use that
feature in buildworld) additional arguments are not considered to be an
error, even though this shell does not do anything with the arguments at all.


157413 02-Apr-2006 stefanf

Use -s to flag POSIX's "special built-in" utilities in builtins.def. Add a
new member to struct builtincmd and set it to 1 if -s was specified. This
is done because there are cases where special builtins must be treated
differently from other builtins.

Obtained from: NetBSD (builtins.def part)


157101 24-Mar-2006 jhb

Change the -S and -t options to override each other so that the last one
specified wins to make their interaction less confusing.


157100 24-Mar-2006 jhb

Fix a bug such that if you enabled sorting by size (-S) and enabled a
flag to use a time other than modtime (-c, -u, or -U), the output would
actually be sorted by the specified time rather than size. This does
alter the behavior in the case where both -S and -t are specified. Now,
-S is always preferred. Previously, -t was preferred if one of -c, -u, or
-U was specified, and -S was preferred otherwise. Perhaps -S and -t should
override each other (last one specified wins).


157099 24-Mar-2006 jhb

Add a few more references to -U.


157098 24-Mar-2006 jhb

Add a new -U flag to instruct ls to use the birthtime for printing or
sorting.

Submitted by: Andrzej Tobola ato at iem dot pw dot edu dot pl
MFC after: 1 week


156891 19-Mar-2006 ru

Fix spelling.


156813 17-Mar-2006 ru

Reimplementation of world/kernel build options. For details, see:

http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by: imp, jhb, kris, phk, ru (all bugs are mine)


156681 13-Mar-2006 rwatson

Add "-q" argument to getfacl(1), which suppresses the per-file header
comment listing the file name, owner, and group.

MFC after: 1 week
Submitted by: Jan Srzednicki <w at expro dot pl>


156536 10-Mar-2006 trhodes

Use .Cm for all key words, not just the ones I added. More in line with
mdoc(7) according to ru.

Requested by: ru


156424 08-Mar-2006 gad

Collapse strncpy/strncat/strncat into a single snprintf, as suggested
by pjd.

MFC after: 3 weeks


156423 08-Mar-2006 gad

Fix the case where the user specifies an alternate heading for some
output-format keyword, and the keyword they picked is an alias to
some other keyword. E.g.: ps -o stat=Zustand $$
('stat' is defined as an alias for 'state')

PR: bin/57833
MFC after: 3 weeks


156338 06-Mar-2006 trhodes

Slightly better markup.

Discussed with: ru


156269 04-Mar-2006 trhodes

Instead of just hinting at available octets, list some.
Mention that the setting of securelevel may affect one's ability to alter flags.
Xref security.7.
Bump doc date.


155876 21-Feb-2006 cognet

For pts, print the pts number, instead of the full name. As it was, we ended
up always printing "pts".

Submitted by: Michal Mertl <mime at traveller dot cz>


155835 19-Feb-2006 ume

Enable NLS catalog of csh(1).
The tcsh 6.14 uses libiconv to convert catalogs to appropriate charset
dynamically. However, we don't have libiconv in our tree. So, I made
some hack to load libiconv dynamically. If libiconv is available, you
can use catalogs for more locales than the locales which catalog is
actually installed.
To use this feature, you need to symlink catalogs to appropriate
locales. You can do this by installing ports/shells/tcsh_nls.

Reviewed by: arch (no objection)
MFC after: 1 week


155667 14-Feb-2006 glebius

Add '-F' option which allows to delete existing empty directories, when
creating symbolic links.

PR: bin/92149
Submitted by: Eugene Grosbein <eugen grosbein.pp.ru>


155304 04-Feb-2006 schweikh

Initialize PWD early on (don't expect it to be inherited from the
environment or set it only when changing directories with cd).

PR: standards/92640


155303 04-Feb-2006 schweikh

s/staticly/statically/g


155302 04-Feb-2006 schweikh

s/varable/variable/; s/tored/stored/


155301 04-Feb-2006 schweikh

Remove some white space at EOL.


153951 01-Jan-2006 stefanf

Document that '#' starts a comment.

PR: 85103
Submitted by: garys
Obtained from: pdksh manual
Patch from: Daniel Gerzo (with changes by me)


153417 14-Dec-2005 maxim

o Now when SIG_IGN signal action for SIGCHLD reap zombies
automatically it is possible wait4(2) returns -1 and sets
errno = ECHILD if there were forked children. A user can
set such signal handler e.g. via ``trap "" 20'', see a PR
for the test case. Deal with this case and mark a job as
JOBDONE.

PR: bin/90334
Submitted by: bde
MFC after: 4 weeks


153380 13-Dec-2005 ru

[mdoc] add missing space before a punctuation type argument.


153246 08-Dec-2005 stefanf

- Document trap's -l option and the behaviour of a missing action or a single
dash.
- Discourage the omission of the action.

PR: 70985 [1]
Submitted by: Martin Kammerhofer


153245 08-Dec-2005 stefanf

Print empty quotes ('') when an empty string is passed to outqstr().
This makes a difference for the trap builtin, where after "trap '' 0" we
printed "trap -- quit". This is wrong, because an empty action means to reset
the action to the default. A side effect of this commit is that empty
variables are now printed as "variable=''" instead of just "variable=".


153244 08-Dec-2005 stefanf

Correctly quote the output when showing the installed trap actions.

PR: 74043
Submitted by: Jilles Tjoelker


153240 08-Dec-2005 stefanf

Clarify that the echo builtin takes an arbitrary number of strings.
Mention that spaces are printed between the strings.


153094 04-Dec-2005 stefanf

Sort.


153093 04-Dec-2005 stefanf

Remove a few commented out builtins from the original ash. The files
implementing them were never part of FreeBSD.


153091 04-Dec-2005 stefanf

Add the times builtin. It reports the user and system time for the shell
itself and its children. Instead of calling times() (as implied by POSIX) this
implementation directly calls getrusage() to get the times because this is more
convenient.


152547 17-Nov-2005 ru

-mdoc sweep.


152469 16-Nov-2005 ru

Having three options (-a, -A, -I) controlling the output of dotted
files is too much and hard to follow. Instead, make the -I option
just mean "do not automatically set -A for root". That is, if -A
is explicitly set, -I is ignored. Also, document -I in usage().
(The ls.c diff is better viewed relative to rev. 1.80.)

No objection: mux
Silence from: mnag
MFC after: 3 days


152281 10-Nov-2005 mux

Mention the non-standardness of the -I option in ls(1).

Spotted by: ru
MFC after: 3 days


152256 10-Nov-2005 mux

Add a -I option to disable the automatic -A flag for the super-user.

PR: bin/86710
Submitted by: Marcus Alves Grando
MFC after: 3 days


151984 03-Nov-2005 jcamou

Add `local' and `return' to the list of built-ins.

Submitted by: garys
Approved by: trhodes (mentor)


151933 01-Nov-2005 trhodes

Note which options are not part of the standards.
Xref locale(1) and bump document date.

Reviewed by: keramida
No Objections: -standards


151866 29-Oct-2005 stefanf

Include disabled options in the output of 'set +o'. POSIX says the output of
set +o can be used to reload previous settings, for this to work disabled
options must be printed as well or otherwise options that were set in the mean
time won't be turned off.

To avoid an excessively long output line I formatted the output to print only
six options per line.

Submitted by: Jilles Tjoelker
PR: 73500


151858 29-Oct-2005 stefanf

Document command -v and -V.

Glanced at by: simon


151856 29-Oct-2005 stefanf

Document that read -t timeout returns 1 if the timeout elapses.


151810 28-Oct-2005 stefanf

Add the POSIX options -v and -V to the 'command' builtin. Both describe the
type of their argument, if it is a shell function, an alias, a builtin, etc.
-V is more verbose than -v.

PR: 77259, 84539


151795 28-Oct-2005 stefanf

Protect malloc, realloc and free calls with INT{ON,OFF} directly in chkalloc,
ckrealloc and ckfree (added), respectively. sh jumps out of the signal handler
using longjmp which is obviously a bad idea during malloc calls.

Note: I think there is still a small race here because volatile sig_atomic_t
only guarantees atomic reads and writes while we're doing increments and
decrements.

Protect a setmode call with INT{ON,OFF} as it calls malloc internally.

PR: 45478
Patch from: Nate Eldredge


151471 19-Oct-2005 stefanf

Use the new name H_SETSIZE instead of the old H_EVENT to set the history
size.

PR: 86355


150742 30-Sep-2005 dougb

Give .Dd a tummy rub, forgotten on my last commit.


150729 29-Sep-2005 dougb

Handle the case where the -P flag is specified for a read-only file
earlier, and more gracefully. Previously, this combination would be
ignored early in the code where permissions are tested and fail later
with a very unhelpful "permission denied" error.

Instead, test for this flag in the same block that generates the
"override?" messages for read-only files, but instead of trying
to guess what the user has in mind, generate an error and exit.

Update the man page to reflect this new behavior.

Not objected to by: freebsd-hackers@


150479 22-Sep-2005 mp

Bump up BUFSIZE from 4k to 8k. This was requested by portmgr@ to allow
ports builds in the cluster to work correctly.

Tested by: kris


150101 13-Sep-2005 rwatson

Add a "-q" quiet flag to kenv so that warnings can be suppressed.

MFC after: 1 week


149938 10-Sep-2005 stefanf

Elaborate on the behaviour of set -e.


149933 10-Sep-2005 stefanf

Pass the EV_TESTED flag to evalloop() and evalfor(). This fixes unwanted
termination with set -e if a command fails in a loop body inside a function
with an explicitely tested exit status, eg

f() {
for i in 1 2 3; do
false
done
}
f || true

Briefly reviewed by: cracauer


149932 10-Sep-2005 stefanf

Pass the EV_TESTED flag to the left operand of NSEMI nodes. This fixes
two cases of unwanted termination with set -e:

* if-commands containing several commands separated by semicolons, eg

if false; false; then [...]

* functions with an explicitely tested exit status that contain a failing
command which is not the last one, eg

f() {
false
false
}
f || true

PR: 77067, 85267
Briefly reviewed by: cracauer


149927 10-Sep-2005 stefanf

Exit the shell if a pipeline that is not preceded by ! fails and set -e is
active. Use a separate flag to avoid adding another condition to the
if-statement at the end of evaltree().

Briefly reviewed by: cracauer


149920 09-Sep-2005 stefanf

Split the export synopsis into two lines as -p cannot be mixed with variable
names.


149919 09-Sep-2005 stefanf

- Provide a reasonable error message for `export -p var'.
- Use argv rather than argptr since getopt() is used here.


149918 09-Sep-2005 stefanf

Fix the error message if the mask that is passed to umask -S contains
non-digits.


149845 07-Sep-2005 rse

Mention that uuidgen(1) generates DCE version 1 UUIDs only


149826 06-Sep-2005 rse

fix typos: decribed -> described, preceeded -> preceded


149825 06-Sep-2005 rse

Various small code cleanups resulting from a code reviewing
and linting procedure:

1. Remove useless sub-expression:

- if (*start || (!ifsspc && start > string && (nulonly || 1))) {
+ if (*start || (!ifsspc && start > string)) {

The sub-expression "(nulonly || 1)" always evaluates to true and
according to CVS logs seems to be just a left-over from some
debugging and introduced by accident. Removing the sub-expression
doesn't change semantics and a code inspection showed that the
variable "nulonly" is also not necessary here in any way (and the
expression would require fixing instead of removing).

2. Remove dead code:

- if (backslash && c == '\\') {
- if (read(STDIN_FILENO, &c, 1) != 1) {
- status = 1;
- break;
- }
- STPUTC(c, p);
- } else if (ap[1] != NULL && strchr(ifs, c) != NULL) {
+ if (ap[1] != NULL && strchr(ifs, c) != NULL) {

Inspection of the control and data flow showed that variable
"backslash" is always false (0) when the "if"-expression is
evaluated, hence the whole block is effectively dead code.
Additionally, the skipping of characters after a backslash is already
performed correctly a few lines above, so this code is also not
needed at all. According to the CVS logs and the ASH 0.2 sources,
this code existed in this way already since its early days.

3. Cleanup Style:

- ! trap[signo][0] == '\0' &&
+ ! (trap[signo][0] == '\0') &&

The expression wants to ensure the trap is not assigned the empty
string. But the "!" operator has higher precedence than "==", so the
comparison should be put into parenthesis to form the intended way of
expression. Nevertheless the code was effectively not really broken
as both particular NUL comparisons are semantically equal, of course.
But the parenthesized version is a lot more intuitive.

4. Remove shadowing variable declaration:

- char *q;

The declaration of symbol "q" hides another identical declaration of
"q" in the same context. As the other "q" is already reused multiple
times and also can be reused again without negative side-effects,
just remove the shadowing declaration.

5. Just small cosmetics:

- if (ifsset() != 0)
+ if (ifsset())

The ifsset() macro is already coded by returning the boolean result
of a comparison operator, so no need to compare this boolean result
again against a numerical value. This also aligns the macros usage to
the remaining existing code.

Reviewed by: stefanf@


149816 06-Sep-2005 rse

fix typo: ommitted -> omitted


149802 05-Sep-2005 stefanf

Print pointers with %p rather than casting them to long.


149790 05-Sep-2005 csjp

Attempt to complete the userspace integration of POSIX.1e extended ACLs.
This includes adding support for ACLs into cp(1) and mv(1) userspace
utilities.

For mv(1), if _PC_ACL_EXTENDED is in effect for the source AND destination
operands, the destination file's ACLs shall reflect the source.

For cp(1), if _PC_ACL_EXTENDED is in effect for both source and destination
operands, and -p has been specified, the ACLs from the source shall be
preserved on the destination.

MFC after: 1 month


149763 03-Sep-2005 stefanf

Document that `in word ...' is optional in the for command.


149743 02-Sep-2005 stefanf

Return 1 from the unalias builtin if _any_ removal fails, not just the last
one.


149742 02-Sep-2005 stefanf

Remove extra getenv() declaration.


149740 02-Sep-2005 stefanf

Document that unalias can be used to remove several alias names.


149676 31-Aug-2005 garys

Improved descriptions of block size handling.

PR: docs/84765
Submitted by: garys
Approved by: keramida
MFC after: 3 days


149604 29-Aug-2005 jcamou

Wrap a line due to a new sentence.

Noticed by: simon
Approved by: trhodes (mentor)


149562 29-Aug-2005 jcamou

o Discuss the ways to escape an alias.
o Fix the alias syntax lines.
o Refer to the Aliases subsection.

PR: docs/84914
Submitted by: garys
Approved by: trhodes (mentor)
MFC after: 3 days


149209 17-Aug-2005 stefanf

Document umask's -S option.


149096 15-Aug-2005 stefanf

Remove a hack for an ancient gdb.


149046 14-Aug-2005 stefanf

Recent cleanups made it possible to bump WARNS to 3.


149026 13-Aug-2005 stefanf

Put the comparison with PEOF into a new macro is_eof(). Don't use it if the
character comes from a string.


149025 13-Aug-2005 stefanf

Declare echocmd() and testcmd().


149024 13-Aug-2005 stefanf

Use assignment rather than comparison.


149019 13-Aug-2005 stefanf

- Provide all initialisers for a struct event.
- Include init.h in the generated init.c.
- Generate prototypes and put the brace on the next line.


149018 13-Aug-2005 stefanf

First declare the functions to pacify -Wmissing-prototypes.


149017 13-Aug-2005 stefanf

Include missing headers.


149016 13-Aug-2005 stefanf

Use prototypes in the MKINIT lines collected by mkinit.


149015 13-Aug-2005 stefanf

Use prototypes in the generated builtins.{c,h} files.


149012 13-Aug-2005 stefanf

cvs -d stefanf@ncvs.FreeBSD.org:/home/ncvs


148974 11-Aug-2005 stefanf

El_parse's third parameter is now const-qualified, add a cast.


148816 07-Aug-2005 stefanf

Fix a comment.

Submitted by: Liam J. Foy


148673 03-Aug-2005 phk

Don't install examples of NO_EXAMPLES


148490 28-Jul-2005 keramida

Spell "protections" correctly.


148478 28-Jul-2005 keramida

Spell "background" correctly.


147812 07-Jul-2005 delphij

Fix a bug when shell expansion is done against dangling symlinks, by
converting the stat() call to a lstat() call, which will cover the
situation. One can exercise this bug by referring a dangling link with
something like */the-link.

Approved by: re (scottl)
Submitted by: Simon 'corecode' Schubert [corecode fs ei tum de]
Obtained from: NetBSD via DragonFlyBSD (NetBSD rev. 1.51 and DragonFly
rev. 1.6)
MFC After: 3 days


147363 14-Jun-2005 ru

Sort sections.

Approved by: re (blanket)


147362 14-Jun-2005 ru

Sorted sections and fixed prompt (PS[12]) strings.

Approved by: re (blanket)


147361 14-Jun-2005 ru

Put the description of the -c option in the right place, as
promised by the Argument List Processing section introduction.
What follows the option in the options list is its long name,
not its argument (as is the case for the -c option). Also
sort references in the SEE ALSO section.

Approved by: re (blanket)


147225 10-Jun-2005 des

Remove kludges intended to support src trees with partial obj trees.

Discussed with: ru


146926 03-Jun-2005 dd

Remove the EXAMPLES section that describes how to sort by size using
sort(1). This functionality is provided by the -S option now, and it
is useful even though a similar effect is achievable with sort(1),
since the latter doesn't work in combination with -h. This option is
also present in NetBSD, OpenBSD, and GNU fileutils, so there's clearly
a demand for it.

Noticed by: asmodai


146925 03-Jun-2005 dd

Improve wording: A sort is "in" a particular order, not "by" a
particular order.


146924 03-Jun-2005 dd

Add the -S option to sort files by size. NetBSD and OpenBSD already
have this option with identical semantics (sorting large files first).
-r can be used to reverse the sort if that is desired.

PR: 81625
Submitted by: Kostas Blekos <mplekos@physics.upatras.gr>, keramida


146821 31-May-2005 tjr

The new name for the DIAGNOSTICS section is EXIT STATUS.

Noticed by: ru


146735 29-May-2005 tjr

Move information about exit status into a DIAGNOSTICS section.


146636 26-May-2005 ache

Fix: printed output flags (onocr) and (onlret) same as oxtabs

PR: 81256
Submitted by: Arseny Nasokin <tarc@tarc.po.cs.msu.su>


146418 19-May-2005 mux

Correct a few places where we called warn() when warnx() should have
been used.

Submitted by: "Liam J. Foy" <liamfoy@sepulcrum.org>
Obtained from: DragonFlyBSD


146255 16-May-2005 gad

A second attempt to adjust option-parsing on a shell command, for the
benefit of scripts start out as: #!/bin/sh -- # -*- perl -*-
With this fix in place, we can commit a change to kern/imgact_shell.c
so FreeBSD will process the `#!' line in shell-scripts in a more
standard fashion.

PR: 16393
Mentioned on: freebsd-arch


146224 14-May-2005 dd

Add an interface to the lchflags(2) syscall. The new -h option is
analogous to chmod(1)'s -h. It allows setting flags on symbolic links,
which *do* exist in 5.x+ despite a claim to the contrary in the
chflags(1) man page.

Suggested by: Chris Dillon


145887 04-May-2005 mp

Define HAVE_STRUCT_UTMP_UT_HOST in order for the REMOTEHOST environment
variable to show up correctly.

Note: This is really a bug with the stock tcsh configure.in script not
including <sys/types.h> before <utmp.h>. But, since config.h is maintained
separate from the contrib sources, this is the correct fix.

Noticed by: ache


145675 29-Apr-2005 maxim

o Typo: s/teminal/terminal/.

Submitted by: Michal Varga


145483 24-Apr-2005 mp

Add in FreeBSD specific options for tcsh 6.14.


145482 24-Apr-2005 mp

Add the config.h resulting from running the configure script.

Note: the contents of this file has changed between 6.13 and 6.14.
The old contents of this file has been repocopied to config_p.h.


145481 24-Apr-2005 mp

Add new file (tc.nls.c) to the build.


145212 17-Apr-2005 keramida

There is no /etc/rc.network anymore.

Submitted by: Benjamin Rossen <b.rossen@onsnet.nu>
MFC after: 2 weeks


145115 15-Apr-2005 keramida

Various sh(1) enhancements:
- Move the description of the ``-c string'' option closer to the option itself.
- Add an ENVIRONMENT section (1)
- Add more .Xr cross references to the SEE ALSO section.

Obtained from: NetBSD (1)


144758 07-Apr-2005 scottl

Document problems with writing to disks under GEOM.


143872 20-Mar-2005 pjd

Add and document the 'jid' keyword for the '-o' option.

Reviewed by: gad
MFC after: 3 days


143447 12-Mar-2005 obrien

Fix bin/pax doesn't wait for compress/gzip before exiting.

Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de>
Obtained from: OpenBSD (commited fix to PR 3455)


143125 04-Mar-2005 keramida

Use ``.Pq Ql'' to quote single characters, instead of ``.Pq Li''.
This makes the resulting output more aesthetically pleasing in
text-only terminals:

Reviewed by: ru


143124 04-Mar-2005 keramida

Add a section describing the exit status of the shell.

Obtained from: NetBSD


143026 02-Mar-2005 trhodes

Wrap BSD r* commands in NO_RCMDS.
Change NO_RCMDNS to NO_RCMDS and do the switch in bsd.compat.mk.

Discussed with: ru, nectar


142845 01-Mar-2005 obrien

Support \H, \h, \w, \W, \$ string expansion in the prompt.

Submitted by: mini


142677 27-Feb-2005 phantom

Fix typo


142412 25-Feb-2005 trhodes

Fix a few markup nits in previous commit.

Noticed by: ru, who else? :)


142346 24-Feb-2005 trhodes

Note how cp(1) handles directories ending in "/."

PR: 75774
Submitted by: Mike Meyer <mwm@mired.org> (original version)


142339 23-Feb-2005 trhodes

Add information on utilities which may or may not be aware of file flags.

PR: 55653
Submitted by: Tony Maher <tonymaher@optushome.com.au> (original version)


141962 16-Feb-2005 gad

Change /bin/sh so *it* implements the processing needed for scripts to
work as expected when they have a "shebang line" of:

#!/bin/sh -- # -*- perl -*- -p

This specific line is recommended in some perl documentation, and I think
I've seen similar lines in documentation for ruby and python. Those
write-ups expect `sh' to ignore everything after the '--' if the first
thing after the '--' is a '#'. See chapter 19, "The Command-Line Interface"
in 3rd edition of "Programming Perl", for some discussion of why perl
recommends using this line in some circumstances.

The above line does work on solaris, irix and aix (as three data points),
and it used to work on FreeBSD by means of a similar patch to execve().
However, that change to execve() effected *all* shells (which caused
other problems), and that processing was recently removed.

PR: 16393 (the original request to fix the same issue)
Reviewed by: freebsd-current (looking at a slightly different patch)
MFC after: 1 week


141917 14-Feb-2005 delphij

Several improvements to ps.1:
- Document the fact that empty heading text suppresses the
heading line (e.g. 'ps -o pid='), as this is very useful
in scripts.
- Describe logname keyword more completely.
- Describe the printing of arguments more completely.
- Put lockname in the correct alphabetical order in the list
of all keywords.
- Correct sentence in standards section.

Submitted by: Jilles Tjoelker <jilles at stack nl>
PR: docs/73618
MFC After: 1 week


141851 13-Feb-2005 ru

Expand contractions.


141846 13-Feb-2005 ru

Expand *n't contractions.


141580 09-Feb-2005 ru

Fixed the misplaced $FreeBSD$.


141578 09-Feb-2005 ru

Sync program's usage() with manpage's SYNOPSIS.


141401 06-Feb-2005 csjp

Since it is not un-common for a process's resident set size (rss)
to exceed 10 megabytes in size (especially in X), bump the max
column width from 4 bytes to 5. This will make the ps auxw output
uniform again when a process's rss exceeds 10 megs.

It should be noted that when 5 digits becomes to small, other
solutions should be explored such as displaying them in megabytes
or having ps automatically re-size column widths.

Discussed with: gad
MFC after: 1 week


141096 01-Feb-2005 phantom

Use LC_MESSAGES locale category instead of value of LANG environment variable
while opening of tcsh's message catalog. It gives us more flexibility, and
do not change current behaviour (since we call setlocale() here)

Submitted by: Rostislav Krasny <rosti_bsd@yahoo.com>
PR: bin/76773
MFC After: 3 days


140909 27-Jan-2005 delphij

Remove unnecessary SRCS= where could be guessed directly by our
bsd.*.mk infrasture.

Obtained from: ru


140903 27-Jan-2005 delphij

ps(1) is WARNS=6 on all Tier-1 platforms as far as I can test,
so use default WARNS level from bin/Makefile.inc


140902 27-Jan-2005 delphij

Don't specify SRCS= when it can be obtained from PROGS=


140901 27-Jan-2005 delphij

WARNS?=6 is already in bin/Makefile.inc, so remove this one.


140851 26-Jan-2005 ssouhlal

Remove useless errno.h include.

Approved by: grehan (mentor)
Obtained from: DragonFlyBSD


140850 26-Jan-2005 ssouhlal

Remove WARNS?= 6 from Makefile, since it is already in src/bin/Makefile.inc

Requested by: ru
Approved by: grehan (mentor)


140816 25-Jan-2005 ssouhlal

- The first argument of getmode() is a void *
- Add WARNS?= 6

Approved by: stefanf, grehan (mentor)
Obtained from: DragonFlyBSD


140563 21-Jan-2005 ru

De-kerberize the manpage.


140368 17-Jan-2005 ru

Added the EXIT STATUS section where appropriate.


140353 16-Jan-2005 ru

Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.


140344 16-Jan-2005 charnier

no need to have break; after return;


140295 15-Jan-2005 ru

Eliminate macro calls inside literal displays.


140169 13-Jan-2005 ru

Removed harmful empty lines that crept in during the copyright
header update.


140097 12-Jan-2005 brian

Don't decend into directories when -d is set and the directory itself doesn't
match.

PR: 28095
Submitted by: bill at twwells dot com
MFC after: 7 days


140050 11-Jan-2005 joerg

The total sum of blocks for the -l and -s option is printed always,
regardless whether the output is to a terminal or not. As this is
consistent with the SUSPv2 specification (even though we do not
otherwise fully implement SUSPv2's ls(1) options), document this as it
is now, rather than trying to change the behaviour itself.

PR: docs/76072
Submitted by: Sebastian Rey <Sebastian.rey@gmx.net>
MFC after: 1 week


139969 10-Jan-2005 imp

/*- or .\"- or #- to begin license clauses.


139965 10-Jan-2005 imp

Remove the clause 3, per berkeley and mail from rwatson representing
that nai was OK with all third clause removals.


139943 09-Jan-2005 ru

Scheduled mdoc(7) sweep.


139673 04-Jan-2005 ceri

Correct typo.


139171 22-Dec-2004 rwatson

Remove single line containing the word "KLD" ommitted in ps.1:1.80.

Pointed out by: ru (some time ago)


139113 21-Dec-2004 ru

NOCRYPT -> NO_CRYPT


139112 21-Dec-2004 ru

NOSHARED -> NO_SHARED


138313 02-Dec-2004 maxim

o Add a missed "." .

Reviewed by: ru
MFC after: 3 weeks


138312 02-Dec-2004 maxim

o Terminate an endless loop sh -T goes into in dowait() around waitproc().

XXX from Tor: "The shell can also go into a similar loop if the child was
killed by signal 127, since the shell would believe the child to have
only stopped (WIFSTOPPED() macro returns nonzero value). Disallowing
signals 127 and 128 will fix that problem." See kern/19402 for details.

PR: bin/66242
Submitted by: tegge
Analysis and testcase by: demon
MFC after: 3 weeks


138191 29-Nov-2004 rwatson

Point at the mac(4) man page when describing the -Z option.
Remove reference to /dev/lomac, which is no longer used by mac_lomac(4).

MFC after: 3 days


137902 20-Nov-2004 ru

Do not emit a spurious warning when "directory" argument
to "rmdir -p" is absolute, with one or more leading slash.


137901 20-Nov-2004 ru

Fixed "rmdir -p" that got broken by rev. 1.15.
(This also fixes "rmdir -v /nonexistent".)


137890 19-Nov-2004 csjp

Use statfs instead of getmntinfo(). This will make the procfs checks
play nicer in prisons. It also simplifies things.

Reviewed by: rwatson
Bumped into by: Jilles Tjoelker


137696 14-Nov-2004 csjp

Currently if the user specifies -e and procfs is not mounted on /proc,
printing of the process environment will fail silently.

-define a function which will check to see if procfs is mounted on /proc
-Implement this test if the user specified -e
-If procfs is not mounted on /proc and -e was specified, print a warning.
informing the user that procfs(5) is required.

Reviewed by: wes, rwatson


137670 13-Nov-2004 ru

Removed bitrot.


137645 13-Nov-2004 yar

Fix off-by-one errors and potential buffer overruns
WRT handling file and link names that reach the allowed
maximum for old tar and ustar archive formats.

PR: bin/40466
Submitted by: Cyrille Lefevre <email in the PR> (portions)
Reviewed by: freebsd-arch (silence)
MFC after: 1 month


137639 13-Nov-2004 jkh

UNIX conformance: If -r -f on non-existent directory, don't emit error.


137314 06-Nov-2004 ache

Back out recent TTYDEF_LFLAG_ECHO invention.

This change is NOP, because TTYDEF_LFLAG = TTYDEF_LFLAG_ECHO now,
but to minimize diffs with other BSDs.


137164 03-Nov-2004 ru

Introduce the PRECIOUSPROG knob in bsd.prog.mk, similar
to PRECIOUSLIB from bsd.lib.mk. The side effect of this
is making installing the world under jail(8) possible by
using another knob, NOFSCHG.

Reviewed by: oliver


137131 02-Nov-2004 phk

stty sane should set the echo bits.

PR: 73423
Submitted by: Michiel Boland <michiel@boland.org>
Overlooked by: phk


137113 01-Nov-2004 alfred

When listing the special $ variables, ($!, $#, etc) list them as $!
instead of just !, this allows one to more easily locate/understand
the section of the manpage in question.

Additional wording correction by: keramida
Reviewed by: keramida


137110 01-Nov-2004 delphij

Correct a typo and make the documentation more mdoc(7) complaint.

Pointed out by: dd
Approved by: murray (mentor)


137009 28-Oct-2004 delphij

Add -I, an option that asks for confirmation once if recursively
removing directories or if more than 3 files are listed in the
command line.

This feature is intended to provide a safe net but not being too
annoying like having "rm -i" for every deleting operations, and
is generally good for both newbies and power users, preventing
them from being so easily run into ``rm -rf /'', ``rm -rf *''
and so forth.

Originally implemented by Matthew Dillon for DragonFly, plus
some improvements done by various DragonFly contributors.

Approved by: murray (mentor; the original dillon's version)
Discussed with: des
Obtained from: DragonFly's bin/rm/
rm.c rev. 1.4 - 1.8
rm.1 rev. 1.3 - 1.4
MFC After: 1 month


136124 04-Oct-2004 des

The previous commit added code to rm(1) to warn about and remove any
occurrences of "/" in the argument list. This corresponds to Enhancement
Request Number 5 in the Austin Group TC2 Aardvark's XCU Defects Report
(<URL:http://www.opengroup.org/austin/aardvark/finaltext/xcubug.txt>).
Further discussion is available in the Austin Group mailing list archives
(<URL:http://www.opengroup.org/austin/mailarchives/>, "Defect in XCU rm")
and for Austin Group members, in the Austin Group Interpretations archive
(<URL:http://www.opengroup.org/austin/interps/>, AI-019)

This commit makes that check conditional on !POSIXLY_CORRECT, since it
is not strictly correct according to the current version of the standard
(but is expected to be correct according to the next version, and has
already been adopted by Solaris).


136123 04-Oct-2004 des

Markup fixes.

Pointed out by: ru


136113 04-Oct-2004 des

Find out how flame-proof my underwear really is.


136112 04-Oct-2004 des

Whitespace cleanup.


136089 03-Oct-2004 stefanf

chflags compiles with WARNS?=6.


136088 03-Oct-2004 stefanf

Garbage collect a variable whose value was never read.


135856 27-Sep-2004 des

Attempting to unset an undefined variable or function should not be
considered an error according to the Open Group Base Specification.

PR: standards/45738
Submitted by: Matthias Andree <matthias.andree@web.de>
MFC after: 3 days


135718 24-Sep-2004 das

Don't read the byte at *argv[strlen(*argv) + 1].

PR: 71743


135542 21-Sep-2004 keramida

Group equivalent flags together and delete the `aliases' section.

PR: docs/70856
Submitted by: Rostislav Krasny <rosti_bsd@yahoo.com>


133762 15-Aug-2004 rwatson

Add a "fillchar" command line argument to dd(1) that permits the user
to specify an alternative padding character when using a conversion
mode, or when using noerror with sync and an input error occurs. This
facilities reading old and error-prone media by allowing the user to
more effectively mark error blocks in the output stream.


133381 09-Aug-2004 yar

Change the behaviour of `-v' so that, e.g., stepping a month back
on March 31 won't take you to March 2 or 3 (now the result will
be the last day of February.)

In general, now stepping by months from the last days of the current
month A will take you to the very last day of the target month B if
B is shorter than A.

The previous version would just step to March 31 and rely on mktime(3)
to correct the date. Despite its simplicity, such way was counter-intuitive
to users and caused pain to shell script writers.

Noticed by: Igor Timkin <ivt at gamma dot ru>
Approved by: brian
MFC after: 2 weeks


133196 06-Aug-2004 cperciva

Join the 21st century: Cryptography is no longer an optional component
of releases. The -DNOCRYPT build option still exists for anyone who
really wants to build non-cryptographic binaries, but the "crypto"
release distribution is now part of "base", and anyone installing from a
release will get cryptographic binaries.

Approved by: re (scottl), markm
Discussed on: freebsd-current, in late April 2004


133187 06-Aug-2004 gordon

Now that we have gcc 3.4, we can flip ia64 to using a dynamically linked
/bin and /sbin.

Reviewed by: marcel (via pluto1)


132933 31-Jul-2004 pjd

Allow for capital letters as size suffixes.

Inspired by: le
Approved by: green (maintainer)


132465 20-Jul-2004 csjp

Currently if a mount point is not accessible by the calling user,
invalid information will be printed if the -t flag is specified.

$ df -t ufs
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ad0s1a 495726 139944 316124 31% /
/dev/ad0s1e 253678 6438 226946 3% /tmp
/dev/ad0s1f 56206340 13594248 38115586 26% /usr
/dev/ad0s1d 694126 19812 618784 3% /var
/dev/ad0s1d 694126 19812 618784 3% /var
$

Note that the mount point which is not accessible shows
up as the previous file system that was printed. The reason
for this is that df -t will call statfs(2) on the pathname
supplied by getfsstat(2).

This is done to refresh the file system statistics in the
event that a previous file system had a long delay in
providing its stats.

This change affects the df utility in the following ways:
o Teach df has to deal with statfs(2) failing. If statfs(2)
fails, fall back on the possibly stale stats provided by
the initial call to getfsstat(2).
o Print a warning that the fs stats could possibly be stale
o Modify the man page and document this new behavior
as a bug.

Approved by: bmilekic (mentor)
PR: 68165


132433 20-Jul-2004 tjr

Use warn() instead of perror().


132272 17-Jul-2004 alfred

Give the most awesome example of how to parse the output of date
back into epoch time. Everytime I'm asked to do this by someone I
have to spend about ten minutes recreating the same command line.
So record it under examples.


132029 12-Jul-2004 tjr

Remove BUGS section that talked about missing multibyte character support.
We have support now that the regular expression routines do.


131966 11-Jul-2004 mp

KANJI and DSPMBYTE are now "on" by default in the tcsh 6.13.00 distribution.


131513 03-Jul-2004 tjr

Document missing multibyte character handling in utilities specified
by POSIX.


131512 03-Jul-2004 tjr

Clarify: test compares strings by binary value, not "ASCII value".


131505 03-Jul-2004 ru

Deal with double whitespace.


131484 02-Jul-2004 ru

Mechanically kill hard sentence breaks.


131472 02-Jul-2004 ru

Removed trailing whitespace.


131215 27-Jun-2004 gad

Change the "rtprio" format so it prints an informative string for
the PRI_ITHD case (instead of just printing the digit '1').

Submitted by: Cyrille Lefevre


131209 27-Jun-2004 gad

Improve checking for `ps -t <dev>', and give better error messages when
an invalid <dev> is specified. Aside: It turns out that the S_ISCHR()
check is true for almost every device that we have (not just tty's).


131085 25-Jun-2004 obrien

Don't continue if the '-C' option (a-la GNUtar; commited in options.c
rev 1.18, but not documented in the man page) caused a failed chdir.
Otherwise, one can easily overwrite files.

Submitted by: Robert Nagy <robert@openbsd.org>
Obtained from: OpenBSD


131024 24-Jun-2004 gad

Fix a bug I introduced by some last-minute changes in -r 1.102. I ended
up checking the wrong variable for NULL.

Submitted by: bde


131010 24-Jun-2004 gad

Rework the logic for `-t <tty>', such that it accepts "ttyp0" and "console",
in addition to "/dev/ttyp0" or "p0" and "/dev/console" or "co".


130999 23-Jun-2004 gad

Change "struct varent" to use the standard queue(8) macros, instead of
using it's own version of the same basic algorithm.

Submitted by: part by Cyrille Lefevre, part of it done by me


130991 23-Jun-2004 gad

Add a check for defunct processes in saveuser(), so the output for "args"
(aka "command") will display "<defunct>", as does the output from "comm"
for those processes. Also do better checking for malloc() failures.

Submitted by: Cyrille Lefevre


130975 23-Jun-2004 gad

Avoid padding the value of "ucomm" when it is the last column in the line.

Submitted by: Cyrille Lefevre


130974 23-Jun-2004 gad

Make sure the value of "upr" (scheduling priority on return from system call)
is scaled in the same way that "pri" (scheduling priority) is scaled.

Submitted by: Cyrille Lefevre


130973 23-Jun-2004 gad

Include the `-c' option in the usage() message.

Submitted by: Cyrille Lefevre


130972 23-Jun-2004 gad

In the sorting routine, sort by thread-id if two processes have the same PID.

Submitted by: Cyrille Lefevre


130967 23-Jun-2004 dwmalone

Fix some style bugs I introduced pointed out by bde. Also add a blank
line after the empty variable declarations.

Reviewed by: md5


130926 22-Jun-2004 dwmalone

Use nanoseconds and then lexicographic ordering when the seconds of
the [acm]time are the same. I was going to use Scott's patch, but I
couldn't get the style quite right, so I used a patch of my own.

Submitted by: Scott Mitchell <scott+freebsd at fishballoon.org>
MFC after: 3 weeks


130897 22-Jun-2004 gad

Get rid of a cast to '(void) ' on the return of a call to strcpy.


130896 22-Jun-2004 gad

Oops. Undo that last 'const' change. It expects similar changes to some
other files that I am not ready to commit yet...


130895 22-Jun-2004 gad

Add 'const' to a few places.

PR: bin/65803
Submitted by: Cyrille Lefevre


130894 22-Jun-2004 gad

When displaying the "COMMAND" field for system-processes and/or kernel
threads, put the command name in square brackets instead of parenthesis.
This matches NetBSD, and also seems to be what linux does. The sentence
which is added to the man page is taken straight from NetBSD.

PR: bin/65803
Submitted by: Cyrille Lefevre
Obtained from: NetBSD


130856 21-Jun-2004 gad

Have `ps' return the cputimes for zombies, with the assumption that
kvm_getprocs() will provide useful information if it can, or *it*
will provide a zero value if it can not find something appropriate.

Submitted by: bde


130830 20-Jun-2004 gad

Add the `-O emul' format option, which prints the name of the system-call
emulation environment the process is in. "emul" as a keyword is picked
up from OpenBSD.

PR: bin/65803
Submitted by: Cyrille Lefevre


130828 20-Jun-2004 gad

From SUSv3:
Any [standard output] field need not be meaningful in all
implementations. In such a case a hyphen ('-') should be
output in place of the field value

So have the `-O label' option print out the string " -" if the
process has no label.

Approved by: Silence from rwatson and green (when asked in March...)


130827 20-Jun-2004 gad

Add new output-format keywords of LWP and NLWP, which show the thread-id
and number-of-threads tied to a process. Result can be seen by typing,
e.g.: ps -HO lwp,nlwp
These new options are not documented yet. More options will be coming,
and I will update the man page after I get farther along.

PR: bin/65803 (though adjusted to fit our present source)
Submitted by: Cyrille Lefevre


130816 20-Jun-2004 gad

Have the main() routine calculate %CPU and (if needed) memory information
when copying per-process info before starting to sort the list. This way,
sort-by-CPU or sort-by-memory will only calculate values once-per-process,
instead of twice-per-comparison. Also take advantage of this to simplify
the pscomp() routine.


130594 16-Jun-2004 maxim

Typo: s/SunOP/SunOS/g.


130426 13-Jun-2004 obrien

style.Makefile(5)


130237 08-Jun-2004 das

If we are asked to print the total number of blocks, do so even if we
have no entries to print (either due to an empty directory or an
error). This makes the -l and -s options more consistent, like
Solaris and (Debian) Linux. To make this happen, tweak two
optimizations on the second call to display():

- Don't skip display() altogether, even if list == NULL.
- Don't skip the call to the printfn in display() if we
need to print the total.

PR: 45723


130236 08-Jun-2004 das

Remove from the printfns the assumption that dp->list != NULL. Even
if there are no entries, these functions may be called to print the
total number of blocks (0) for consistency's sake.


130190 07-Jun-2004 yar

Remove a duplicated description of the test for the null string.

MFC after: 3 days


130189 07-Jun-2004 yar

Describe how test(1) will evaluate its expressions for a symlink.

Inspired by: SUSv3
MFC after: 1 week


130102 05-Jun-2004 tjr

Plug file descriptor leak in implementation of -n option.


130060 04-Jun-2004 das

Convert fsbtoblk() from a macro to a function. The redundant
instances of 64-bit arithmetic were costing 775 bytes, and the
inlining offered no benefit. Moreover, ambiguity as to the argument
types led to the introduction of a bug (see rev 1.56).

Also, remove some casts that are now clearly redundant.

Inspired by: 67467


130029 03-Jun-2004 le

Plug small memory leak.

PR: bin/67392
Submitted by: Matthew Emmerton <matt@gsicomp.on.ca>
MFC in: 1 week


129971 01-Jun-2004 gad

Try to change the isdigitch() macro to something that Bruce won't roll
his eyes at quite so much... (actually someone else pointed this out
to me a long time ago, but apparently I never fixed it)


129967 01-Jun-2004 gad

A few more style-fixes from Bruce. The only non-cosmetic change
is to drop a call to setuid() which has not been needed for years.

Noticed by: bde


129953 01-Jun-2004 gad

Since I'm not ready to add the non-standard ADD_PS_LISTRESET feature,
remove the #ifdef for it for now. I might add the feature for real at
some later date, there isn't much reason for the #ifdef for now.


129952 01-Jun-2004 gad

Make a few style-istic improvements to the previous commits.

Noticed by: bde


129917 01-Jun-2004 gad

Fix so `ps' catches and complains about null-values specified for a
process id, instead of using pid==0. Ie, `ps -p 12,' and `ps -p ,12'
are now errors (instead of being treated like `ps -p 0 -p 12').

Noticed by: Cyrille Lefevre on freebsd-arch


129915 01-Jun-2004 gad

Additional tiny adjustment to kludge-option processing so `ps t p0'
is treated like `ps -t p0', instead of changing it to `ps -T p0'.
Note that `ps t' is still changed to `ps -T', since that is one of
the main reasons for this kludge processing...

Noticed by: Jilles Tjoelker on freebsd-arch


129914 01-Jun-2004 gad

Rewrite the kludge-option processing to improve how it handles a few
more special situations. This is the code which process `ps blah',
when "blah" does not include a leading '-'.

This change also removes a long-undocumented BACKWARD_COMPATIBILITY
compile-time option, where:
ps -options arg1 arg2
(with no '-' on "arg1" and "arg2") was treated as:
ps -options -N arg1 -M arg2

This also changes `ps' to check for any additional arguments after
processing all the '-'-options, and attempt to use those arguments as
a pid or pidlist. If an extra argument is not a valid pidlist, then
`ps' will print an error and exit. This seems a more generally useful
extension of the kludge-option processing than the -N/-M behavior, and
has fewer confusing side-effects.

Reviewed by: freebsd-arch


129719 25-May-2004 pjd

Use humanize_number(3).

Reminded by: jhb


129714 25-May-2004 gad

Add pgrep(1) and pkill(1) to the cross-reference section of ps(1).


129678 24-May-2004 pjd

Use humanize_number(3) to format sizes into a human readable form.


129647 24-May-2004 stefanf

Include <stdio.h> for a sprintf() prototype.

Approved by: das (mentor)


129635 23-May-2004 gad

Add the 'sid' info to the output of `ps -j', to make up for the 'sess'
(session-pointer) info which was dropped from `ps' earlier in 5.x.

PR: bin/59423
Submitted by: Jilles Tjoelker


129634 23-May-2004 gad

Fix the kludge-old-options processing so `ps tpt' will be treated the
same as `ps -tpt', instead of being changed into `ps -tpT'.

PR: bin/52489
Submitted by: Jilles Tjoelker
MFC after: 1 week


129600 22-May-2004 gad

Change `ps' to use the KERN_PROC_RGID and KERN_PROC_SESSION options
(if trying to match only one real-group or one session-id), now that
those options are implemented in src/sys/kern/kern_proc.c (v1.203).

PR: bin/65803 (a very tiny piece of the PR)
Submitted by: Cyrille Lefevre


129298 16-May-2004 ru

Assorted markup fixes.


129297 16-May-2004 ru

Punctuation.


129296 16-May-2004 ru

Fixed spelling of the document date.


129295 16-May-2004 ru

Bump document date for the latest functional change.
Minor markup tweaks.


129294 16-May-2004 ru

DESCRIPTION was not updated for the new SYNOPSIS.


129285 16-May-2004 ru

Added -v to usage().


129215 14-May-2004 cognet

Use WARNS?=3 for these in the arm case for now, due to toolchain issues.


128868 03-May-2004 tjr

Only add the widths together for printable characters in prn_normal();
unprintable characters have a "width" of -1.


128823 02-May-2004 tjr

Treat filenames as multibyte character strings (according to the current
LC_CTYPE setting) when determining which characters are printable.
This is an often-requested feature.

Use wcwidth() to determine the number of column positions a character
takes up, although there are still a few places left where we assume
1 byte = 1 column position, e.g. line-wrapping when handling the -m option.

The error handling here is somewhat more complicated than usual: we do
our best to show what we can of a filename in the presence of conversion
errors, instead of simply aborting.


128698 28-Apr-2004 das

Various quibbles:
- Print a diagnostic if kdumpenv() fails. This can occur due to MAC
restrictions or lack of memory. Catch all kenv(2) failures as well.
- Just of the heck of it, DTRT if the kernel environment size changes
at the wrong time. The old code could fail silently or fail to
null-terminate a buffer if you got exceptionally unlucky.
- Sort and GC the #includes.


128555 22-Apr-2004 obrien

Fix some style issues in rev 1.58.
Use 64-bit integer math vs. mixed FP & integer.
Add -g to the usage().


128554 22-Apr-2004 obrien

Add 'g' to SYNOPSIS.


128553 22-Apr-2004 obrien

Fix printing of the "Mounted on" values for 'df -i'.
Fix spacing before "Mounted on" column in general.

Submitted by: bde


128410 18-Apr-2004 obrien

Add -c option simular to du(1).

PR: 19635
Submitted by: cyrille.lefevre@laposte.net


128233 14-Apr-2004 green

Document the "return" built-in better: it will exit . (sources) and
the top-level shell instance, too.


128048 09-Apr-2004 njl

Style fixes and add gen to CLEANFILES.

Submitted by: bde


127964 06-Apr-2004 green

Give date(1) a much better SYNOPSIS section which is useful as more than
decoration. Further improvements are welcome, but at least this
is a separate of the various modes of operation date has, as well as
sectioning off the two deprecated options for settimeofday(tz) that
don't even apply to actual operation of date as such, anyway.


127958 06-Apr-2004 markm

Remove clause 3 from the UCB licenses.

OK'ed by: imp, core


127844 04-Apr-2004 gad

Drop the include of <stdint.h>, since r1.84 removed references of intmax_t.


127843 04-Apr-2004 gad

Add back the `-e' option, which was mistakenly dropped when cleaning
up the PS_ARGS string in revision 1.69 (and which was apparently not
missed by anyone...).


127823 04-Apr-2004 gad

Give a name of 'l' (list) to the union in struct listinfo. This is
because some compilers (such as gcc 2.95.4) do not support having an
unnamed union for a field in a struct.


127795 03-Apr-2004 bmilekic

Stop iterating over ACLs if we've already determined we
will print them (i.e., number of successful calls to acl_get_entry()
exceeds 3). This makes O(1) what was O(num_TYPE_ACCESS_ACLs).

This is a slightly modified version of submitter's patch.

PR: bin/65042
Submitted by: Christian S.J. Peron <maneo@bsdpro.com>


127710 01-Apr-2004 gad

Add spaces after flag names on .Fl macros.

Noticed by: ru
MFC after: 4 days


127693 31-Mar-2004 gad

Describe the sorting options in better and more complete detail.
Also improve the description of `-L' a little.

MFC after: 4 days


127602 30-Mar-2004 gad

Switch to using strtoul() for parsing a potential UID or GID, which gets
this to correctly handle UID's and GID's larger than 2147483647.

Noticed by: bde
MFC after: 1 week


127598 30-Mar-2004 gad

Bruce would really like the prototype for fmt() to be split across lines
this way (although I still think it "looks weird"...).

Requested by: bde
MFC after: 1 week


127597 30-Mar-2004 gad

Minor style fixes, mostly adding indent-protection on some comment-blocks.

Noticed by: bde
MFC after: 1 week


127596 30-Mar-2004 gad

Replace pscomp() with a cleaner version, mostly written by bde (*).
This corrects a problem of lost-precision for `-r' (sort-by-CPU). Also,
for sort-by-CPU and sort-by-memory, any processes which have the same
value CPU or MEMORY are now sorted by TTY and then (if needed) by pid.

(* - I just added the NODEV checks, after doing some testing of my own)

Submitted by: bde
MFC after: 1 week


127555 29-Mar-2004 gad

Oops. Remove some ';'s in #defines added by a previous update.

Noticed by: bde


127546 29-Mar-2004 gad

Have this source explicitly include <sys/proc.h>, since it references
values such as P_CONTROLT and PS_INMEM. But this still won't define
PID_MAX for us, since that is hidden inside of '#ifdef _KERNEL'.

Noticed by: bde


127544 29-Mar-2004 gad

Since "kp" is a pointer, I should be comparing against NULL not 0.

Noticed by: bde


127542 29-Mar-2004 gad

Various style improvements, mostly in comments and indentation.

Suggested by: bde (well, for most of them)


127539 29-Mar-2004 gad

In the routines I've been working on, sort the variable declartions
so that non-pointers are listed after pointer-type variables.

Noticed by: bde


127538 29-Mar-2004 gad

Split two 'fmt' strings so they're easier to read on 80-char windows.


127537 29-Mar-2004 gad

Sort the declarations of global variables.


127536 28-Mar-2004 gad

Sort the routine prototypes.


127513 28-Mar-2004 gad

If <x> is a process id that does not exist, then just print the header
(if any) and exit, thus matching the behavior on -stable and other OS's.
My earlier attempt to fix this (v1.65) only seemed to work because of a
lucky random value in nentries (which was not being initialized back
when I tested that earlier patch).


127512 28-Mar-2004 gad

Fix `-o rtprio' so it prints the correct value.

PR: bin/59417
Submitted by: Jan Willem Knopper
This fix by: bde (in the audit-trail of the PR)


127509 27-Mar-2004 gad

If a non-existent user is given as part of `-U userlist', treat it as
a fatal error instead of a minor warning. It is possible that a few
users are used to the previous behavior, but I'm claiming it was a bug.


127508 27-Mar-2004 gad

Explicitly wrap two long-ish linesi of code, to make them easier to read.


127507 27-Mar-2004 gad

Change the #if-ish logic which is used to add the `-f' option when `ps'
is compiled with LAZY_PS, so that there is only one PS_ARGS string to
modify when changing the option-list. Also get `-f' to show up in the
usage() statement when compiled with LAZY_PS.


127506 27-Mar-2004 gad

Move the 'f' case so it shows up in the right place, alphabetically.


127500 27-Mar-2004 gad

Update the date on the man page, since this the previous change added
a few new options.


127499 27-Mar-2004 gad

Support more POSIX/SUSv3 options:

- Change `-p' to allow a list of process IDs, and `-t' to allow a list
of terminal names, instead of only a single value for each.
- Add the `-A' option of SUSv3, which is exactly the same as `-ax'.
- Add the `-G gidlist' (group id).
- Allow any of these "selector options" to be specified multiple times,
and have `ps' keep adding to a given list -- instead of replacing the
previously-specified values.
- Fix interactions between selector-options, so that: "If any are
specified, ... ps shall select the processes represented by the
inclusive OR of all the selection-criteria options." (from SUSv3)
- Add a `-X' option, which is the reverse of the `-x' option.

- various minor improvements in parsing and error handling.

This does not get us to match POSIX/SUSv3, but it gets us closer. The
`-g pgidlist', `-R ruserlist' and `-s sidlist' options mentioned in
freebsd-standards are still under debate, so they skipped for now.
It should be true that this introduces no user-visible incompatible
changes, except to support "new stuff" that was not supported before.


127445 26-Mar-2004 ru

Avoid the manpage layering violation and low-level implementation
details of libkvm, and just tell what the getbootfile(3) function
will return, by using the text from netstat(1) and dmesg(8).


127440 26-Mar-2004 ru

- Remove references to /dev/kmem -- ps(1) utilizes the
sysctl(3) interface in kvm(3).
- Document the correct default when no -N is specified.
- Remove stale reference to /var/db/kvm_kernel.db.
- Remove stale reference to /var/run/dev.db.


127287 22-Mar-2004 obrien

Remove WFORMAT, style.Makefile(5).


127272 21-Mar-2004 pjd

When symbolic link is pointed onto a mount point, it can't be moved
to a different file system.
Patch in PR was incorrect.

PR: bin/64430
Submitted by: Samuel Tardieu
MFC after: 3 days


127270 21-Mar-2004 tjr

Document incorrect handling of multibyte characters.


127269 21-Mar-2004 tjr

Document incorrect handling of multibyte characters in filenames.


127268 21-Mar-2004 tjr

Reduce redundancy in the description of the -u option.


127267 21-Mar-2004 tjr

Document incorrect handling of multibyte characters when -t and -v options
are used.


127257 21-Mar-2004 des

Add a -v (verbose) option.


127167 18-Mar-2004 ru

Install /bin/sh safely. This allows a shell script to be used
to strip binaries by specifying it in the STRIPBIN environment
variable honoured by install(1).

MFC after: 3 days


127155 18-Mar-2004 gad

Fix 'ps -p proclist' and 'ps -u userlist' so the command returns non-zero
if no processes were matched. Also sorts the list of 'int's in main, as
long as I had to add another one...

Noticed by: Nate Lawson
MFC after: 10 days


127149 17-Mar-2004 gad

Improvements to 'ps -p <x>'. If <x> is a process id that does not exist, then
just print the header (if any) and exit, thus matching the behavior on -stable
and other OS's.

Also adds support for <x> being a comma-separated list of processes, and does
a much better checking for invalid-values of <x>, such as 'ps -p someword'.

Reviewed by: mentioned on freebsd-current
MFC after: 10 days


127055 16-Mar-2004 cperciva

Fix memory leak

PR: bin/64321
Submitted by: Rodney Ruddock <rodney@interopsystems.com>
MFOpenBSD: rev 1.17
MFC after: 3 days


127005 15-Mar-2004 jmallett

static and const.


126770 09-Mar-2004 le

And a bandaid so that the output of "available space" is correct when
using -m and -g switches and "available space" is negative (i.e. when
the file system is already using the root-reserved minimum free space).

Obtained from: Stefan Farfeleder <stefan@fafoe.narf.at>
PR: bin/62536
Submitted by: Peter van Dijk <peter@dataloss.nl>
Approved by: grog (mentor), bde


126749 08-Mar-2004 ache

Remove a.out at the end of 'make test'


126690 06-Mar-2004 bde

Fixed some style bugs (mainly unsorting and tab lossage in previous commit).


126687 06-Mar-2004 ache

Add a.out to CLEANFILES


126685 06-Mar-2004 ache

Change locale name from non-existent ASCII to en_US.US-ASCII


126667 05-Mar-2004 phk

Teach dd(1) about parity bits.


126666 05-Mar-2004 phk

Add a test-target and reference vectors for the character converions.


126643 05-Mar-2004 markm

Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)
that this provokes. "Wherever possible" means "In the kernel OR NOT
C++" (implying C).

There are places where (void *) pointers are not valid, such as for
function pointers, but in the special case of (void *)0, agreement
settles on it being OK.

Most of the fixes were NULL where an integer zero was needed; many
of the fixes were NULL where ascii <nul> ('\0') was needed, and a
few were just "other".

Tested on: i386 sparc64


126605 04-Mar-2004 mtm

Rev. 1.32 moved a comment to the wrong line. The hack refered to
in the comment applies to a decision that needs to be made in relation
to the year 2000.

In fact, that statement probably should be changed to be
more generic (getting the year from the current time perhaps). Otherwise,
starting in 2069 two digit year conversions in date(1) will start assuming
1900 instead of 2000. hehe.


126458 01-Mar-2004 cperciva

Fixes to output of `ls -lh` for certain file sizes:
1. Sizes in the range 1000 -- 1023 units require four characters width
for the integer; increase the field width to accomodate this.
2. Sizes in the range 9.95 -- 10 units were being displayed as "10.0"
units; adjust the logic to fix this, and now that we've got an extra
character of field width, print fractional units if the size is less
than 99.95 units.
3. Don't display sub-byte precision.

This should mean that the following sizes are displayed:
0B .. 1023B
1.0U .. 9.9U
10.0U .. 99.9U
100U .. 1023U
for values of U in "KMGTPE".

PR: bin/63547
Pointy hat to: cperciva
Approved by: rwatson (mentor)


126173 23-Feb-2004 johan

style.Makefile:
Use WARNS?= instead of WARNS=


126127 22-Feb-2004 deischen

Allow the -H option to show threads when selecting by uid, tty,
and pid.


125972 18-Feb-2004 ceri

Only call chflags() on directories once.

Approved by: ru
MFC after: 1 week


125728 12-Feb-2004 njl

style(9): wrap at 80 columns.


125727 12-Feb-2004 njl

Handle proper formatting and a buffer overrun when running an old sh on
a system that has sys_nsig > NSIG (i.e. when libc is upgraded.)

Submitted by: Matt Dillon
Reviewed by: bde


125612 08-Feb-2004 jmallett

MFp4 @46705:

Support "uprocp" exactly like "paddr" with the former having been
documented in the manual but not implemented.

PR: 42484


125611 08-Feb-2004 iedowse

Use int rather than size_t storage for printf field widths to avoid
many casts.

Reviewed by: bde


125503 05-Feb-2004 ru

Fixed style of DPADD and LDADD assignments as per style.Makefile(5).


125501 05-Feb-2004 cracauer

Commit fix sent by Tor Egge <Tor.Egge@cvsup.no.freebsd.org>

Only use return value from system call if system call succeeded.

Tested with `make world` and some of my own scripts.

This should be MFCed soon. While /bin/sh is hard to test the fix is
obviously correct and can be assumed not to break something else
(famous last words...).


125156 28-Jan-2004 njl

Use sys_nsig instead of the static NSIG. DragonflyBSD kill.c:1.3

Obtained from: DragonflyBSD


125155 28-Jan-2004 njl

Use sys_nsig instead of NSIG for the length of the signal arrays. This
is important if we add new signals later. From DragonflyBSD:
jobs.c:1.4, trap.c:1.3.

Obtained from: DragonflyBSD


125153 28-Jan-2004 cracauer

The PR diff I committed recently had one bug noticed by
Joe Marcus Clarke <marcus@FreeBSD.ORG>, subshells could lose a
non-zero exit status.

This commit is Joe's proposed patch. Thanks!

I verified that the problem Joe found is fixed and I ran a full world
with this patch.

I don't plan to ever commit language patches to /bin/sh again. It is
a minefield too big to navigate without a full-time committment, which
I am not willing to do on our /bin/sh.

Under normal circumstances I would recommend using NetBSD's sh which
has a lot of language fixes (like the ones what these patches were
about) but unfortunately they had implemented broken signal behaviour
for shellscript containing interactive programs. Similar issues apply
to pdksh which is OpenBSD's sh.

From my perspective bash2 is the only really working bourne sh out
there and that one is GPLed. Oh well.


124825 22-Jan-2004 cperciva

Fix alignment of size field in `ls -lh` -- the width was being computed
from log[10](largest file size), but when outputting in human-friendly
format the width is always at most 4. (eg. "123K", " 12K", "1.2K".)

PR: bin/59320
Approved by: rwatson (mentor)


124792 21-Jan-2004 cperciva

Bring ps.1 up to date with changes in the past seven years:
* Remove mention of '>', 'A', and 'S' states
* Mention 'W' state.
* List 'J' state in the correct location.
* Sync with flags in sys/proc.h

Approved by: rwatson (mentor)
MFC after: 7 days


124780 21-Jan-2004 des

Replace home-grown dup2() implementation with actual dup2() calls. This
should slightly reduce the number of system calls in critical portions of
the shell, and select a more efficient path through the fdalloc code.

Reviewed by: bde


124751 20-Jan-2004 ru

Removed duplicate y.tab.h from SRCS and CLEANFILES.


124587 16-Jan-2004 ru

- Build things in pure dictionary order (see sort(1)).

- Unify the conditional assignments section so that architectural
exclusions come first, then options and !options, sorted by the
option name, also in directory order, then architecture specific
sections, sorted by the architecture name, with i386 being a
traditional exception.

Prodded by: bde


124185 06-Jan-2004 obrien

Note the Linux required format.


124041 01-Jan-2004 kuriyama

o Fix a style bug and poor wording in comment.
o When fts_read() cannot stat the file, it can't be unlinked. At
that case, don't display error message when -f flag is used.

Obtained from: bde
PR: kern/16815, bin/35842
Reported by: kuriyama, Aleksandr A. Babaylov <.@babolo.ru>


123996 30-Dec-2003 maxim

o Spell 'diretories' correctly.

PR: misc/60730
Submitted by: Eugene Grosbein
MFC after: 3 days


123921 28-Dec-2003 cracauer

PR 28852

sh -e behaviour was incorrect when && and || statements where used in
"if" clauses.

This is the patch submitted by MORI Kouji <mori@tri.asanuma.co.jp>.

It fixes the issue at hand, but sh fixes like this are super-hard to
verify that they don't break anything else. I ran some of my old test
cases and a few big GNU configure scripts that detected mistakes
before, with the previous sh, patched sh and bash. No differences in
behaviour found. MFC recommended after longer than usual time.

Compiles on i386 and sledge.


123565 16-Dec-2003 ru

Print unambiguous paths with -R -v.


123258 07-Dec-2003 mux

The uuidgen(1) program is WARNS=6 clean, so flag it as such.

Tested on: i386, sparc64


123089 01-Dec-2003 obrien

Do something sensible if both -h and -k are given.

Approved by: re(scottl)


122900 19-Nov-2003 marcel

Force a staticly linked /bin and /sbin for ia64. The necessary changes
to gcc have not been made for ia64, which means that executables still
have /usr/libexec/ld-elf.so.1 as the dynamic linker. This simply does
not work if /usr is a seperate filesystem not mounted when the kernel
tries to execute init(8).

Note that this is a temporary fix until a new gcc has been imported
that does have the required changes.

Approved: re@


122778 16-Nov-2003 gordon

Change the default for binaries in /bin and /sbin from statically to
dynamically linked. This has been a long time coming with the move of
critical libraries from /usr/lib to /lib. If you don't feel comfortable
with dynamically linked binaries in your root partition, now is the
time to define NO_DYNAMICROOT in your make.conf.

Approved by: re


122601 13-Nov-2003 alc

Don't mmap(2) and munmap(2) zero-length files.

Submitted by: Wiktor Niesiobedzki <bsd@w.evip.pl>


122582 12-Nov-2003 kris

Fix format strings (intmax_t is %jd, not %qd)

Reviewed by: tjr


122537 12-Nov-2003 mckusick

Update the statfs structure with 64-bit fields to allow
accurate reporting of multi-terabyte filesystem sizes.

You should build and boot a new kernel BEFORE doing a `make world'
as the new kernel will know about binaries using the old statfs
structure, but an old kernel will not know about the new system
calls that support the new statfs structure. Running an old kernel
after a `make world' will cause programs such as `df' that do a
statfs system call to fail with a bad system call.

Reviewed by: Bruce Evans <bde@zeta.org.au>
Reviewed by: Tim Robbins <tjr@freebsd.org>
Reviewed by: Julian Elischer <julian@elischer.org>
Reviewed by: the hoards of <arch@freebsd.org>
Sponsored by: DARPA & NAI Labs.


122409 10-Nov-2003 guido

When the P flag is set (i.e. Overwrite regular files before deleting them),
do only unlink the file if we could indeed overwrite the file.
Old behaviour: rm -P /tmp/foo (foo mode 0444) would NOT overwrite foo,
but still delete it (with a warning: rm: foo: Permission denied)
New behaviour: Just the EPERM warning, but no deletion

Reviewed by: bde


122304 08-Nov-2003 bde

1. Fixed leakage of a file descriptor for every non-fatal failure in
rm_overwrite() (for rm -P).

2. Print the file name in the error message for (fatal) malloc() failures
in rm_overwrite(). I first thought that malloc() failures should be
non-fatal since they don't prevent proceeding the the next file, but
making them non-fatal would normally give too much output for rm -Pr
on a large tree in the unlikely event that even one occurs, since the
malloc()ed amounts are usually the same. Just print the file name since
the malloc()ed amounts are not always the same and it doesn't hurt to
know where rm was when it quit.

Submitted by: guido ((1) and original version of (2))


121876 02-Nov-2003 ru

Style.


121794 31-Oct-2003 tobez

Remove the code for parsing octal modes, since setmode(3) already
handles them.

Reviewed by: audit
MFC after: 2 weeks


121124 16-Oct-2003 tjr

Handle realloc() failure correctly.


121095 14-Oct-2003 markm

Turn malloc+snprintf into asnprintf.

Submitted by: David Hill <hill at phobia dot em ess>


121010 11-Oct-2003 dds

- Check and report write(2) errors.

- Issue a single writev(2) call instead of multiple write(2)s.
This change improves the inefficiencies introduced when echo
went on an stdio diet.

The following figures are for echoing 1000 arguments.
original stdio-based echo:
0.01 real 0.01 user 0.00 sys
before:
0.05 real 0.00 user 0.04 sys
after:
0.01 real 0.00 user 0.00 sys


120729 04-Oct-2003 dds

Check for write errors; report and exit with error value.


120037 13-Sep-2003 obrien

Be a little bit more correct WRT counting numbers vs. integer numbers.


120023 13-Sep-2003 schweikh

Do not assume there is only a space between #define and the macro name
when grepping for JOBS. The recent style cleanup replaced the space with
a tab and broke job control detection. Little edits, disastrous consequences.

Submitted by: Peter Edwards <pmedwards@eircom.net>
X-MFC when: in about 5 weeks with the other sh arithmetic fixes.


119914 09-Sep-2003 tjr

Add the -m, -w and -x options to ls's usage message.

PR: 51493
Submitted by: Walter Belgers
MFC after: 1 month


119893 08-Sep-2003 ru

mdoc(7): Use the new feature of the .In macro.


119837 07-Sep-2003 ru

Don't escape names in MLINKS: this won't work with bsd.man.mk,v 1.53.


119835 07-Sep-2003 schweikh

Fix testing of arith_assign() value for $((a=15)).

Submitted by: Enache Adrian <enache@rdslink.ro>


119799 06-Sep-2003 tjr

#include <string.h> for prototypes for strcpy() and strlen().

Submitted by: Stefan Farfeleder


119746 04-Sep-2003 schweikh

Style cleanup, mostly

Requested by: bde


119578 30-Aug-2003 schweikh

Implement missing shell arithmetic operators in $(()) expansion
and variable recognition.

PR: standards/52972
Submitted by: Wartan Hachaturow <wart@tepkom.ru>
Reviewed by: tjr (improved on original patch)
Tested by: buildworld on CURRENT.
MFC after: 6 weeks


119018 17-Aug-2003 gordon

Stage 4 of dynamically linked root support. Add a big knob,
WITH_DYNAMICROOT, which will toggle the generation of dynamically-linked
binaries for installation in /bin and /sbin. It is currently off,
meaning that /bin and /sbin are still statically linked by default.

If something goes wrong (which I hope doesn't), this is what /rescue is
all about. Please do not try to use WITH_DYNAMICROOT and NO_RESCUE to
save space or some other equally silly reason. If you do and end up
having problems, you have been warned.


118857 13-Aug-2003 harti

Implement the nwchan keyword that has been in the man page, but was
not implemented. This is just handy if you want to ddb the address
some process is waiting on.


118665 08-Aug-2003 schweikh

Note in STANDARDS that -gno are not (yet?) POSIX conformant.

Spotted by: harti
MFC after: 3 days


118603 07-Aug-2003 rwatson

Add additional documentation to setfacl(1) regarding the behavior of
tools such as chmod(1) and ls(1) when it comes to acting on objects
that have POSIX.1e extended ACLs. Specifically, discuss the
substitution of the mask entry for the group entry in the mode
representation of the ACL. Differently worded from the submission,
and could probably use further refinement.

PR: 55319
Submitted by: Grzegorz Czaplinski <G.Czaplinski@prioris.mini.pw.edu.pl>


118602 07-Aug-2003 rwatson

-v no longer a valid argument to setfacl(1) -- remove from usage().

PR: 55318
Submitted by: Grzegorz Czaplinski <G.Czaplinski@prioris.mini.pw.edu.pl>


118481 05-Aug-2003 brueffer

Clarify that the 'state' information consists of characters, not
only letters (e.g. IWs+)

PR: 55221
Submitted by: Rich Morin <rdm@cfcl.com>
MFC after: 3 days


118374 03-Aug-2003 ache

Remove collate_range_cmp() stabilization, it conflicts with ranges


117978 24-Jul-2003 markm

Don't check for the existance of src/crypto/ for building items that
may contain crypto. The days of ITAR paranoia are over, and the simple
macro tests that remain are sufficient.


117805 20-Jul-2003 ru

This code isn't WARNS=6 clean in the standard (crypto) case
due to bugs in OpenSSL headers. I was testing in the wrong
environmement: standalone build without crypto/ sources.


117803 20-Jul-2003 ru

Make this code WARNS=6 clean again (after GCC 3.1.1 import).

Submitted by: Marius Strobl <marius@alchemy.franken.de>


117734 18-Jul-2003 rwatson

When reporting an error internalizing an ACL string, print out the
ACL that generated the error, rather than the function, which is
more user-friendly.

Obtained from: TrustedBSD Project
Product of: France


117423 11-Jul-2003 kan

Temporarily turn off -Werror for these components.


117389 10-Jul-2003 brueffer

-l prints all permissions, not just owner and group

PR: 54294
Submitted by: Per Hedeland <per@hedeland.org>
MFC after: 3 days


117299 07-Jul-2003 gshapiro

Remove MAINTAINER= lines from individual Makefiles in favor of the
MAINTAINER file (which already had entries for sendmail).


117261 05-Jul-2003 dds

Changes following CScout analysis:

- Removed dead declarations
- Made objects that should have been declared as static, static.

The changes use STATIC instead of static, following the existing
convention in the rest of the code.

Approved by: schweikh (mentor)
MFC after: 2 weeks


117078 30-Jun-2003 kan

Rename a local variable in order to avoid collision with standard 'log'
function.


117065 30-Jun-2003 jmg

pass -1 to setfile in cp.c

Submitted by: Jun Kuriyama


117036 29-Jun-2003 gordon

Tweak a couple of utilities so they compile cleanly for /rescue. Mostly
path fixes.

Submitted by: Tim Kientzle <kientzle@acm.org>


117023 29-Jun-2003 ru

Unbreak NOCRYPT buildworld.

Reviewed by: markm


116673 22-Jun-2003 jmg

support saving both user/group and permissions on symlinks (from PR)

also fix a slight bogon that assumed an fd of 0 was not valid. Changed
it to be -1.

PR: bin/25017
Submitted by: Martin Kammerhofer


116282 13-Jun-2003 markm

Get this area compiling with the highest WARNS= that it works with.
Obsolete WFORMAT= junk also removed where possible.

OK'ed by: obrien
Tested on: sparc64, alpha, i386


116265 12-Jun-2003 scottl

Add the -H option to ps(1) to display all kernel visible threads in each
process. The default behavior of showing only the process is retained as
the default.


116019 08-Jun-2003 charnier

add section name to .Xr


116015 08-Jun-2003 markm

Fix for the NO_OPENSSL case.

Reported by: Marius Strobl <marius@alchemy.franken.de>


115938 07-Jun-2003 ru

Clarify what -p option does.

Prodded by: marcel

While here, spell the "set-{user,group}-ID bit" correctly.


115898 06-Jun-2003 kuriyama

Use
cat ${.ALLSRC} > ${.TARGET}
rather than
ln -sf ${.ALLSRC} ${.TARGET}
not to depends on absolute-path of symbolic links.

Commented by: marcel, obrien, bde


115777 03-Jun-2003 jhay

Make ed compile in the NOCRYPT case.

Reviewed by: markm


115770 03-Jun-2003 bde

Catch up with revs 1.49-1.50 of df.c: don't mention -t in the BUGS section
since it has been fixed.


115769 03-Jun-2003 bde

Fixed exit code in previous commit. "var++" to set a flag to nonzero
is a style bug at best. When the variable isn't a flag, it potentially
overflows after a large number of settings. Here the number of settings
is limited by ARG_MAX, but the variable is the exit code so it became
bogus after the second setting and effectively overflowed to 0 after
approx. 128 settings.

Fixed some style bugs involving comments in and near previous commit.

Clarification of previous commit message: df -t didn't give undefined
behaviour, and the behaviour used to conform perfectly with the man
page, since the buggy behaviour is documented in the BUGS section. -t
just worked when no files or file systems were specified, and was just
ignored if a file or file system was specified.


115744 02-Jun-2003 jkh

From the df man page:
-t Only print out statistics for filesystems of the specified types.

Make the behavior of df(1) conform to its man page (behavior is otherwise
undefined).

Submitted by: Rob Braun <bbraun@apple.com>
Obtained from: Apple


115717 02-Jun-2003 markm

Modernise. Use libcrypto for DES instead of libcipher.


115424 31-May-2003 fenner

Instead of eating trailing newlines after inserting them into the
output buffer, don't insert them at all. This prevents a buffer
*underrun* when the substitution consists completely of newlines
(e.g. `echo`) and the byte before the source buffer to which p
points is a '\n', in which case more characters would be removed
from the output buffer than were inserted.

This fixes certain port builds on sparc64.

Approved by: re (scottl)
Reviewed by: des, tjr


115226 22-May-2003 ru

Erase whitspace at EOL.

Approved by: re (blanket)


115157 19-May-2003 des

Retire the useless NOSECURE knob.

Approved by: re (scottl)


115082 16-May-2003 ru

mdoc(7) police: A better version of the same.

Approved by: re (blanket)


115081 16-May-2003 ru

mdoc(7) police: Fix document date.

Approved by: re (blanket)


114845 08-May-2003 schweikh

Note that -n and \c are implementation-defined as per TC1 to POSIX 2001.

Approved by: re@ (bmah)
MFC after: 3 days


114791 06-May-2003 trhodes

df(1) and ls(1) print units in 'four or fewer' not 'three or less'.

PR: 35523
Submitted by: Tomas Svensson <tsn@gbdev.net>


114763 05-May-2003 obrien

Centralize _PATH_* definitions.

Submitted by: Tim Kientzle <kientzle@acm.org> (embellished by me)


114600 03-May-2003 markm

Fix long constant usage for i386.

Tested by: Joe Marcus Clarke <marcus@marcuscom.com>


114598 03-May-2003 keramida

Fix a broken reference to locale(5) and point to re_format(7) too for an
explanation of `collating elements'.


114583 03-May-2003 markm

Fix a bazillion warnings. This makes almost the whole of src/bin/*
WARNS=6, std=c99 clean.

Tested on: i386, alpha


114582 03-May-2003 markm

WARNS cleaning for the Alpha. On alpha, size_t is a long, and it
solicits a warning when used for the '*' in printf("%*d"). Cast
to u_int for universal use.


114579 03-May-2003 markm

Fix a shedload of warnings, some memory leaks and clean up WARNS
and lint. This is now WARNS=9, std=c99 clean on i386.


114576 03-May-2003 markm

Fix format warning. This is WARNS=9, std=c99 clean on i386.


114575 03-May-2003 markm

Fix warnings. This is now WARNS=9, std=c99 clean in i386.
Use return(0) for main() instead of exit(0). Makes it a
wee bit smaller.


114510 02-May-2003 obrien

Make this WARNS=1 as that is all we can do with GCC 3.3 -- too many
sized/unsigned comparisons.


114509 02-May-2003 obrien

Make count a size_t as that is what is compared against and how it is used.


114500 02-May-2003 obrien

The is_name and is_in_name macros are FUBAR'ed.
Due to the use of signed vs. unsigned chars on our various platforms, one gets
"warning: comparison is always true due to limited range of data type"
from GCC 3.3.


114483 02-May-2003 obrien

fmt.c has a comparison between signed and unsigned that is unclear how
to properly fix.


114470 02-May-2003 obrien

Quiet warnings about copyright[].


114469 02-May-2003 obrien

Fix signed/unsigned mix comparisons involving sizeof.


114433 01-May-2003 obrien

Quiet warnings about copyright[].


114423 01-May-2003 obrien

Make GCC 3.3 STFU about copyright[].


114369 01-May-2003 tjr

Add the -j and -y options to the synopsis.


114318 30-Apr-2003 schweikh

Fix references to non-existing or obsoleted man pages.

PR: docs/51480 (only a small part)
Submitted by: Diomidis D. Spinellis <dds@aueb.gr>


114301 30-Apr-2003 obrien

We have to hide copyright[] for gcc33. :-(


114047 26-Apr-2003 rwatson

When mac_from_text() fails with -Z, print "-" rather than "" so that
scripts parsing ls(1) output can still count columns.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories


113524 15-Apr-2003 charnier

Revert the zombie part of previous commit


113485 14-Apr-2003 charnier

Correct style bugs. Don't skip zombies in cputime(), according to Bruce,
zombie CPU times are valid. Adjust array size in strftime(3).

Submitted by: Bruce


113431 13-Apr-2003 bde

Include <signal.h> instead of depending on namespace pollution in
<sys/param.h>. Include <sys/types.h> instead of of <sys/param.h>
so that further such dependencies don't develop.


113430 13-Apr-2003 bde

Fixed some style bugs in rev.1.44.


113395 12-Apr-2003 tjr

Display residency and sleep times (re and sl fields) larger than 127 as 127.
This is what the manual page says ps should do, and what OpenBSD and NetBSD do.
Based on a patch from Ken Stailey.

PR: 27433, 46232


113381 12-Apr-2003 tjr

Refer to 1003.1-2001 in the Standards section now that TC1 allows the
traditional BSD behaviour (-n option) and FreeBSD extensions (\c).


113380 12-Apr-2003 tjr

Document the -L and -P options as being mutually exclusive.


113379 12-Apr-2003 tjr

Document the -L and -P options to the cd and pwd commands as being
mutually exclusive. The fact that the most recent one specified on the
command line is the one that takes effect is an implementation detail and
users should not rely on this.


113218 07-Apr-2003 mdodd

Use the correct data type and qualifier for signal flag.


113209 07-Apr-2003 mdodd

Add a SIGINFO handler.


112557 24-Mar-2003 johan

Document how to clear flags with negative-logic, currently only
the nodump flag.

PR: 46912
Reported by: dave@syix.com <dave@syix.com>
MFC after: 2 weeks


112544 24-Mar-2003 charnier

The .Nm utility


112341 17-Mar-2003 tjr

Flush the output buffers before forking a child process to avoid
the child process writing data that the parent should have written.

PR: 50051
MFC after: 2 weeks


112265 15-Mar-2003 ru

ssize_t is not required to be the same width as size_t by the
specs, so cast to intmax_t where appropriate.

Pointed out by: bde


112254 15-Mar-2003 ru

Fixed (soon might be fatal) -Wformat warnings.


112252 15-Mar-2003 marcel

Add an -o filename option to have the output written to a file.
This option is present on most uuidgen(1) implementations even
though normal file redirection can be used to achieve the same.

Submitted by: Hiten Pandya <hiten@unixdaemons.com>


111629 27-Feb-2003 markm

WARNS=4 fixes. This would be WARNS=9 if we were -std=99 instead of
-ansi, due to 'long long'.

Reviewed by: green (slightly earlier version)


111422 24-Feb-2003 marcel

Third attempt at removing machdep.h and using ALIGN from <sys/param.h>.
The initial stack_block is staticly allocated and will be aligned
according to the alignment requirements of pointers, which does not
necessarily match the alignment enforced by ALIGN. To solve this a
more involved change is required: remove the static initial stack
and deal with an initial condition of not having a stack at all. This
change is therefore more risky than the previous ones, but unavoidable
(other than not using the platform default alignment).

Discussed with: tjr
Approved and reviewed by: tjr
Tested on: alpha, i386, ia64 and sparc64


111285 23-Feb-2003 ru

mdoc(7) police: markup laundry.


111278 23-Feb-2003 ru

Grammar.


111132 19-Feb-2003 obrien

We can simplify this Makefile down to a single line now.


111104 18-Feb-2003 obrien

Add an example to help one manually set the date on one machine taking the out
put from another.


111092 18-Feb-2003 obrien

chflags(1) repo copied, usr.bin->bin.
We've been installing chflags(1) into /bin since 2000-11-10, so this
shouldn't cause any problems.


111063 18-Feb-2003 tjr

Revert ALIGN change for the second and last time. I can't figure out
why this is breaking sparc64.


111025 17-Feb-2003 tjr

Second attempt at removing machdep.h and using ALIGN from <sys/param.h>.
The problem with the previous attempt, as noticed by Marcel, was that
stacknxt was being aligned to a pointer boundary instead of an
ALIGNBYTES + 1 boundary, which broke sparc64.


110981 16-Feb-2003 tjr

Temporarily back out machdep.h/ALIGN changes. It seems that on sparc64,
using the alignment from sys/param.h (16) instead of the alignment
from machdep.h (8) tickled a nasty bug in the memory allocator that I
haven't been able to track down yet.


110888 14-Feb-2003 tjr

Use the ALIGN macro from <sys/param.h> instead of defining our own
incorrect version in machdep.h. Delete machdep.h.


110411 05-Feb-2003 sobomax

Fix slight disorder that broke sorting. Put in bold warning about the
fact that in this case order matters.

Submitted by: Peter Edwards <pmedwards@eircom.net>


110392 05-Feb-2003 charnier

Add FBSDID.


110391 05-Feb-2003 charnier

Display elapsed time (-o etime) using [[dd-]hh:]mm:ss, which according to
Solaris man page is the POSIX way.

Reviewed by: jmallett


110390 05-Feb-2003 charnier

Enclose sccsid according to style(9).
udp/timed -> timed/udp


110348 04-Feb-2003 trhodes

Remove another unused doc Makefile.


110347 04-Feb-2003 trhodes

Cross ref chflags(1).

Suggested by: Craig Carey <research@ijs.co.nz) on -doc.


110302 03-Feb-2003 fanf

Improve the layout of the description of the various parameter expansion
modifiers. The paragraph that explains the difference between ${foo:-bar}
and ${foo-bar} etc. was not very visible.


110057 29-Jan-2003 mux

Remove now unnecessary main() prototype.


109927 27-Jan-2003 tjr

Ensure that the TTY file descriptor is greater than or equal to 10 so that
it doesn't interfere with the user's redirections.

PR: 47136
MFC after: 1 week


109873 26-Jan-2003 phk

Don't call DIOCWLABEL on disks, it is not implemented, and calling it
like this negated any practical value of the feature.


109627 21-Jan-2003 tjr

Make this compile with DEBUG defined now that WARNS=0 has been removed
from the Makefile:
- Print pointers with %p instead of %x.
- Include missing headers to get prototypes.

Noticed by: benno


109601 20-Jan-2003 chris

Reference maclabel(7).

Sponsored by: DARPA, Network Associates Laboratories


109574 20-Jan-2003 obrien

kenv(1) has been repo copied from usr.bin to bin.
Sometimes we need kenv(1) in /etc/rc.diskless*.


109504 19-Jan-2003 jmallett

Per-variable\ entry headers, to allow the 'ps -otime -otime=FOO' or similar
case to do the right thing and affect exactly one column. This is consistent
with GNU ps(1) in BSD mode, and POLA.


109502 19-Jan-2003 jmallett

When inserting a non-user-specified (e.g. not via -o or -O) format, don't dupe
one that is already there. This is consistent with GNU ps(1)'s BSD mode, and
POLA.

Reported by: Andy Farkas <andyf@speednet.com.au>
Tested by: Andy Farkas <andyf@speednet.com.au>


109460 18-Jan-2003 jmallett

Refer to the process label as proclabel, as there is a function called label,
and that's what these locals were called before.


109331 15-Jan-2003 johan

realpath(3) should use PATH_MAX instead of MAXPATHLEN according to POSIX.

This also reverts the PATH_MAX -> MAXPATHLEN part of
rev 1.3 of src/bin/realpath/realpath.c

Requested by: imp
Reviewed by: imp, bde


109075 10-Jan-2003 obrien

Make the "tarcp" example more direct.


108935 08-Jan-2003 tjr

Do not strip CTL* escapes from redirection filenames in exptilde(),
expari(), expbackq() and evalvar(). Similar to revision 1.39.
Patch from Tor Egge.

PR: 45349
MFC after: 2 weeks


108533 01-Jan-2003 schweikh

Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.


108470 30-Dec-2002 schweikh

Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.


108452 30-Dec-2002 mike

Back out rev 1.44; getbsize(3)'s original interface has been restored.

Approved by: markm


108450 30-Dec-2002 rwatson

Add "-h" arguments to getfacl and setfacl, which behave in a manner
similar to "-h" on chown, chmod, etc, causing the operation to occur
on a final symlink in the provided path, rather than its target.

Obtained from: TrustedBSD Project


108286 26-Dec-2002 tjr

Add the "wordexp" shell built-in command which will be used to implement
the POSIX wordexp() function.


108257 24-Dec-2002 ru

mdoc(7) police: Deal with self-xrefs.


108221 23-Dec-2002 ru

Fixed the abuses of .Ql visible on stderr in troff mode.

PR: docs/37176


108216 23-Dec-2002 ru

mdoc(7) police: markup nit.


108189 22-Dec-2002 dwmalone

Use '\033' rather than '\e' as the latter is a gccism.

PR: 46015
Submitted by: Jeroen Ruigrok van der Werven <asmodai@wxs.nl>
MFC after: 1 week


108066 19-Dec-2002 tjr

pathconf() and acl_get_file() follow links so they cannot be used to
determine whether a symlink has an ACL. Instead, assume that symbolic
links don't have ACLs and don't bother checking. Avoids spurious
ENOENT warnings when listing directories containing broken symlinks
on filesystems with ACLs enabled.

Pointed out by: rwatson, bde


108057 18-Dec-2002 rwatson

Improve handling of symlink targets when listing MAC labels: don't
do the wrong thing when the symlink doesn't have a target, by
considering !f_label in the construction of ch_options.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories


108034 18-Dec-2002 johan

Remove undocumented behavior (return current work dir if no path
is given as argument) that is not present in 4-Stable.
It was introduced when realpath(1) was split out of pwd(1).
The removed behavior is provided by pwd(1).

Reviewed by: mike


108032 18-Dec-2002 johan

- use MAXPATHLEN per realpath(3)
- use the problematic part of the path, instead of the argument,
when reporting an error.

Reviewed by: mike


107993 17-Dec-2002 trhodes

The code uses trapsasync, however the manual page uses asynctraps. Fix the
manual page to reflect the code.

PR: 45820
Submitted by: Marco Molteni <molter@tin.it>
Discussed with: tjr


107974 17-Dec-2002 fanf

Document `trap EXIT` and `trap SIGNAME`.


107846 14-Dec-2002 tjr

When job control is disabled, never show the job id when reporting the
status of a background process that has terminated because of a signal.


107631 05-Dec-2002 ru

Capitalize ASCII code names.

Approved by: re


107282 26-Nov-2002 ru

mdoc(7) police:

Revert to using the .Tn POSIX and .Tn ANSI instead of \*[Px] and \*[Ai]
strings; using these strings is unsafe in troff mode, as they include a
change in a font size.

Approved by: re


107230 25-Nov-2002 ru

mdoc(7) police: In DESCRIPTION, list the options in pure alphabetical
order, as required by style(9). Document the effect of the -f option
on exit status. Fixed some spacing.

Submitted by: bde
Approved by: re


107229 25-Nov-2002 ru

mdoc(7) police: markup fixes.

Approved by: re


107226 25-Nov-2002 ru

mdoc(7) police: markup fixes.

Approved by: re


106883 14-Nov-2002 njl

Minimal take on previous commit -- remove getopt and printf. Static size
is reduced by 40k, dynamic by a few bytes.
Functional changes:
* "sleep -- arg" now returns usage() instead of ignoring the --
* "sleep -1" now returns immediately instead of returning usage()

Reviewed by: jmallett


106882 14-Nov-2002 njl

Back out previous commit since there is controversy about changing so much
in sleep including duping strtol(3). Code changes also increased
dynamic size of sleep(1).


106874 13-Nov-2002 njl

Remove getopt and strtol dependencies, reducing size of static exe.
Preserve older desired behavior, accept [+-]*[0-9]*\.[0-9]*
Remove a few unnecessary casts.

%ls -l /bin/sleep
-r-xr-xr-x 1 root wheel 61332 Oct 28 05:16 /bin/sleep
%ls -l /usr/obj/usr/src/bin/sleep/sleep
-rwxr-xr-x 1 root wheel 19124 Nov 13 12:12 /usr/obj/usr/src/bin/sleep/sleep

Submitted by: Tim Kientzle <kientzle@acm.org>


106835 13-Nov-2002 njl

Put echo on a diet, removing unnecessary use of stdio and getopt.

Before...
-r-xr-xr-x 1 root wheel 58636 Oct 28 05:16 /bin/echo
After...
-rwxr-xr-x 1 root wheel 12824 Nov 12 17:39 /usr/obj/usr/src/bin/echo/echo

Submitted by: Tim Kientzle <kientzle@acm.org>


106479 06-Nov-2002 tjr

Use warn() instead of perror() or fprintf() where appropriate.


106399 04-Nov-2002 tjr

Cross-reference setfacl(1).


106388 03-Nov-2002 tjr

- Consistent use of warn() vs. perror().
- Gracefully handle the case where standard input is missing
a newline at EOF.
- Exit with status 1 instead of -1 (really 255) on error.
- Add a Diagnostics section to the manual page documenting
exit status.

Approved by: rwatson


106371 03-Nov-2002 tjr

Print a `+' character after the standard UNIX permission fields in long
listings if the file has an extended ACL (more than the required 3 entries).
This is what Solaris and IRIX do, and what the withdrawn POSIX.2c standard
required.

Reviewed by: rwatson (an earlier version of the patch)


106318 01-Nov-2002 tmm

The hw.availpages sysctl has an unsigned long value now, fix the retrieval
to match that.


106283 01-Nov-2002 marcel

o Remove $Id$ from copyright; there's $FreeBSD$,
o Remove static function uuid_print(); use uuid_to_string(3) in
combination with printf(3) to achieve the same,
o Remove unneeded includes,
o Add a reference to uuid(3) to the manpage.


106251 31-Oct-2002 tjr

Do not print a header line if it would be empty; required by 1003.1-2001.


106192 30-Oct-2002 tjr

Delete worthless comments.


106065 28-Oct-2002 wollman

Create a small library function, check_utility_compat(3), to determine
whether a named utility should behave in FreeBSD 4.x-compatible mode
or in a standard mode (default standard). The configuration is done
malloc(3)-style, with either an environment variable or a symlink.

Update expr(1) to use this new interface.


106053 27-Oct-2002 wollman

Do not include <sys/syslimits.h> directly; it is not intended for general
consumption.


105836 24-Oct-2002 rwatson

Attempt improved use of fts results: use the correct path to the
object to retrieve label information on, rather than directly
consuming the fts-provided paths (none of which are quite right).
This is based on the similar readlink() code, and may contain
the same bugs.

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories


105832 24-Oct-2002 rwatson

Teach "ls -Z" to use the policy-agnostic MAC label interfaces rather
than the LOMAC-specific interfaces for listing MAC labels. This permits
ls to view MAC labels in a manner similar to getfmac, when ls is used
with the -l argument. Next generation LOMAC will use the MAC Framework
so should "just" work with this and other policies. Not the prettiest
code in the world, but then, neither is ls(1).

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories


105831 24-Oct-2002 rwatson

Use the MAC interface to list process MAC labels rather than using
the LOMAC-specific interface (which is being deprecated). The
revised LOMAC using the MAC framework will export levels listable
using this mechanism.

Approved by: re
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories


105824 23-Oct-2002 markm

Fix for changed getbsize arg type.


105781 23-Oct-2002 markm

Be consistent about declaring a function "static", and consistent
about the type of argv.


105780 23-Oct-2002 markm

Constify, staticify, rationalise types and fix other related warnings.


105778 23-Oct-2002 markm

Constify to squash some warnings.


105396 18-Oct-2002 markm

Staticify for lint.


105395 18-Oct-2002 markm

Constify and staticify for lint.


105390 18-Oct-2002 tjr

Print non-printing characters in directory names, as well as file names,
as `?' or `\ooo', depending on whether the -b or -B flags were used.

PR: 43995
MFC after: 1 month


105389 18-Oct-2002 tjr

Avoid accidentally making "-h" a synonym for "fc".

Obtained from: NetBSD


105375 18-Oct-2002 dd

Output "human-readable" values with a non-0 precision where
appropriate. Before this, a 2.9 GB file was misleadingly reported as
"2G". This mostly brings unit_adjust() in line with what is in du(1).

Reviewed by: jmallett
Approved by: nik


105269 16-Oct-2002 markm

Dekerberise. The corresponding userland stuff has been dekerberised
for ages, and no-one seems to have noticed. Viva PAM!


104672 08-Oct-2002 tjr

Do not strip CTL* escapes from redirection filenames in argstr(); they
are later stripped with rmescapes() in expandarg(). If the filename has
already been unescaped, doing it again in rmescapes() can walk off the
end of the string, leading to memory corruption and eventually SIGSEGV.

Noticed by: kris


104563 06-Oct-2002 tjr

Clean up use of <stdarg.h> macros: always call va_end after va_start,
reset with a call to va_start before each use of the va_list.

Obtained from: NetBSD


104560 06-Oct-2002 tjr

Ensure all va_starts have a matching va_end.

Obtained from: NetBSD


104559 06-Oct-2002 charnier

While removing a memory leak, rev 1.32 introduced a
free-memory-and-reuse-it-after. Correct both problems and
make rcp -r work again under /etc/malloc.conf -> AJ.


104556 06-Oct-2002 tjr

/dev/sa0 is the default tape device, not /dev/rst0.


104554 06-Oct-2002 tjr

Disallow empty condition parts of "if", "while" and "until" compound
commands. Commands like "if then ... fi" and "while do ... done" are no
longer accepted. Bodies of compound commands are still allowed to be
empty, because even though POSIX does not allow them, most shells do.


104549 06-Oct-2002 tjr

Use %jd in format string and cast argument to intmax_t instead of using
%qd to print struct stat.st_size. Remove WARNS=0 and WFORMAT=0 from
Makefile.

Tested on: alpha, sparc64, i386


104548 06-Oct-2002 tjr

Fix format string errors relating mainly to the use of %qu to print off_t's.
Instead use %ju and cast the argument.

WFORMAT=0 is still required in the Makefile because gcc warns about
some strftime() calls (I don't think this behaviour is useful.)

Tested on: sparc64, alpha, i386


104414 03-Oct-2002 bde

Oops, the previous version was a last minute test version with off_t
replaced by int instead of size_t.

Spotted by: fanf


104411 03-Oct-2002 bde

Use a non-bogus type for representing the values of offsets in structs.
off_t is for offsets in files, and it is signed so it was no better
than the original type of int for avoiding warnings from broken lints,
except accidentally on machines like i386's where size_t is smaller
than off_t.


104410 03-Oct-2002 fanf

Fix some twelve hour clock braindamage. The range for hours is 0-23 not 1-12.

MFC After: 1 week


104388 02-Oct-2002 jhb

Catch up to SMTX -> SLOCK changes.


104367 02-Oct-2002 tjr

Use %d in a printf() format string and cast the argument to int instead of
using %td when we know that the number is between 0 and 9; mksyntax is a
build tool and needs to work on -stable.


104318 01-Oct-2002 trhodes

Return the ``u''


104289 01-Oct-2002 tjr

Back out experimental changes to fmtstr() that I didn't mean to include
in the previous commit.


104286 01-Oct-2002 tjr

Replace a home-grown printf() clone with a fwopen() wrapper around
libc's vfprintf() that writes to a `struct output' instead of a file.
Inspired by NetBSD's similar changes (they used asprintf() instead).


104284 01-Oct-2002 mux

It is now safe to remove WARNS=0 and WFORMAT=0.

Tested on: alpha, i386, sparc64


104283 01-Oct-2002 tjr

Restore "not found" error message when searching for (or executing)
a program fails because the file or a path component does not exist.

Suggested by: bde


104282 01-Oct-2002 mux

- Don't use quad_t when we really mean rlim_t.
- Cast rlim_t to intmax_t when printing it.

This should fix the last format errors in sh(1).

Tested on: i386, sparc64


104276 01-Oct-2002 tjr

Add back WARNS=0 and WFORMAT=0; gcc is finding nonexistent format string
errors with %qd formats.


104275 01-Oct-2002 mux

Use the %t format modifier to print differences between
pointers. This fixes two format warnings on 64 bits
archs which are fatal now that WFORMAT=0 has been removed.

It doesn't fully fix the sh(1) build on 64 bits platforms
though, there is still some quad_t issues that need to be
fixed.

Tested on: i386, sparc64


104273 01-Oct-2002 tjr

Remove WARNS=0 and WFORMAT=0. The shell compiles cleanly at WARNS=2
on at least i386. If there are warnings on other archs, I'd rather hear
about them than pretend they didn't exist.


104261 01-Oct-2002 tjr

Remove some kind of profiling support that required the 4.2BSD monitor()
function in libc.


104255 01-Oct-2002 tjr

Remove bits and pieces of support for atty, which was made obsolete by
adding history and vi/emacs-style line editing to the shell itself.
Atty was a user-mode terminal emulator (like screen and window) that did
line editing and history.


104208 30-Sep-2002 tjr

Callers of error() don't need to supply a program name prefix in the
error message. Stops ulimit giving error messages like "ulimit: ulimit: xyz".


104207 30-Sep-2002 tjr

Allow a left parenthesis before patterns in case blocks. POSIX requires
us to accept this, but I've never seen a script that uses it.


104202 30-Sep-2002 tjr

Allow empty case/esac statements; POSIX requires this, and recent versions
of autoconf are generating scripts that use this feature.

PR: 43275 35879
Submitted by: Dan Nelson <dnelson@allantgroup.com>


104141 29-Sep-2002 tjr

Remove dead code which supported systems without O_APPEND, O_CREAT or SIGTSTP.


104132 29-Sep-2002 tjr

Convert the remaining callers of errmsg() to use strerror(), and remove
errmsg() and its table of error messages.


104130 29-Sep-2002 jmallett

Mark the signo as __unused in a lazy signal handler.


104119 28-Sep-2002 trhodes

s/behaviour/behavior/ in the chmod(1) manual


104026 27-Sep-2002 jmallett

List valid keywords, ala kill(1), rather than the csh builtin kill, which
tells people to type kill -l, when no valid ones are specified.

Sponsored by: Bright Path Solutions
MFC after: 4 days


104025 27-Sep-2002 jmallett

Ala kill(1), tell people to type 'ps -L' for a list of format keywords.

Sponsored by: Rachel Hestilow <rachel@jerkcity.com>
MFC after: 2 weeks


103801 22-Sep-2002 mckay

cp -p could report success even if a file copy failed. This was due to
the cumulative exit status being overwritten when directory permissions
were being set. This was particularly bad when called from mv(1) to
perform a cross-device move as the original files were deleted even if
the copy failed.

Reported by: Slaven Rezic <slaven.rezic@berlin.de>
Patch by: bde
PR: 42789


103726 21-Sep-2002 wollman

Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
hack, thereby allowing future extensions to the structure (e.g., for extended
attributes) without rebreaking the ABI. FTSENT now contains a pointer to the
parent stream, which fts_compar() can then take advantage of, avoiding the
undefined behavior previously warned about. As a consequence of this change,
the prototype of the comparison function passed to fts_open() has changed
to reflect the required amount of constness for its use. All callers in the
tree are updated to use the correct prototype.

Comparison functions can now make use of the new parent pointer to access
the new stream-specific private data pointer, which is intended to assist
creation of reentrant library routines which use fts(3) internally.

Not objected to in spirit by: -arch


103497 17-Sep-2002 jmallett

Rename new PLONG type to PGTOK as the conversion is more important than the
size (which is mostly undefined anyway).

Submitted by: bde


103438 17-Sep-2002 jmallett

Conglomerate printing of ps_pgtok'd data into a PLONG type. I couldn't think
of a better name, except PINT, but I decided to go with assuming LONG to
be safe, rather than assuming INT.


103422 16-Sep-2002 jmallett

Perform keyword.c:1.27 properly, implement -orss in the New World Order of
ps(1) formatting, using pgtok() to get the value in K, rather than printing
it in pages. This is consistent with behaviour before keyword.c:1.26 (et al)
which exists in STABLE today, and which uses the same metric as VSZ.

Submitted by: bde


103421 16-Sep-2002 jmallett

Remove some NOTINUSE stuff. Good housekeeping.


103274 13-Sep-2002 peter

Do not risk using the kernel pgtok() which assumes the page size is
constant.


103223 11-Sep-2002 nectar

Correct a usage of fnctl that could not be right and results in a
no-op. I assume it was meant that the close-on-exec flag be set here.


102944 04-Sep-2002 dwmalone

ANSIify function definitions.
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.

Reviewed by: md5


102886 03-Sep-2002 jmallett

Prevent ps(1) from doing idiotic munging of things in a -ofmt= string.

God I hate the backwards compatability crap here.


102577 29-Aug-2002 keramida

Fix a warning of "possibly used before initialisation".

Reviewed by: tjr


102576 29-Aug-2002 keramida

Add <stdlib.h> to get a prototype for exit().

Reviewed by: tjr


102434 26-Aug-2002 keramida

Grammar fix.

PR: docs/42021
Submitted by: Jeff Ito <jeffi@rcn.com>
MFC after: 3 days


102432 26-Aug-2002 trhodes

Fix 'SYNOPSIS' and 'usage'


102410 25-Aug-2002 charnier

Replace various spellings with FALLTHROUGH which is lint()able


102363 24-Aug-2002 tjr

There is a built-in command called "builtin"; spell its name correctly
after rev. 1.77 called it "built-in".


102351 24-Aug-2002 tjr

Don't show the process ID of background jobs that have terminated,
for consistency with ksh.


102245 22-Aug-2002 bde

Removed extra $FreeBSD$. Moved #if 0 for the vendor id to the correct
place. Restored indent protection of copyright comment.


102230 21-Aug-2002 trhodes

s/filesystem/file system/ as discussed on -developers


102223 21-Aug-2002 schweikh

Fix a few typos, among them s/builtin/built-in/ (except for the ref
to the builtin(1) man page.) This is for consistency with the spelling
both proposed by ispell as well as IEEE Std 1003.1-2001.

MFC after: 3 days


102091 19-Aug-2002 ru

mdoc(7) police: fixed the document date.

Submitted by: iedowse


102084 19-Aug-2002 jmallett

Remove local prototypes for main().


102051 18-Aug-2002 tjr

Avoid accessing the current job's process table in the child part of
forkshell() after it has been freed. This caused mysterious behaviour
when anything but the first command in a pipeline tried to access the
terminal when the `junk' malloc() option was enabled (which is the default).


102007 17-Aug-2002 tjr

Show job control ID, command text, etc. when foreground processes are
suspended. This is a followup to rev. 1.51.

MFC after: 1 week


101961 16-Aug-2002 johan

Bump document date for the -n option.

Approved by: sheldonh (mentor)


101923 15-Aug-2002 maxim

o Backout rev. 1.40 and rev. 1.49.
o Add argv[] boudary check.

PR: bin/40117
Reviewed by: silence on -audit
MFC after: 2 months


101731 12-Aug-2002 tjr

Claim conformance to 1003.2-1992 instead of 1003.1-2001 due to doubts
raised by Lukas Ertl over symbolic link handling.

PR: 41576
MFC after: 1 week


101677 11-Aug-2002 schweikh

Fix typos; each file has at least one s/seperat/separat/
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.

Suggested by: bde
MFC after: 3 days


101662 11-Aug-2002 tjr

Allow redirections by themselves between "&&" and "||" operators.
For example, >/dev/null && echo foo

Pointed out by: FUJISHIMA Satsuki
MFC after: 1 week


101651 10-Aug-2002 mux

- Introduce a new struct xvfsconf, the userland version of struct vfsconf.
- Make getvfsbyname() take a struct xvfsconf *.
- Convert several consumers of getvfsbyname() to use struct xvfsconf.
- Correct the getvfsbyname.3 manpage.
- Create a new vfs.conflist sysctl to dump all the struct xvfsconf in the
kernel, and rewrite getvfsbyname() to use this instead of the weird
existing API.
- Convert some {set,get,end}vfsent() consumers to use the new vfs.conflist
sysctl.
- Convert a vfsload() call in nfsiod.c to kldload() and remove the useless
vfsisloadable() and endvfsent() calls.
- Add a warning printf() in vfs_sysctl() to tell people they are using
an old userland.

After these changes, it's possible to modify struct vfsconf without
breaking the binary compatibility. Please note that these changes don't
break this compatibility either.

When bp will have updated mount_smbfs(8) with the patch I sent him, there
will be no more consumers of the {set,get,end}vfsent(), vfsisloadable()
and vfsload() API, and I will promptly delete it.


101591 09-Aug-2002 ume

IPv6 support for rcp.
You cannot specify a raw IPv6 address for now.

MFC after: 1 week


101573 09-Aug-2002 ru

mdoc(7) police: tidying.


101572 09-Aug-2002 ru

mdoc(7) police: whitespace nits.


101571 09-Aug-2002 ru

mdoc(7) police: tidy up, bump document date on behalf of the -n option.


101570 09-Aug-2002 ru

mdoc(7) police: grammar.


101569 09-Aug-2002 ru

mdoc(7) police: kill hard sentence breaks and one double space.


101297 04-Aug-2002 obrien

Allow "-v -v" to mean very verbose.

Reviewed by: freebsd-standards
PR: 40709
Submitted by: Edward Brocklesby <nighthawk@unrealircd.com>, johan


101217 02-Aug-2002 markm

Remove the last reference to NOUUCP - we don't have UUCP in the base
system.


101094 31-Jul-2002 markm

Fix an easy WARNS.


101093 31-Jul-2002 markm

Fix some easy WARNS.


101092 31-Jul-2002 markm

Give lint a small bit of help.


100774 27-Jul-2002 dwmalone

Make test check the tv_nsec part of a struct stat when comparing
the mtimes of a file. (This is probably only useful if you have
vfs.timestamp_precision set to something nonzero).

PR: 39163
Submitted by: Hal Burch <hburch@lumeta.com>
MFC after: 2 weeks


100664 25-Jul-2002 tjr

Add a -P/-o physical option which behaves similarly to bash/ksh's options
by the same name. This option makes the cd and pwd builtins behave physically
(as opposed to logically) by default.

Submitted by: fanf


100663 25-Jul-2002 tjr

Set opterr to zero to avoid duplicate warnings from getopt(3) for unknown
options.


100661 25-Jul-2002 tjr

Use PATH_MAX instead of a local guess at it, which happened to be incorrect.

Suggested by: fanf


100660 25-Jul-2002 tjr

pwdcmd()'s argc and argv arguments are no longer unused, remove __unused.

Pointed out by: fanf


100640 24-Jul-2002 mp

Remove WARNS and WFORMAT overrides.


100588 24-Jul-2002 tjr

Avoid calling el_resize() from a signal handler, even though libedit
itself does that if you set EL_SIGNAL. Instead, set a flag and check it
before calling el_gets(). This is safer, but slower to respond to changes.

Pointed out by: mp


100578 23-Jul-2002 tjr

Catch SIGWINCH in interactive shells and call el_resize() to update
libedit's idea of the window size.


100568 23-Jul-2002 tjr

Call el_source() to read the contents of .editrc when line editing is enabled.

Obtained from: NetBSD
MFC after: 2 weeks


100565 23-Jul-2002 tjr

Add a `bind' builtin command, which is simply a wrapper around libedit's
builtin command of the same name. This allows the key bindings for the
shell's line editor to be changed.

MFC after: 2 weeks


100538 23-Jul-2002 johan

Add the -n option, which automatically answers "no" to the overwrite question.

PR: 7828
Suggested by: Daniel O'Connor <doconnor@gsoft.com.au>
Approved by: sheldonh (mentor)
MFC after: 2 weeks


100483 22-Jul-2002 tjr

Don't allow "||" or "&&" to be the first tokens of a command.

PR: 40386
MFC after: 2 weeks


100437 21-Jul-2002 tjr

Implement the P1003.2 `command' builtin command, which is used to suppress
shell function and alias lookup. The -p option has been implemented, the
UPE -v and -V options have not. The old `command' command has been renamed
to `builtin'.


100395 20-Jul-2002 tjr

Document that only one of the -n and -e options may be specified for
sh(1)'s echo(1) builtin command.

PR: 32935, 40747
MFC after: 1 week


100351 19-Jul-2002 tjr

Remove broken and incomplete support for old releases of System V,
don't support system that implement getcwd(3) with a pipe to /bin/pwd.


100315 18-Jul-2002 tjr

Don't assume file descriptors fit in a short, use an int instead.


100308 18-Jul-2002 tjr

Avoid using ints or shorts to store process id's, use pid_t instead.
The pgrp member of struct job was declared as a short and could not store
every possible process group ID value, the rest of them were benign because
pid_t happens to be an int.


100305 18-Jul-2002 tjr

Make the message that is printed when the foreground process is terminated
by a signal the same as pdksh/bash/sh before rev. 1.34.


100069 15-Jul-2002 sheldonh

Revert previous delta, which is not required with rev 1.5 of
src/contrib/gcc/c-format.c .


100012 15-Jul-2002 keramida

Fix a couple of typos in a comment.

PR: docs/33559
Submitted by: Marc Olzheim <marcolz@ilse.nl>


99858 12-Jul-2002 tjr

Complain if more than one file argument is given to unlink(1) like we did
before I made unlink use getopt().


99847 12-Jul-2002 keramida

Don't duplicate the description of the sticky bit that is already
part of chmod(2) and sticky(8), but refer to those manpages instead.

PR: docs/35605
Submitted by: Gary W. Swearingen <swear@blarg.net>


99785 11-Jul-2002 bde

Fixed a printf format error that was fatal on alphas. Adding WFORMAT=0
to the Makefile didn't affect this bug because WFORMAT only controls
higher- level format checking (not the -Wformat that is implicit in
-Wall).

Fixed a nearby printf format error that was benign and 3 nearby style bugs.


99767 11-Jul-2002 sheldonh

Set WFORMAT=0, because our compiler currently complains about NULL
arg 2 to err() and friends, and warnings are promoted to errors.

This allows the following revisions to be reverted:

rev 1.39 src/bin/cp/cp.c
rev 1.26 src/bin/chmod/chmod.c
rev 1.40 src/bin/rm/rm.c

The following revisions can already be reverted, because they were
already covered by WFORMAT=0:

rev 1.8 src/bin/ls/lomac.c
rev 1.63 src/bin/ls/ls.c
rev 1.8 src/bin/ps/lomac.c
rev 1.34 src/bin/rcp/rcp.c


99762 11-Jul-2002 tjr

Don't assume the shell's controlling terminal is attached to file descriptor
2. Instead, open /dev/tty. This problem stopped commands in subshells from
being executed correctly if standard error was redirected.

PR: 36671
Obtained from: NetBSD (but simplified)


99761 11-Jul-2002 tjr

Remove support for the "old" tty driver by unifdef -UOLD_TTY_DRIVER;
many other parts of the shell are no longer compatible with this, and it
makes jobs.c quite cluttered with #ifdef's.


99760 11-Jul-2002 tjr

When growing the job table, don't relocate the jobmru pointer if it's NULL.


99744 10-Jul-2002 dillon

err() is documented as allowing NULL for the format string but GCC isn't
happy about it any more so change the usage to make buildworld work again.


99743 10-Jul-2002 dillon

err() is documented as allowing NULL for the format string but GCC isn't
happy about it any more so change the useage so buildworld works again.


99678 09-Jul-2002 johan

Update usage for the addition of -n in rev 1.35 of mv.c.

Approved by: obrien, sheldonh (mentor).


99645 09-Jul-2002 tjr

Close file descriptors when [n]>&- and [n]<&- redirections are used.
This was broken by rev. 1.16.

PR: 40334
MFC after: 1 week


99634 09-Jul-2002 tjr

Print out commands with NTOFD/NFROMFD redirections that close the
descriptors (">&-" or similar) correctly in the jobs(1) command.


99592 08-Jul-2002 jmallett

Bring back WFORMAT=0.


99580 08-Jul-2002 robert

- Use (MAXLOGNAME - 1) where UT_NAMESIZE was used to be able to
(-)remove the inclusions of <utmp.h>.


99547 07-Jul-2002 jmallett

Make printval() take a 'void *' thus negating any assumptions the compiler
may try to make about the alignment of the dereferenced datum.


99499 06-Jul-2002 charnier

The .Nm utility


99457 05-Jul-2002 mike

Don't depend on pollution in <limits.h> for the definition of
<stdint.h> macros.


99436 05-Jul-2002 maxim

Fix a memory leak.

PR: bin/40177
MFC after: 1 week


99410 04-Jul-2002 ru

mdoc(7) police: a bit of tidying.


99363 03-Jul-2002 markm

Fix some low-hanging lint-fruit: endianness and staticness warnings.


99267 02-Jul-2002 dillon

Fix type-o in last commit in preparation for MFC.


99257 02-Jul-2002 ru

Reimplemented bsd.nls.mk using bsd.files.mk and bsd.links.mk.

Provided the (previously missing) dependency on source files
for intermediate .msg files.

Provided the default for NLSSRCDIR (defaults to .CURDIR).

Slightly changed the API: NLS should now list plain locale
names, without the .msg suffix.

When included from bsd.prog.mk, NLSNAME defaults to PROG.


99205 01-Jul-2002 dwmalone

Remove double #include <sys/cdef.h> and __FBSDID.

PR: 40053
Submitted by: Dan Lukes <dan@obluda.cz>


99121 30-Jun-2002 tjr

Put documentation of the -m option's argument in its list tag in the
Description section for consistency with other manpages.


99112 30-Jun-2002 obrien

Consistently use FBSDID


99110 30-Jun-2002 obrien

Consistently use FBSDID


99109 30-Jun-2002 obrien

Consistently use __FBSDID


99022 29-Jun-2002 tjr

Avoid truncating the pathname to UNIX Domain Sockets with snprintf(),
giving a more sensible warning when the (relatively meagre) sun_path
limit is exceeded.


99019 29-Jun-2002 tjr

Check that snprintf() does not truncate the destination pathname when
linking into a directory.


98919 27-Jun-2002 sheldonh

Document addition of RLIMIT_VMEM support, added in rev 1.26 of miscbltin.c.


98834 26-Jun-2002 dillon

Add support for RLIMIT_VMEM. The #ifdef's were already there but getopt()
needed to be adjusted.


98810 25-Jun-2002 tjr

ln(1)'s symbolic link handling conforms to IEEE Std. 1003.1-2001, note
this in the Standards section.


98809 25-Jun-2002 tjr

Correctly mark up the final command line arguments with the Ar macro for
the last two synopsis forms.


98780 24-Jun-2002 keramida

Add a description of the restrictions that red(1) imposes to users,
and a warning that this "restricted mode" can be bypassed easily by
using symlinks, so that users don't depend too much on it.

PR: docs/35940
Submitted by: Gary W. Swearingen <swear@blarg.net>
Reviewed by: jmallett
MFC after: 1 week


98494 20-Jun-2002 sobomax

Don't try to decode old-style options if the argv[1] begins with `-' and the
second character represents some option taking an argument. This fixes
problem when ps(1) is invoked for examply as follows:

$ ps -Ufoobar1234

the above example results in option string being interpreted as
-U foobarp1234 - note extra `p'.

Reported by: Vladimir Sotnikov <vovan@kyivstar.net>
MFC after: 2 weeks


98481 20-Jun-2002 jmallett

Bogusness may have happened using a variable assignment here before, but
proper parens mean that fd is always set by open(2) [in any part of C],
and so we can accurately check for it returning -1, without feeling like
we need to initialise fd to -1 in its declaration.

In other words, fix a stylistic/bogus nit.


98468 20-Jun-2002 jmallett

Use size_t consistently and complete some uncompleted code resulting in a
memory leak by assigning and freeing a variable appropriately as well as
keeping track of the amount of allocated ram properly.

MFC after: 1 month


98465 20-Jun-2002 jmallett

We have a place for extern declarations of global variables in ed.h, do not
use main() to do it locally.


98464 20-Jun-2002 jmallett

Remove two unused variables.


98463 20-Jun-2002 jmallett

Minor const cleanup.

Don't discard qualifiers we don't need to discard.


98427 19-Jun-2002 tjr

Bring documentation on CDPATH and its effects on cd(1) back into sync with
reality (and POSIX): current directory isn't searched unless CDPATH has
a "." element or is unset.

PR: 38442
Submitted by: oleg dashevskii <be9@be9.ru>
MFC after: 1 week


98280 16-Jun-2002 tjr

When trying to emulate a cross-device move operation with cp and rm, add
a "--" argument after the options so filenames with leading dashes are
handled correctly.

PR: 39318
Submitted by: Serge van den Boom <svdb@stack.nl>
MFC after: 1 week


98216 14-Jun-2002 jmallett

Use an usage() rather than doing the fprintf inside option parsing.


98171 13-Jun-2002 tjr

When -R is not specified, fail to copy the contents of dangling symlinks
instead of making a copy of the link itself (SUSv3)

Obtained from: NetBSD


98169 13-Jun-2002 tjr

Print the "$" symbol on blank lines when the -s and -e options are used
together.

Obtained from: OpenBSD (millert, Denis Afonin)


98168 13-Jun-2002 tjr

Remove bogus "-" operand from usage message. There is no restriction on
where it may be placed, it is treated the same as the file arguments.


98161 13-Jun-2002 tjr

Markup nits: use the Ar macro when describing the -signal_name and
-signal_number options, and for referring to the "pid" argument.


98160 13-Jun-2002 tjr

Add examples and diagnostics sections


98158 13-Jun-2002 tjr

Support the "--" end of options marker, useful to disambiguate between
signal numbers and process groups (negative pid arguments), and
required by SUSv3.


98157 13-Jun-2002 tjr

Don't list shell builtins when the hash command is used (SUSv3)


98106 10-Jun-2002 jmallett

ps(1) appeared in v4

Submitted by: grog


98092 10-Jun-2002 tjr

Sort sections, use Ex macro in Diagnostics section, point out that the first
example only works with csh(1).


98091 10-Jun-2002 tjr

Add History section. sleep appeared in v4.


98080 10-Jun-2002 jmallett

Note early appearence of some commands. These actually appeared in PWB, but
it seems we don't have a macro for that yet, so list them in the first UNIX
release since then that we have a .At for: v7.


98062 09-Jun-2002 keramida

Use socklen_t for the length of a socket structure instead of `int'.

Reviewed by: mike


98061 09-Jun-2002 keramida

Replace <strings.h> with <string.h>. No functions from the former are
used in this file, and strlen() needs to be prototyped by the latter,
for this to compile without warnings.

Reviewed by: mike


98057 09-Jun-2002 mike

Check the return value of getcwd() to avoid printf()ing a NULL. Mark
usage() as __dead2 to avoid a GCC warning.

Spotted by: keramida


98050 08-Jun-2002 jmallett

Allow whitespace to act as a delimiter in the keywords list given to the -o,
again, but also allow it in the user-specified header, too. This is far more
backwards compatible and SUSv3-happy than allowing only comma to seperate the
keywords list.

Submitted by: tjr


98030 08-Jun-2002 bde

Fixed unsorting.


98029 08-Jun-2002 jmallett

Don't say that the list of formats can be space delimited, it no longer can be.

Mention that more than one -o will concatenate formats.

Submitted by: Jun Kuriyama <kuriyama@imgsrc.co.jp>


97978 07-Jun-2002 jmallett

Back out previous back out of previously correct code.

Double-plus-pointy-hat to: jmallett
Submitted by: bde


97972 07-Jun-2002 jmallett

Remove tunables to hide warnings that no longer exist.


97971 07-Jun-2002 jmallett

Cast to long to match format. Hidden by revision 1.18 of Makefile.


97966 06-Jun-2002 jmallett

Use a global `now' variable for the current time, and initialise it at
startup, right after calling setlocale(3).


97965 06-Jun-2002 jmallett

Implement a SUSv3-ignorant but "time"-similar format for "etime", elapsed
run time (NOT cpu time). cputime() and elapsed() both need to honour SUSv3
now.


97964 06-Jun-2002 jmallett

sysctlbyname(3) returns -1 on failure, not any other value < 0.


97961 06-Jun-2002 jmallett

Support the SUSv3 `rgroup' format.

Clean up some local style bogons.


97959 06-Jun-2002 jmallett

Cast arg_max to size_t when comparing it (times 4, plus 1) against SIZE_MAX. I
was worried about truncation of arg_max by this cast, but if it gets truncated,
we know it'll obviously be greater than SIZE_MAX anyway.

Big pointy hat to: jmallett
Submitted by: keramida


97958 06-Jun-2002 jmallett

SUSv3 conform on the "comm" and "args" formats, and make correct the "command"
format, since it's BSDlike, and "comm" is actually different.


97945 06-Jun-2002 jmallett

Refer to the command format by its SUSv3 name (comm), and list command as an
alias.


97944 06-Jun-2002 jmallett

As per behaviour on SVR4 systems, to allow any desirable type of header in the
override, seperate by comma (',') only, rather than any type of whitespace
(the literal space character (' ') had already been removed from this list).

This allows things like:
miamivice# ps -opid='Process
> Identifier'
Process
Identifier
1350
1445
1450

To work.


97916 06-Jun-2002 tjr

Document the -f and -v options of the unset builtin.


97915 06-Jun-2002 tjr

Quote the output of the no-argument form of the `set' builtin for re-input
to the shell.


97914 06-Jun-2002 tjr

Add the SUSv3 -p ("portable") option to both the export and readonly
builtins. This makes export/readonly print lines in the form
"export name=value".


97909 06-Jun-2002 tjr

Don't modify output that is to be quoted if it contains no IFS characters
or shell metacharacters.


97877 05-Jun-2002 jmallett

Widen the scope of fmt.c::1.19 and consistently use errx(3) if malloc(3) [or
realloc(3)] happens to fail, everywhere in ps(1).

Discussed with: bde, charnier (a while ago)

fmt_argv() can no longer return NULL, so don't bother checking.

Submitted by: bde


97875 05-Jun-2002 jmallett

Comma seperate format lists, since space is no longer up to the task.

Poked by: David Wolfskill <david@catwhisker.org>
Pointy hat to: jmallett


97850 05-Jun-2002 jmallett

Support the 'comm' keyword, which is equivalent to our 'command', but
specified by SUSv3.


97849 05-Jun-2002 jmallett

A space cannot be a header string seperator it appears given the SUSv3
description of ps(1), which uses them. I question whether newline and tab
can be either, but I'm not touching them. Yet.


97848 05-Jun-2002 jmallett

To comply with SUSv3, duplicate the variable contents for each given format,
so that multiple -ovar=header lines do not overwrite eachother.

This means that ps -ouser=USERNAME -ouser=WHO would now possibly print:
USERNAME WHO
juli juli

Whereas before it would be:
WHO WHO
juli juli


97847 05-Jun-2002 jmallett

Returning NULL here if malloc(3) fails is silly, at this point in the codepath
we have't malloc(3)'d nearly as much as we probably will, so errx(3) away,
instead of waiting for something to fail yet again later on.


97846 05-Jun-2002 jmallett

Remove an XXX comment that seems to be a tiny bit no longer pertinent. This
function seems to do the right thing, and is not a "stub", and whoever "marc"
is, he's had plenty of time to do "the real one", so don't wait around for
him any longer.


97845 05-Jun-2002 jmallett

Use of zero here meant many things, NULL, '\0' (NUL), and 0. Sort it out.


97843 05-Jun-2002 jmallett

Use a const char * where it is meant to be used. There's no reason to try
to discard the const qualifier here.


97842 05-Jun-2002 jmallett

Duplicate the pointer to the string containing the header so it does not get
frobbed when/if the pointer it is actually a part of gets freed.


97822 04-Jun-2002 tjr

Display job status correctly when a pipeline is suspended.


97820 04-Jun-2002 tjr

Describe finished jobs as "Done", not "Exit" (SUSv3)


97819 04-Jun-2002 tjr

Don't output `state' and `current' fields for processes that aren't
leaders in -l option to jobs(1).


97817 04-Jun-2002 tjr

Missing prototypes from previous commit.


97816 04-Jun-2002 tjr

Correct minor spacing problem in output of jobs -l for pipelines.


97815 04-Jun-2002 tjr

Quote alias values in the output of the alias(1) builtin so they are
suitable for re-input to the shell (SUSv3)


97804 04-Jun-2002 tjr

Respect setting of the COLUMNS environment variable (SUSv3)


97803 04-Jun-2002 tjr

Ignore empty COLUMNS environment variable. COLUMNS should take precedence
over TTY width found via ioctl() (SUSv3)


97772 03-Jun-2002 tjr

Correct history (again): V3 had a kill command, only it was in section 8,
not 1.


97768 03-Jun-2002 tjr

Correct History: sync(8) appeared in V4.


97767 03-Jun-2002 tjr

Correct History section: kill(1) appeared in V4, not V6.


97731 02-Jun-2002 tjr

Fix typo causing ``fc -e'' to not work correctly. getopt() sets optarg,
not shoptarg.


97730 02-Jun-2002 tjr

Adding an entry to the history with H_ENTER moves libedit's internal
history cursor. Reset the cursor after adding the entry to the history
when doing ``fc -s'' so the output is correct.


97689 01-Jun-2002 tjr

Implement $PPID, the parent process ID of the shell.


97688 01-Jun-2002 tjr

Support the remaining job ID formats required by SUSv3:
%+ (current job, same as %%),
%- (previous job),
%?str (job with "str" in its command name).


97669 31-May-2002 tjr

Add -s (output PID's only) and -l (show PID's) options to the jobs(1)
builtin. Modify the output format to match what SUSv3 requires.


97664 31-May-2002 tjr

#if JOBS around a job control-related statement to allow compilation with
job control disabled.


97663 31-May-2002 tjr

Break the code to display status info for one job out from showjobs() into
showjob(), use it inside dowait() to display status info for consistency,
and in a format closer to what the standard requires.


97660 31-May-2002 tjr

Move job to front of most recently used job list when bg'd or fg'd.


97659 31-May-2002 tjr

Instead of keeping just the jobid of the most recently bg'd or fg'd job,
keep a linked list of the jobs, most recently used first. This is required
to support the idea of `previous job', and to allow the jobs fg and bg
default to be correct according to POSIX.


97604 30-May-2002 ru

mdoc(7) police: kill hard sentence breaks.


97533 30-May-2002 tjr

Reject options, handle "--" correctly in unlink(1).


97531 30-May-2002 tjr

Reject options, handle "--" end-of-options marker in link(1).


97502 29-May-2002 ru

mdoc(7) police: punctuation.


97465 29-May-2002 ru

mdoc(7) police: tidy up the markup a bit.


97464 29-May-2002 ru

mdoc(7) police: markup nits.


97463 29-May-2002 ru

mdoc(7) police: markup nits.


97462 29-May-2002 ru

mdoc(7) police: punctuation.


97458 29-May-2002 ru

mdoc(7) police: replace the XXX with the correct width.


97372 28-May-2002 marcel

Add uuidgen(2) and uuidgen(1).

The uuidgen command, by means of the uuidgen syscall, generates one
or more Universally Unique Identifiers compatible with OSF/DCE 1.1
version 1 UUIDs.

From the Perforce logs (change 11995):

Round of cleanups:
o Give uuidgen() the correct prototype in syscalls.master
o Define struct uuid according to DCE 1.1 in sys/uuid.h
o Use struct uuid instead of uuid_t. The latter is defined
in sys/uuid.h but should not be used in kernel land.
o Add snprintf_uuid(), printf_uuid() and sbuf_printf_uuid()
to kern_uuid.c for use in the kernel (currently geom_gpt.c).
o Rename the non-standard struct uuid in kern/kern_uuid.c
to struct uuid_private and give it a slightly better definition
for better byte-order handling. See below.
o In sys/gpt.h, fix the broken uuid definitions to match the now
compliant struct uuid definition. See below.
o In usr.bin/uuidgen/uuidgen.c catch up with struct uuid change.

A note about byte-order:
The standard failed to provide a non-conflicting and
unambiguous definition for the binary representation. My initial
implementation always wrote the timestamp as a 64-bit little-endian
(2s-complement) integral. The clock sequence was always written
as a 16-bit big-endian (2s-complement) integral. After a good
nights sleep and couple of Pan Galactic Gargle Blasters (not
necessarily in that order :-) I reread the spec and came to the
conclusion that the time fields are always written in the native
by order, provided the the low, mid and hi chopping still occurs.
The spec mentions that you "might need to swap bytes if you talk
to a machine that has a different byte-order". The clock sequence
is always written in big-endian order (as is the IEEE 802 address)
because its division is resulting in bytes, making the ordering
unambiguous.


97305 26-May-2002 tjr

Note that the lutimes(2) and lchflags(2) syscalls also do not follow symlinks.
Remove incorrect examples.

PR: 25016
Submitted by: Martin Kammerhofer, Joshua Goodall


97304 26-May-2002 tjr

Add lchmod(2) to the list of syscalls that do not follow symbolic links.


97277 25-May-2002 tjr

sh appeared in Version 1, not System V.1.


97276 25-May-2002 tjr

Implement `set +o', which displays the currently set options in a format
suitable for re-input into the shell.


97092 22-May-2002 tjr

Bring back the cd -L and -P options from revision 1.24, but try harder not
to fail when the logical current directory no longer exists. Allow changes
to absolute paths when logical cwd is invalid, fall back to physical cd
if logical cd fails.


97091 22-May-2002 tjr

Temporarily back out revision 1.24; it seems to handle the case where the
current directory no longer exists incorrectly and breaks `make cleandir'.


96980 20-May-2002 tjr

Add the SUSv3 -L and -P options to the cd and pwd builtin utilities. `Logical'
handling of .. is now the default.


96948 19-May-2002 jmallett

Remove a small, annoying, nit I ran in to editing this file, a lone tab
on a line by itself.


96939 19-May-2002 tjr

Implement the -u (-o nounset) option, which gives an error message if
an unset variable is expanded.

Obtained from: NetBSD (bjh21, christos)


96933 19-May-2002 tjr

Make the fg and bg commands give the output required by SUSv3.
fg outputs the name of the command, bg outputs the name of the command
and the job id.


96922 19-May-2002 tjr

Implement the -C (-o noclobber) option, which prevents existing regular
files from being overwritten by shell redirection.


96892 19-May-2002 tjr

Add missing options required by SUSv3:
-m List files across the page, separated by commas.
-p Print a slash after directory names
-x Same as -C but sort across the columns rather than down

Submitted by: Kyle Martin <mkm@ieee.org>


96879 18-May-2002 iedowse

Unconditionally update the maximum field width statistics when we
refetch the filesystem information in MNT_WAIT mode. This avoids
incorrect column alignment that sometimes occurs with NFS filesystems.

Submitted by: Ian <freebsd@damnhippie.dyndns.org>


96857 18-May-2002 tjr

Back out part of previous commit: make -P the default again until I'm
convinced it's a good idea.


96831 18-May-2002 tjr

Make -L the default, allow both -L and -P to be specified (last one used
matters), fall back to -P mode if we can't get the logical directory.


96809 17-May-2002 ache

Optimize prev. commit code a bit


96808 17-May-2002 ache

Trailing slash fixes.

Fix the case:
cp file nonexistent/
which create nonextstent as file while trailing slash clearly indicates
that nonexistent must be a directory.
Also fix the case:
cp file1 file2/
which should produce error.


96806 17-May-2002 jmallett

Remove local definition of _PATH_CP, and use <paths.h>, _PATH_CP is in the
CURRENT <paths.h>.


96729 16-May-2002 joe

The sysctl has changed from 'kern.ps_showallprocs' to
'security.bsd.see_other_uids'.


96706 16-May-2002 trhodes

more file system > filesystem


96702 16-May-2002 trhodes

Consistancy check s/file system/filesystem/

Reviewed by: brian


96681 15-May-2002 billf

restore missing default case removed in ls.c:r1.57

add break statements to default cases where missing.

Submitted by: bde


96649 15-May-2002 jmallett

Make 'user' and 'group' const as to not discard the qualifier from the
functions we use to assign them. Doesn't seem to be anything else that
relies on these being non-const.


96648 15-May-2002 jmallett

Remove an empty default case to make this syntactically correct. Not there
is as good as blaknk.


96470 12-May-2002 phk

Remove the private code for reading UFS superblocks, this does not belong
in df(1) when we have multiple filesystem types, and the complications of
handling UFS2 pushes this over the edge.

Use the .../mount/extern.h to get prototypes of the functions we
borrow from there. Constify things to match. (why aren't these
functions in a lib anyway ?)

Make everything static and set WARNS?=5.

The way the "df diskdevice" thing works for unmounted diskdevices
is not very general.

Sponsored by: DARPA & NAI Labs.


96383 11-May-2002 jedgar

Add semicolon to empty default case to silence warning.


96382 11-May-2002 wollman

EXPR_COMPAT should imply -e, since there is no way to specify it otherwise,
and -e reflects the historic behavior of FreeBSD's expr.


96376 11-May-2002 alfred

while i'm breaking stuff, use __dead2 instead of GCC specific __attribute__.


96375 11-May-2002 alfred

backout additional include of cdefs.h, it's not helping any.


96374 11-May-2002 alfred

include cdefs.h for __printf0like to silence warning.


96373 11-May-2002 jedgar

Add semicolon to empty default case to silence warning.


96371 11-May-2002 alfred

Add semicolon to empty default case to silence warning.


96367 10-May-2002 wollman

The response to my POSIX interpretation request says that `expr'
is required to be oblivious to overflow and to use the data type `long'.
(Division by zero is undefined in ISO C so it's still OK to check for it
here.) Add a new `-e' flag to get the old, more useful behavior.


96314 10-May-2002 obrien

Remove gCC'isms.


96247 09-May-2002 joe

Replace /kernel with /boot/kernel/kernel.

PR: docs/37757
Submitted by: Hiten Pandya <hiten@uk.FreeBSD.org>


96196 08-May-2002 des

Use <paths.h> rather than "pathnames.h", and fix a couple of whitespace nits.

Sponsored by: DARPA, NAI Labs


96053 05-May-2002 jmallett

Check for possible overflow from sysconf _SC_ARG_MAX and error out in a
correct manner. Revert my incorrect change to use err(3) for malloc(3)
failing. Use a size_t variable to store the size of the argument buffer
we allocate, and remove silly casts as the result of having this around.
Modify the math in some of the paranoid checks for buffer overflow to
account for the fact we now are dealing with the actual size of the
buffer. Remove the static qualifier for arg_max, and the bogus setting
of it to -1.

Include <limits.h> for the definitions we use to check for possible
overflows.

Submitted by: bde


95921 02-May-2002 jmallett

Don't cast incorrectly to malloc(3), and don't use errx(3) if malloc(3)
returns NULL, as malloc(3) sets errno. Use err(3).


95654 28-Apr-2002 markm

Reorder for style.


95278 22-Apr-2002 wollman

Provide an environment variabloe, EXPR_COMPAT, which disables option
parsing for compatibility with old implementations.


95258 22-Apr-2002 des

Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.


95204 21-Apr-2002 charnier

Use `The .Nm utility'


95122 20-Apr-2002 charnier

Use `The .Nm utility'


95007 18-Apr-2002 mux

Add a reference to the kenv(2) manpage.


94985 18-Apr-2002 ru

Replaced exists() tests with two equivalent defined().

LIBDIR is defined in bsd.own.mk but sys.mk no longer
includes bsd.own.mk as of revision 1.60.


94937 17-Apr-2002 mux

Use the new functionalities provided by the kenv(2) syscall.

Reviewed by: peter


94869 16-Apr-2002 charnier

Use `The .Nm utility'


94868 16-Apr-2002 charnier

ls(1) is utility not function


94850 16-Apr-2002 trhodes

s/CMOS/hardware as talked about on cvs-committers.

Suggested by: sheldonh
Approved by: bde
MFC after: 1 day


94787 15-Apr-2002 trhodes

Little nit pick in date(1) manual page, tell users which clock date(1)
sets

PR: 35606


94775 15-Apr-2002 greid

Stop a null pointer dereference in the builtin hash function.

PR: 36141
Approved by: cracauer
MFC after: 1 week


94712 15-Apr-2002 jwd

Document option to option dependancy. Fix typo.

MFC after: 1 week


94553 12-Apr-2002 charnier

Do not return(f_returning_void());. Spell FALLTHROUGH to make it lint()able.


94297 09-Apr-2002 bmilekic

Introduce NO_RCMNDS flag so as to not compile rsh, rlogin, and rcp on will,
and document in share/examples/etc/make.conf

Submitted by: Aleksandar Simic <asimic@dsl.pipex.com>
MFC after: 1 week


94030 07-Apr-2002 jedgar

errx()/strerror() -> err()


93486 31-Mar-2002 keramida

Various mdoc fixes, including a change that corrects spacing as
described in PR docs/36461.

PR: docs/36461
Noticed by: Gary W. Swearingen <swear@blarg.net>
Submitted by: ru


93345 28-Mar-2002 ache

Use intmax_t as quad_t replacement, like in expr


93246 26-Mar-2002 iedowse

Make the columns in the output of df(1) line up, even for very large
filesystems. We now keep track of the maximum width required for
every variable-width field instead of just the first one.

PR: bin/15510
MFC after: 1 week


93229 26-Mar-2002 ru

Install sys/security/lomac/*.h to /usr/include/security/lomac/.

Install sys/<arch>/include/pc/*.h to /usr/include/machine/pc/.

PR: docs/29534

Install sys/netatm/*/*.h to /usr/include/netatm/*/.

Don't install compatibility symlinks for <machine/soundcard.h>
and <machine/joystick.h>. Three years is enough to be aware of
the change, and these weren't visible in the SHARED=symlinks
case.

Back out include/Makefile,v 1.160 that was a null change anyway
due to the bug in the path, and we now don't want to install
these headers because they would otherwise be invisible in the
SHARED=symlinks case.

Don't install IPFILTER headers. Userland utilities fetch them
directly, and they were not visible in the SHARED=symlinks case.

Resurrect SHARED=symlinks in Makefile.inc1.

PR: bin/28002

Prodded by: bde
MFC after: 2 weeks


93101 24-Mar-2002 markm

Replace use of __progname with the functionally identical and more
acceptable getprogname(3).


92997 23-Mar-2002 wollman

Disable -Werror when building -- the old version of gcc used on IA32 can't
deal with C99 formats.


92984 22-Mar-2002 wollman

Typo (if => of).


92983 22-Mar-2002 wollman

Add a word of caution about integer arithmetic range and overflow detection.


92982 22-Mar-2002 wollman

Fix a few formatting brainos and make the formatting of the EXAMPLES
section somewhat clearer.


92979 22-Mar-2002 wollman

Make expr POSIX-compliant, and fix some bugs. Specifically:

- expr must conform to the Utility Syntax Guidelines, so use
getopt() to eat the (non-existent) options.

- Use the Standard type intmax_t for arithmetic.

- If an argument cannot be *completely* converted to an integer, then
it is a string.

Additionally make some style cleanups near the modified lines. This
utility is still not completely style-compliant.


92974 22-Mar-2002 obrien

Update SCM ID.


92973 22-Mar-2002 obrien

Note that -n is non-standard.


92956 22-Mar-2002 markm

No need to cast; ().gr_gid is already the correct type.


92935 22-Mar-2002 obrien

Add the -n option, which automatically answers "no" to the overwrite question.


92920 22-Mar-2002 imp

remove __P


92332 15-Mar-2002 ru

mdoc(7) police: use precise width specifier.


92294 14-Mar-2002 rwatson

NAI DBA update.


91807 07-Mar-2002 markm

1) Rev.1.35 of dd.c has a more serious regression. It backs out rev.1.31,
thus breaking systems with unpolluted <sys/stat.h>'s.

2) Back out an initialisation of a variable in BSS.

Reported by: bde (1), many(2)


91737 06-Mar-2002 maxim

Log:
Remove eaccess(2) absence workaround. Add eaccess(2) checks for FILRD,
FILWR, FILEX and FILEXIST cases.

We cannot MFC this because there is no eaccess(2) in -stable yet.

PR: bin/35076
Reviewed by: ru
Approved by: ru


91665 05-Mar-2002 imp

Use ANSI-99 int names (uintXX_t) over traditional BSD int names
(u_intXX_t).


91633 04-Mar-2002 phantom

Use NLSLINKS to setup symbolic links in NLS area


91629 04-Mar-2002 phantom

This file is not used anymore


91627 04-Mar-2002 phantom

Use bsd.nls.mk for building/installing NLS files

XXX: links handling simplify


91614 04-Mar-2002 alfred

clarify code:

add comments.
don't get the length of each arg passed, only the last one.
check against == or != NULL rather than using a pointer value as
truth test.


91555 02-Mar-2002 dwhite

Update STANDARDS section on rm(1) to reflect current conformance.

PR: 35471


91498 28-Feb-2002 ache

Add (unsigned char) cast lost in WARNS=4 fixes which break 8bit locales

PR: 35421


91235 25-Feb-2002 sobomax

Fix a bug introduced in rev.1.23 - for some reason mkdir("/", ...) system
call returns `EISDIR', not `EEXIST', so that be prepared for that. This should
fix number of ports, that often call `mkdir -p //usr/local/foobar'. This
is just a quick workaround, the real fix would be either to avoid calling
mkdir("/", ...) or fix VFS code to return consistent errno for this case.


91212 25-Feb-2002 bde

#include <time.h> for the definition of time functions instead of
depending on namespace pollution 2 layers deep in <sys/stat.h>.

Removed unused includes.


91171 23-Feb-2002 bde

Fixed unsorting.


91146 23-Feb-2002 bde

Fixed some style bugs in revs 1.1 and 1.4.


91089 22-Feb-2002 markm

ANSIfy.


91087 22-Feb-2002 markm

Fix warnings inspired by lint, a commercial lint and WARNS=4.


91086 22-Feb-2002 markm

Fix a boatload of warnings inspired by lint, a commercial lint
and WARNS=4.


91085 22-Feb-2002 markm

Warnings fixes.


91084 22-Feb-2002 markm

Fix warnings inspired by lint, a commercial lint and WARNS=4.


91083 22-Feb-2002 markm

Partially fix (well, work around) warnings inspired by lint, a
commercial lint and WARNS=4.


91082 22-Feb-2002 markm

Fix warnings inspired by lint, a commercial lint and WARNS=4.


91081 22-Feb-2002 markm

Warnings fixes inspired by lint, a commercial lint and WARNS=4.


91080 22-Feb-2002 markm

Warning fix. Enter into the spirit of getopt(3) a bit more.


91079 22-Feb-2002 markm

Fix warnings inspired by lint, a commercial lint and WARNS=4.


91078 22-Feb-2002 markm

Fix warnings inspired by lint, a commercial lint and WARNS=4


91028 21-Feb-2002 dillon

Revert wchan functionality. Add 'mwchan' to supply new duel mutex/msleep
functionality and make it the default.

With additional improvements by: Mark Peek <mp@FreeBSD.org>


90888 19-Feb-2002 jedgar

Remove extraneous blank line


90887 19-Feb-2002 jedgar

Use acl_dup() to duplicate an ACL instead of rolling our own


90878 19-Feb-2002 imp

Fixed divots that I created when I moved prototypes of group_from_gid
and user_from_uid to grp.h and pwd.h. Update the man pages.

Submitted by: David Malone
Pointy hat to: imp


90832 18-Feb-2002 imp

Remove now-obsolete __STDC__ ifdefs, remove redundant NULL definition and
include stdlib.h for NULL.


90798 17-Feb-2002 gshapiro

Update build infrastructure for sendmail 8.12.


90740 16-Feb-2002 dillon

When blocked on a mutex, display the mutex name via the wchan string field
so we can at least tell the difference between being blocked in Giant
and being blocked in some other mutex.


90738 16-Feb-2002 des

Document the 'M' state.


90644 14-Feb-2002 imp

Move user_from_uid to pwd.h
Move group_from_gid to grp.h
Remove from stdlib.h
Make the prototypes match the code
Fix rm and mv to include new files.

NetBSD has these defined in those files, and others too that I've not
done.

Approved by: terminal room kabal
Reviewed by: jhb, phk


90559 12-Feb-2002 mp

Install complete.tcsh and csh-mode.el into ${SHAREDIR}/examples/tcsh.

PR: misc/34800 (from Steven Grady)
Submitted by: phantom (patch)
MFC after: 3 days


90536 11-Feb-2002 mike

Repo-copied `src/bin/pwd/realpath.1' to `src/bin/realpath/realpath.1',
as part of the move to seperate realpath(1) into its own directory.


90535 11-Feb-2002 mike

o Remove old code from pwd(1); realpath(1) is now in its own directory.
o Fix some unordered includes in pwd(1).
o Connect realpath(1) to the build.


90523 11-Feb-2002 mike

Move the realpath(1) source into its own directory. Previously, it
shared sources with pwd(1).


90458 10-Feb-2002 mike

Use the getprogname(3) function instead of directly accessing
`__progname'.

Submitted by: dd


90415 08-Feb-2002 markm

Remove leaf node WARNS?=2 (that mainly I added). This should
help the GCC3 transition and CURRENT in general.


90331 07-Feb-2002 green

Correct a logic bug that snuck in and broke multiplication of off_ts.


90266 05-Feb-2002 zarzycki

Fix the race between the stat() and the mkdir().
Reviewed by: jkh


90170 04-Feb-2002 mike

Add -L option (SUSv3) to pwd(1). Fix a bug, where realpath(1) would
complain about paths starting with `-', by not calling getopt(3).

Submitted by: Tim J. Robbins <tim@robbins.dropbear.id.au>
Obtained from: NetBSD (partially)
MFC after: 1 month


90167 04-Feb-2002 kris

Correct inadvertent style botches in previous commit.


90166 04-Feb-2002 kris

Lock down with WFORMAT=1 except those directories with unfixed warnings.
Tested on i386 and alpha.


90157 04-Feb-2002 kris

__printflike() should really be __printf0like() since verrx() can
accept a NULL format string.


90156 04-Feb-2002 kris

Add a __printflike() attribute to silence warning with FORMAT_AUDIT=1


90153 03-Feb-2002 markm

Use __FBSDID() and clean up the vendor tags.


90150 03-Feb-2002 markm

WARNS=4 fixes, plus a healthy dose of fixes inspired by lint.


90143 03-Feb-2002 markm

WARNS=4 fixes (incomplete, so set NO_WERROR), and lots of extra
cleanup courtesy of automatic checking (lint).


90133 03-Feb-2002 knu

Work around a buffer overflow problem on argv that has been exposed
after making test(1) a sh(1) builtin; sh(1) coredumps when you run
something like this:

sh -c 'test ! `true 1`'

The cause is that the test(1) code totally depends on the presence of
two extra cells at the end of argv that are filled with NULL's. The
reason why the bug hasn't been exposed would be because the C startup
code kindly prepares argv with some extra zeroed cells for a program.

I know this is not the best fix, but since there are argv++'s without
boundary checks everywhere, I'd rather patch it up like this
(preparing a copy of argv with extra NULL's) for the moment.

MFC after: 3 days


90127 03-Feb-2002 jedgar

Use a more correct method of copying entire ACLs (fixes
operation under Linux).


90115 02-Feb-2002 imp

Fix unused variable.


90114 02-Feb-2002 imp

missed a few registers


90113 02-Feb-2002 imp

Ooops, forgot to remove the registers here.


90112 02-Feb-2002 imp

%.* takes an int, not a size_t.


90111 02-Feb-2002 imp

o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.
o Change
int
foo() {
...
to
int
foo(void)
{
...


90110 02-Feb-2002 imp

o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.


90109 02-Feb-2002 imp

o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.
o gc some #ifdef sun ... #endif code

Approved by: arch@, new style(9)


90108 02-Feb-2002 imp

o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.

Approved by: arch@, new style(9)


90107 02-Feb-2002 imp

Modernization effort for bin/c*:

o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.

Approved by: arch@, new style(9)


90106 02-Feb-2002 imp

Drag cat(1) kicking and screaming into the late 1980's:

o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.

Approved by: arch@, new style(9)


90059 01-Feb-2002 sheldonh

Refer to the original mode of the file, not the mode of the original
file.

PR: docs/34224
Submitted by: "Gary W. Swearingen" <swear@blarg.net>


89918 28-Jan-2002 ru

Remove a stray `:' after `v' in the getopt() call.

Submitted by: bde


89909 28-Jan-2002 ru

GC the -W option. kvm(3) doesn't read swap for almost 10 years.

PR: docs/34134
Reviewed by: bde, peter
MFC after: 1 month


89788 25-Jan-2002 green

Commit general cleanups (separate get_num() and get_off_t() functions to
debogosify some of the command-line string-number conversions into
an unsigned and signed variant.)


89575 20-Jan-2002 mikeh

Prevent overflowing the buffer that stores the command arguments.

PR: bin/19422
Not objected to by: -audit
MFC after: 3 weeks


89389 15-Jan-2002 sobomax

Add missed includes.

Reviewed by: md5


89312 13-Jan-2002 babkin

The fix for >/dev/stdout, including Tor Egge's fix for the bug in the
original attempt of the fix. And yes, this time I've tried to build
world with it and it succeeded.

Submitted by: Tor Egge
MFC after: 1 week


89132 09-Jan-2002 ru

mdoc(7) police: tidy up.


88904 05-Jan-2002 peter

Put the "mtxname" keyword in alphabetical order (t comes after s) so
that the keyword is recognized.


88755 01-Jan-2002 mckay

Bruce thought some of the comments I added were not clear enough. This is
a combination of my words and his. We will stop fiddling now. :-)


88672 29-Dec-2001 bde

Fixed style bug (unsorting of SRCS) in rev.1.15.


88671 29-Dec-2001 bde

Fixed style bugs in revs. 1.6, 1.10 and 1.12.


88670 29-Dec-2001 bde

Fixed missing DPADD and disordered LDADD in rev.1.17

Fixed setting of WARNS in rev.1.16. Options should normally be set using
using "?=", not using "=", so that the setting is easy to override on the
command line, and setting WARNS to 0 should not be an exception.


88668 29-Dec-2001 joe

LSCOLOURS should be spelt LSCOLORS.

Submitted by: Jordan DeLong <fracture@allusion.net


88604 29-Dec-2001 ben

Remove part of a diff committed at the end of the file.


88603 29-Dec-2001 joe

Force raw printing of non-printable characters via the -w option.

PR: bin/28007


88602 29-Dec-2001 joe

Restore these files to shiny KNF.


88595 28-Dec-2001 joe

Convert some spaces into tabs that I missed first time around.


88594 28-Dec-2001 joe

Revert most of rev 1.42, to restore KNF style.

Requested by: bde


88591 28-Dec-2001 joe

Add a new flag, -h which when combined with the -l option causes
file sizes to be displayed with unit suffixes; Byte, Kilobyte,
Megabyte, Gigabyte, Terabyte and Petabyte in order to reduce the
number of digits to three or less.

Submitted by: nik


88588 28-Dec-2001 joe

Make it clearer what changed to a user using the old format of LSCOLORS.


88587 28-Dec-2001 joe

Mop up some warnings.


88586 28-Dec-2001 joe

Make the style more consistent throughout the file.


88584 28-Dec-2001 joe

Use the default colour instead if a bad colour specification is given.


88583 28-Dec-2001 joe

Revamp the colour support to allow for bold characters. Colours
are now defined using the characters a-h and A-H for the bold
variants. The old way using 0-7 for the colours still works, but
prints a message asking the user to switch.

PR: bin/27374


88471 25-Dec-2001 ache

strtoq -> strtoll (strtoq is deprecated)


88463 24-Dec-2001 alfred

backout rev 1.14, it's breaking things.


88439 23-Dec-2001 mckay

The previous fix caused cp to emit spurious warnings under some
circumstances. This is a reworked version of the same fix, that does
not have this defect, and which fixes some style bugs at the same time.

Bug reported and fix reviewed by: bde


88396 22-Dec-2001 babkin

Added ability to do ">/dev/stdout". The apsfilter people are anxious
to get it MFCed in time for release 4.5.

MFC after: 2 weeks


88182 19-Dec-2001 ru

Make ``df -l'' work when no network filesystems are loaded.

PR: bin/32397


88084 17-Dec-2001 ache

1) Localize (LC_CTYPE)
2) Catch "" to 0 conversion for OSes that not catch it in strto*()
(f.e. -stable). It is needed because POSIX agrees with both variants.


87961 14-Dec-2001 ache

POSIX strto*() functions MAY return EINVAL, so don't assume that only one
errno from them allowed and it is always ERANGE


87893 14-Dec-2001 luigi

Add prototypes for main() so that these programs compile with -Werror
(which somehow now seems to be the default for compiling -current).
This error popped up while doing a PicoBSD cross-compile on a 4.3-ish system,
it may well be that there are other apps which have similar problems,
but I did not spot them as they are not included in my picobsd config.

Whether adding prototypes for main() is the correct solution or not
I have no idea, a request to -current on the matter went basically
unanswered. Those who have better ideas are welcome to back this out
and replace it with the correct fix.


87666 11-Dec-2001 charnier

Do not dot terminate errx() strings


87655 11-Dec-2001 mckay

Preserve directory timestamps with -p. Allow non-empty read-only
directories to be copied. Apply umask to newly created directories
when -p is not specified.

PR: 27970
PR: 31633

MFC after: 4 days


87652 11-Dec-2001 mckay

Typo in warning message (chown should be chmod).


87628 10-Dec-2001 dwmalone

Style improvements recommended by Bruce as a follow up to some
of the recent WARNS commits. The idea is:

1) FreeBSD id tags should follow vendor tags.
2) Vendor tags should not be compiled (though copyrights probably should).
3) There should be no blank line between including cdefs and __FBSDIF.


87444 06-Dec-2001 ru

-lcipher is an installable library.


87432 06-Dec-2001 keramida

Make a bit more clear the types of characters that -B option will
print in octal.

Reviewed by: roam, silence on -doc


87354 04-Dec-2001 ru

Spelling.


87353 04-Dec-2001 ru

mdoc(7) police: s/LKM/KLD/, sort xrefs.


87323 04-Dec-2001 obrien

Default to WARNS=2. Binary builds that cannot handle this must explicitly
set WARNS=0.

Reviewed by: mike


87260 03-Dec-2001 jedgar

Move the code merging ACL_USER and ACL_GROUP objects from under
two nested while loops into a separate function.

Obtained from: TrustedBSD Project


87259 03-Dec-2001 jedgar

Add defines for access and default ACLs (ACCESS_ACL/DEFAULT_ACL)
to enhance readability.

Obtained from: TrustedBSD Project


87254 03-Dec-2001 jedgar

style(9) cleanups mostly consisting of:
o explicitly check return values and variables against a value
o return x; -> return (x);
o fix inconsistent sysexits usage by nuking it (partially
suggested by bde)

Obtained from: TrustedBSD Project


87253 03-Dec-2001 jedgar

Correct example to remove *all* extended ACL entries and
clarify description.


87237 02-Dec-2001 markm

Slight makefile style.

Use __FBSDID().


87226 02-Dec-2001 jedgar

o Expand the explaination of the -b option WRT the resulting
group ACL entry in relation to the existing group and mask
ACL entries.
o Move the explanation of multiple ACL entries on the command
line to the ACL ENTRIES section.

Obtained from: TrustedBSD Project


87224 02-Dec-2001 jedgar

o Correct error message forgotten in the last commit (malloc() -> calloc())
o Fix style nits

Submitted by: bde


87181 02-Dec-2001 jedgar

Use calloc(3) instead of rolling our own.


87094 29-Nov-2001 green

Note that stty is a utility and not... err... a program....

Submitted by: ru


87083 29-Nov-2001 green

Stty is a program, not a function.


86922 26-Nov-2001 green

Add LOMAC options (the "Z" flag in both cases) to display extra information
in ls(1) and ps(1).

Sponsored by: DARPA, NAI Labs


86692 20-Nov-2001 knu

Remove the printf builtin command from sh(1), which command is not
used so often that it's worth keeping it as a builtin.

Now that all the printf invocations from within the system startup
scripts, we can safely remove it.

Urged by: sheldonh :)

No MFC is planned so far because it may break compatibility and
violate POLA.


86622 19-Nov-2001 knu

Fix style bugs I found, and add a comment.


86619 19-Nov-2001 knu

Oops sorry, forgot to add a #include.


86618 19-Nov-2001 knu

- Do not reference argv[1] if no argument is given.

Reported by: brian

- Call error() instead of errx() if compiled as sh(1) builtin.


86505 17-Nov-2001 knu

Make test(1) a builtin command of our sh(1) for efficiency. The
binary size increase is 3,784 bytes (about 0.6%).

I don't drop the printf builtin while I'm here because some /etc/rc.*
scripts seem to use it before mounting /usr where printf(1) resides.

Reviewed by: arch (sheldonh)
Inspired by: NetBSD, ksh
Clued by: ume (on how the printf builtin is used)


86458 16-Nov-2001 rwatson

o Update licenses, comments.

Obtained from: TrustedBSD Project


86404 15-Nov-2001 dd

Deuglify the usage message by putting the program name after the
"usage:" string. This is how most (all?) other programs in the system
do it.

PR: 31596
Submitted by: Cyrille Lefevre <clefevre@citeweb.net>


86176 07-Nov-2001 tegge

Don't call setvar() with the VTEXTFIXED flag. A copy is created by
setvar() and passed to setvareq(). When the VTEXTFIXED flag is set,
that copy is never freed, causing a memory leak.

PR: 31533
Submitted by: maxim@macomnet.ru


85618 28-Oct-2001 dillon

Use a quad int conversion routine for time_t instead of ulong, capable of
decoding tar's full time buffer (12 digits).


85617 28-Oct-2001 dillon

Various string fields for certain cpio types are 11 rather then 8
characters. Use quad conversion functions rather then long conversion
where appropriate to handle the available range. Mainly fixes time_t
but there was also a st_size ulong conversion in there that has to be
quad or cpio cannot be used to copy files > 2G.

MFC after: 1 day


85616 28-Oct-2001 dillon

Remove unnecessary casts in timeval.tv_sec load from st_*time


85615 28-Oct-2001 dillon

Remove assumption that time_t is an int

MFC after: 1 day


85162 19-Oct-2001 ru

mdoc(7) police: join OS version with the corresponding macro.


84936 14-Oct-2001 tegge

Repair normally unused is_digit() macro.


84261 01-Oct-2001 obrien

*** empty log message ***


83962 26-Sep-2001 ru

WARNSify.


83961 26-Sep-2001 ru

The "cat - -" feature was broken by the last commit.
Restore the code that avoided closing and reopening
stdin. This is also required by POSIX. As a bonus,
enable multiple stdin reads with the -benstv flags,
by resetting the EOF condition on stdin.


83933 25-Sep-2001 ru

mdoc(7) police: fixed markup.


83760 21-Sep-2001 ru

mdoc(7) police: markup nits.


83676 19-Sep-2001 tegge

Don't check uninitialized memory for having the shell control character
value CTLARI since this might break expansion of arithmetic expressions.

Don't access memory below start of stackblock.

Problem analyzed by hunt@iprg.nokia.com, slightly different patch applied.

PR: 24443
Submitted by: hunt@iprg.nokia.com


83675 19-Sep-2001 tegge

BASESYNTAX, DQSYNTAX, SQSYNTAX and ARISYNTAX handles negative indexes.
Allow those to be used to properly quote characters in the shell
control character range.


83674 19-Sep-2001 tegge

Adjust some type checks to include CTLQUOTEMARK in the range of
shell control characters.


83482 15-Sep-2001 dillon

Give /bin/cat the ability to connect to and read unix-domain sockets

MFC after: 1 week


83366 12-Sep-2001 julian

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after: ha ha ha ha


83280 10-Sep-2001 peter

UPAGES as a constant is gone in KSE. We are going to have to trust
and/or fix ki_rssize.


83121 05-Sep-2001 mp

Enable BSD style color ls support.

PR: 23161
Submitted by: Anand Ranganathan <anand@blandings.com>


83116 05-Sep-2001 mp

Update to the tcsh-6.11 version.

This file could be removed as the alpha changes have been incorporated into
the base release. However, it is probably best to leave this here since there
are additional FreeBSD architectures in the pipeline that should be added.


83101 05-Sep-2001 mp

Add new tcsh-6.11 NLS sets for Estonian and Russian.
(Polish was also included in tcsh-6.11 but the set1 and set3 files are broken)


82771 01-Sep-2001 ache

File positions are off_t nowdays, not long, so:
fseek -> fseeko
ftell -> ftello

NOTE: that fseek/ftell not works for >long offsets per POSIX:

[EOVERFLOW] For fseek( ), the resulting file offset would be a value which
cannot be represented correctly in an object of type long.

[EOVERFLOW] For ftell ( ), the current file offset cannot be represented
correctly in an object of type long.


82661 31-Aug-2001 dd

The file_descriptor argument to -t isn't optional, so don't mark it up so.


82268 24-Aug-2001 peter

On today's kernels masking with ~KERNBASE is turning out to be less
than useful. It still hits at least 8 digits. Adjust for reality.

This is still not satisfactory for the alpha if you add "-O paddr".


82267 24-Aug-2001 peter

Handle kvm_getprocs() returning nothing. Dont pass -1 to a size
for malloc().


82237 23-Aug-2001 dd

Implement `stty ek` as documented.

PR: 24063
Submitted by: Seth Kingsley <sethk@osd.bsdi.com>


81743 16-Aug-2001 brian

Only capitalise the last `t' in ps's first argument when it's
actually part of an option argument.

Submitted by: Chris Costello <chris@calldei.com>
MFC after: 6 weeks


81687 15-Aug-2001 ru

mdoc(7) police: utilize the new .Ex macro.


81622 14-Aug-2001 ru

mdoc(7) police: s/BSD/.Bx/ where appropriate.


81602 13-Aug-2001 peter

Initialize infp at main()


81601 13-Aug-2001 peter

Initialize listf at main()


81588 13-Aug-2001 ru

Spell "FreeBSD" with "F" and "BSD" in uppercase.


81586 13-Aug-2001 ru

Removed duplicate VCS ID tags, as per style(9).


81462 10-Aug-2001 ru

mdoc(7) police: join split punctuation to macro calls.


81298 08-Aug-2001 sheldonh

can not -> cannot


81251 07-Aug-2001 ru

mdoc(7) police:

Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.


81220 06-Aug-2001 mike

o Correctly define rcsid.
o Add consts where appropriate.
o Rename some variables that were shadowing global declarations.
o Remove register storage-classes.
o Make errmsg a const, so we can just set error messages instead
of using sprintf/strcpy.
o Set WARNS=2

Reviewed by: bde, des


80818 01-Aug-2001 obrien

style(9)


80795 01-Aug-2001 obrien

Remove a misplaced space.


80381 26-Jul-2001 sheldonh

Use STD{ERR,IN,OUT}_FILENO instead of their numeric values. The
definitions are more readable, and it's possible that they're
more portable to pathalogical platforms.

Submitted by: David Hill <david@phobia.ms>


80196 23-Jul-2001 sheldonh

Break the list of parameter expansions into two lists so that
the paragraph introducing the prefix and suffix pattern expansions
does not appear as part of the explanation for the string length
expansion.


80187 23-Jul-2001 dd

Don't use the pronoun "you".

Reviewed by: sheldonh, mpp


80138 22-Jul-2001 dd

Don't put a shell prompt in the example since none of the other man
pages do it. Also, don't use brackets to indicate optional options in
the example; instead, add a paragraph below the example explaining it.


80074 21-Jul-2001 ben

Add missing closing parenthesis.


80072 21-Jul-2001 obrien

Show an example of how to sort a file listing by size. Hopefully this
will reduce the number of people calling for this functionality to be
added to ls(1).


79791 16-Jul-2001 wollman

Fix style bugs introduced by rev 1.28. No functional changes.


79758 15-Jul-2001 dd

Set WARNS=2 on programs which compile cleanly.

Submitted by: Mike Barcroft <mike@q9media.com>


79754 15-Jul-2001 dd

Remove whitespace at EOL.


79535 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


79526 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


79454 09-Jul-2001 dd

mdoc(7) police: remove extraneous .Pp before and/or after .Sh.


79452 09-Jul-2001 brian

Fix the type of the NULL arg to execl()

Idea from: Theo de Raadt <deraadt@openbsd.org>


79366 06-Jul-2001 ru

mdoc(7) police: sort SEE ALSO xrefs (sort -b -f +2 -3 +1 -2).


79253 04-Jul-2001 mikeh

Fix warnings on alpha and re-enable WARNS=2.

Submitted by: Mike Barcroft <mike@q9media.com>


79122 03-Jul-2001 mikeh

Argh...this isn't ready for WARNS=2 on alpha.


79121 03-Jul-2001 mikeh

Constify and lockdown with WARNS=2.

Submitted by: Mike Barcroft <mike@q9media.com>
MFC after: 2 weeks


78985 29-Jun-2001 green

Use __unused for non-used variables.

Submitted by: Mike Barcroft <mike@q9media.com>


78963 29-Jun-2001 yar

Add a note on what happens if the "-p" option is specified
and a final directory already exists.

Reviewed by: freebsd-audit
MFC after: 5 days


78939 28-Jun-2001 dd

Back out previous commit: it doesn't help anything since write_file(),
which is also called from handle_hup(), uses stdio(3). Furthermore,
this means that calling exit(3) (via quit()) there is required to
flush the buffer write_file() was working on.

Submitted by: bde


78806 26-Jun-2001 dwmalone

Use the correct printf format to print a long.

Approved by: cracauer


78755 25-Jun-2001 dd

Previous commit broke dd(1)'s I/O summary when it's terminated by a
signal. Fix it by adding an explicit call to summary() in terminate()
(it was previously called implicitly by exit() because summary() was
registered with atexit()). summary() is supposed to be signal-safe--
it handles SIGINFO almost exclusively--so this should be safe.

Submitted by: bde


78732 24-Jun-2001 dd

Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).


78688 24-Jun-2001 dd

Don't call exit(3) from a signal handler.

Obtained from: OpenBSD


78686 24-Jun-2001 dd

Remove duplicate words.


78624 22-Jun-2001 dd

WARNS= -> WARNS?=

Submitted by: Mike Barcroft <mike@q9media.com>


78469 19-Jun-2001 des

Add more headers that are required with -fno-builtin (stdlib and strings)


78466 19-Jun-2001 des

<stdlib.h> is needed for exit(3) when building with -fno-builtin.


78430 18-Jun-2001 dd

Xref zcat(1).


78363 16-Jun-2001 tegge

Check for the PS_SINTR flag in the right field of struct kinfo_proc
(ki_sflag).


78170 13-Jun-2001 ru

Removed wrong cast for fts_open()'s third argument.


78070 11-Jun-2001 bde

Removed the broken code which claimed to lose the set[ug]id bits in
the !(pflag && setfile()) case for regular files unless the copy is
owned by the same user and group. These bits have already been lost
(or never gained) in the correct way. The code didn't actually lose
the bits; it depended on them being lost already (apparently in all
cases) and attempted to gain them as necessary, but it often gained
them (and sometimes collateral bits) when wrong:
- pflag && setfile() == 0 case (i.e., for a successful cp -p):
setfile() copies all the attributes as correctly as possible (as
specified by POSIX), and we sometimes messed up the up the mode by
setting it again. Also, if the file is immutable, then setting the
mode again gave spurious errors (PR 20646).
- !pflag case. If the target is created, POSIX requires it to not
have the set[ug]id bits, but we sometimes copied them from the source.
If the target already exists, POSIX requires its mode to be unchanged,
but we sometimes copied the whole mode from the source.

PR: 20646
MFC after: 4 weeks


77987 10-Jun-2001 ache

Use new locale names


77940 09-Jun-2001 ru

Simplify, with the power of new mdoc(7).


77934 09-Jun-2001 dd

Add -j to the usage string.

PR: 27986
Submitted by: Cyrille Lefevre <clefevre@redirect.to>


77896 08-Jun-2001 dd

Correct a typo.

Submitted by: Alexey V. Neyman <avn@any.ru>


77791 05-Jun-2001 nectar

Add parens to get the cast that was meant in previous commit.
While we're at it, this file seems to prefer `unsigned int'
over `u_int', so go with that.


77790 05-Jun-2001 mjacob

Wrong. The size of size_t is *not* the same as the size of an integer.

MFC after: 2 weeks


77737 04-Jun-2001 dd

Correct a spelling nit (a -> an).


77734 04-Jun-2001 pirzyk

Added the -l option to df, so to be compatable with other unicies.

PR: bin/27240
Reviewed by: GAWollman
MFC after: 2 weeks


77609 02-Jun-2001 dd

Mention the kern.ps_showallprocs sysctl.

PR: 24804
Submitted by: Mike Meyer <mwm@mired.org>


77575 01-Jun-2001 ru

Remove vestiges of MFS.


77557 01-Jun-2001 gad

Fix how /bin/sh handles 'for' and 'case' statements when it is called to do
errexit (-e) processing. This solves a problem where 'make clean' would
fail with an unspecified error in certain automake-generated makefiles.

Reviewed by: no objections from -hackers...
MFC after: 2 weeks


77522 31-May-2001 ru

Fixed the bug from the previous revision.

``chown -h owner symlink'' did not set the symlink's owner
if the file the symlink points to already had that owner:

# ls -l alink afile
-rw-r--r-- 1 nobody ru 0 May 31 14:14 afile
lrwxr-xr-x 1 root ru 5 May 31 14:14 alink -> afile
# ./chown -h -v nobody alink
# ls -l alink afile
-rw-r--r-- 1 nobody ru 0 May 31 14:14 afile
lrwxr-xr-x 1 root ru 5 May 31 14:14 alink -> afile

Similarly for chgrp(1) and chmod(1).


77491 30-May-2001 pirzyk

Fixed two bugs, first not allowing '.' as a valid login name character
in okname() in util.c and second, returning != 0 when you do have an
error from okname in two places in rcp.c.

Thanks to Garrett for the POSIX defintion of valid login and group names.

PR: bin/25757
MFC after: 3 weeks


77463 30-May-2001 imp

Use PATH_MAX in preference in MAXPATHLEN.


77462 30-May-2001 imp

Use PATH_MAX instead of MAXPATHLEN.
Also use sizeof(path) in preference to PATH_MAX.


77460 30-May-2001 imp

PATH_MAX in preference to MAXPATHLEN.


77459 30-May-2001 imp

Use PATH_MAX rather than MAXPATHLEN.


77458 30-May-2001 imp

Minor comment fix


77409 29-May-2001 imp

Use PATH_MAX in preference to MAXPATHLEN.


77407 29-May-2001 imp

Use PATH_MAX rather than MAXPATHLEN. Also fix a possible off by one
error caused by the -1 being on the wrong side of the comparison.
This would not cause an overflow, as near as I can tell, because we
truncate later anyway. We'd just fail to get a diagnostic for 1024
and 1025 byte file names.


77404 29-May-2001 imp

Use PATH_MAX in preference to MAXPATHLEN.

Also sort declarations per style(9) (big arrays come last) while I'm
in the area.


77342 28-May-2001 ru

Change noop option -h to do the real work. Now mode of symbolic link
is changed if -h option is given.

Requested by: bde
Obtained from: NetBSD (code part)


77333 28-May-2001 ru

Follow symbolic links named as command line arguments if run without -R.

This is required by symlink(7), ``Commands not traversing a file tree''
subsection, third paragraph:

: It is important to realize that this rule includes commands which may
: optionally traverse file trees, e.g. the command ``chown file'' is
: included in this rule, while the command ``chown -R file'' is not.

For chown(8) and chgrp(1), this is also is compliance with the latest
POSIX 1003.1-200x draft.

MFC after: 1 week


77244 26-May-2001 kris

Fix warnings to compile with WARNS=2 on i386 and alpha

Reviewed by: bde


77160 25-May-2001 ru

Make it clear that -P is the default.

PR: docs/27629


77108 24-May-2001 dd

Spelling police: insure -> ensure

PR: 27600
Submitted by: Iain Templeton <iain@ugh.net.au>


76890 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS on alpha and i386

MFC after: 1 week


76886 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS except for stupid mode_t warnings.

MFC after: 1 week


76884 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS on alpha and i386

MFC after: 1 week


76883 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS on alpha and i386

MFC After: 1 week


76882 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS on alpha and i386

MFC after: 1 week


76881 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS on alpha and i386

MFC After: 1 week


76880 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS on alpha and i386

MFC after: 1 week


76879 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS on i386 and alpha.

MFC After: 1 week


76878 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS on alpha and i386, except for mode_t
warnings.

MFC after: 1 week


76877 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS on i386 and alpha

MFC After: 1 week


76876 20-May-2001 kris

Silence WARNS=2 and BDECFLAGS on the i386 and alpha

MFC After: 1 week


76875 20-May-2001 kris

Silence warnings on alpha. Unfortunately we can't add WARNS to this
because of that stupid mode_t warning bug.

MFC After: 1 week


76874 20-May-2001 kris

Make this pass WARNS=2 and BDECFLAGS


76873 20-May-2001 kris

BDECFLAGS cleanup (modulo long long issues). Add WARNS. Tested on alpha.

Reviewed by: the great man himself (except alpha cleanups)


76871 20-May-2001 kris

Make this compile with WARNS=2


76812 18-May-2001 ru

Removed -I${.CURDIR}/.../sys from CFLAGS.


76810 18-May-2001 kris

BDECFLAGS cleanup


76749 17-May-2001 ru

Fix an off-by-hour bug when crossing Daylight Saving Time boundary.

PR: bin/27399
Submitted by: "Crist J. Clark" <crist.clark@globalstar.com>
MFC after: 3 days


76693 16-May-2001 imp

Migrate from using MAXPATHLEN to MAX_PATH. Use strlcpy to copy the
strings.


76404 09-May-2001 kris

Fix operation of df on unmounted filesystems, and add the ability to run df
on unmounted non-UFS filesystem using '-t'

Submitted by: bde


76360 08-May-2001 ru

mdoc(7) police: fix markup, rename and reorder some sections.


76355 08-May-2001 ru

mdoc(7) police: sort xrefs.


76353 08-May-2001 kris

GC some dead code relating to running df on unmounted block devices,
and remove the setgid operator bit from the installed binary: if you want
to view free disk space on an unmounted device, you should have read
permissions to access it.

Reviewed by: phk


76351 08-May-2001 kris

Sync up with OpenBSD. Too many changes to note, but the major features
are:
* Implement cpio compatibility mode when pax is invoked as cpio
* Extend tar compatibility mode to cover many of the GNU tar single-letter
options (bzip2 mode, aka -y/-j is not present in OpenBSD). When
invoked as tar, pax is now full-featured enough for use by the ports
collection to extract distfiles and create packages.
* Many bug fixes to the operation of pax and the tar compatibility modes
* Code fixes for things like correct string buffer termination.

I tried to preserve existing FreeBSD fixes to this utility; please let me
know if I have inadvertently spammed something.


76286 05-May-2001 kris

Add -z flag to pax to allow gzipping of archive output. Add -z and -Z (gzip
and compress) to pax when used in tar mode (invoked as 'tar') for
compatibility with GNU tar.

bzip2 functionality for further GNU tar compatibility will be added at a
later date.

Note in the manpage that -z is non-standard.

Obtained from: OpenBSD
Reviewed by: -hackers
MFC after: 2 weeks


76245 03-May-2001 markm

Depollute headers now that the VM headers DTRT.


76233 03-May-2001 jedgar

Correct assignment of the resulting ACL allowing the mask entry to
be properly set.

Obtained from: TrustedBSD Project


76168 01-May-2001 markm

Compensate for header dethreading.


76090 28-Apr-2001 dd

Document "chdir" builtin.


76060 27-Apr-2001 ru

Fixed a typo.


76059 27-Apr-2001 sobomax

Put a note that `-h' and `-n' is non-standard and provided only for
compatibility purposes.

Prompted by: ru


76039 26-Apr-2001 sobomax

Bring in `-h' compatability option and its alias `-n' to match NetBSD and GNU
semantics.

style(9) Reviewed by:
Obtained from: NetBSD


76019 26-Apr-2001 kris

Whitespace cleanup pass; reduce diffs with OpenBSD. No functional changes.


76017 26-Apr-2001 kris

Reduce diffs with OpenBSD:
#if __STDC__ -> #ifdef __STDC__
pax_warn() -> paxwarn()
sys_warn() -> syswarn()
(foo *)NULL -> NULL
bcopy -> memmove()/memcpy()
bzero -> memset()
Typo fixes
sprintf() -> snprintf()
rindex() -> strrchr()
index() -> strchr()
sys_errlist[] -> strerror()

Obtained from: OpenBSD


76016 26-Apr-2001 kris

Use mkstemp() for secure tempfile creation instead of tempnam()

Obtained from: OpenBSD
Reviewed by: mikeh


75928 24-Apr-2001 jedgar

o Separate acl_t into internal and external representations as
required by POSIX.1e. This maintains the current 'struct acl'
in the kernel while providing the generic external acl_t
interface required to complete the ACL editing library.
o Add the acl_get_entry() function.
o Convert the existing ACL utilities, getfacl and setfacl, to
fully make use of the ACL editing library.

Obtained from: TrustedBSD Project


75670 18-Apr-2001 ru

mdoc(7) police: normalize .Nd.


75577 17-Apr-2001 kris

-Wnon-const-format sweep: make format strings const char *'s, add
__printflike()/__printf0like() to function prototypes, as appropriate.

Reviewed by: bde, -audit


75491 13-Apr-2001 jedgar

Convert getfacl to the ACL editing library functions. getfacl should
now compile/work on any POSIX.1e-compliant implementation (also tested
against the current Linux patches).

Review by: rwatson
Obtained from: TrustedBSD Project


75449 12-Apr-2001 brian

Correct some markup

Submitted by: bde


75435 11-Apr-2001 brian

Introduce -osid and -otsid

Submitted by: dd


75404 11-Apr-2001 jedgar

Correct the following defines to match the POSIX.1e spec:

ACL_PERM_EXEC -> ACL_EXECUTE
ACL_PERM_READ -> ACL_READ
ACL_PERM_WRITE -> ACL_WRITE

Obtained from: TrustedBSD


75336 09-Apr-2001 brian

``|'' should be more binding than ``!'' so that this isn't broken:

if ! echo bla | wc -c ; then
echo broken
fi

Obtained from: NetBSD


75287 07-Apr-2001 brian

Remove tsess for now.

This (and sess) may come back shortly.


75285 07-Apr-2001 brian

Update documentation in line with what the code does

PR: 25435
Submitted by: dd
Forgotten by: mckusick


75279 07-Apr-2001 brian

The sess column went away last December with v1.26 of keyword.c
Remove it from ``jfmt''.

Forgotten by: mckusick


75189 04-Apr-2001 tmm

setfacl and getfacl no longer need to link against libposix1e, since it
has been integrated into libc.

Approved by: rwatson
Obtained from: TrustedBSD Project


75160 04-Apr-2001 brian

A much better (more correct) fix for handling ``!'' characters

Obtained from: NetBSD


75155 04-Apr-2001 brian

Handle ``!'' characters when they appear as second and subsequent
parts of an && or || expression.

This makes this expression work as expected:

if true && ! false; then echo yes; fi


75126 03-Apr-2001 ru

Drop support for -DRELEASE_BUILD_FIXIT and -DCRUNCHED_BINARY in
${CFLAGS}. The only supported method thus is -DRELEASE_CRUNCH.


74975 29-Mar-2001 ben

Remove a comment which seemed to confuse makewhatis:

ben@freefall:~$ whatis ed
ed(1), -(1) - ed, red text editor

PR: 25164
Submitted by: Rich Morin <rdm@cfcl.com>


74845 27-Mar-2001 ru

MAN[1-9] -> MAN.


74819 26-Mar-2001 fenner

Fix error reporting of delayed send errors.


74676 23-Mar-2001 ru

mdoc(7) police: fix markup and some spelling.


74581 21-Mar-2001 ache

Silence minor cc warning


74567 21-Mar-2001 ache

Use nl_langinfo instead of %Ef


74566 21-Mar-2001 ache

Use nl_langinfo instead of %Ef


74506 20-Mar-2001 jedgar

Remove extra CFLAGS
Add DPADD

Submitted by: bde


74505 20-Mar-2001 jedgar

Remove extra CFLAGS and redundant SRCS
Add DPADD

Submitted by: bde


74489 19-Mar-2001 jedgar

Remove 'NOSHARED=yes' (../Makefile.inc already sets this)


74468 19-Mar-2001 rwatson

o Missed in addition of setfacl.h in setfacl(1)


74467 19-Mar-2001 rwatson

o Missed in prior commit: getfacl(1) Makefile


74466 19-Mar-2001 rwatson

o Enable getfacl(1) and setfacl(1)

Obtained from: TrustedBSD Project


74465 19-Mar-2001 rwatson

o POSIX.2c Userland tool support for POSIX.1e ACLs -- getfacl retrieves ACLs
from files and directories, and setfacl sets ACLs on files and directories.

Submitted by: jedgar
Obtained from: TrustedBSD Project


74397 17-Mar-2001 ache

DIS -> ISO


74320 16-Mar-2001 dd

Make it clear that the -v option doesn't actually set the date.

PR: 24773
Approved by: nik


73640 05-Mar-2001 asmodai

Revert this file back to how it was in the STABLE branch, this means:
put greek and ja in the correct alphabetical place in the SUBDIR line.


73563 05-Mar-2001 kris

Switch from using rand() or random() to a stronger, more appropriate PRNG
(random() or arc4random())

Reviewed by: bde


73421 04-Mar-2001 assar

implement OCRNL, ONOCR, and ONLRET

Obtained from: NetBSD


73369 03-Mar-2001 ache

Small optimization: set use_ampm only when needed


73367 02-Mar-2001 ache

Use AM/PM time only when available in locale


73345 02-Mar-2001 ru

POSIX wrote:

: LC_TIME This variable shall determine the format and
: contents of date and time strings when the -v
: option is specified.

Developers took this wrong. LC_TIME specifies the locale
name, not the ``format'' argument of strftime().

Oops:
pax -w -f /tmp/foo /dev/null
LC_TIME=de_DE.ISO_8859-1 pax -v -f /tmp/foo


73281 01-Mar-2001 ben

The 'X' permission symbol is specified by POSIX.2, so don't say that it
isn't.

Obtained from: NetBSD
Confirmed by: ru, wollman


73233 28-Feb-2001 ru

Eliminate mdocNG warnings caused by misplaced or extraneous macro calls.


73219 28-Feb-2001 obrien

Fix style bug I introduced with rev 1.13 (rcsid after includes).
Along with CSRG id lossage in rev 1.11.

Submitted by: bde


73143 27-Feb-2001 obrien

Add rcsid.


72853 22-Feb-2001 ru

Move the realpath(1) birth day from FreeBSD 5.0 to FreeBSD 4.3.

Submitted by: "Stephen L. Palmer" <slpalmer@mail.com>
Forgotten by: asmodai


72489 14-Feb-2001 jlemon

Do not coredump if no options are supplied. (ps -o,)

Submitted by: rgrimes
Obtained from: NetBSD


72432 13-Feb-2001 ru

mdoc(7) police: use the default ``file ...'' feature of the .Ar macro.


72377 12-Feb-2001 jake

Catch up to new priority interface.


72343 11-Feb-2001 ache

Use decimal point from locale


72089 06-Feb-2001 asmodai

Fix typo: seperate -> separate.

Seperate does not exist in the english language.

Submitted to look at by: kris


72086 06-Feb-2001 cracauer

Fix child's SIGSTOP behaviour in scripts.

When a child is receiving SIGSTOP, eval continues with the next
command. While that is correct for the interactive case (Control-Z
and you get the prompt back), it is wrong for a shellscript, which
just continues with the next command, never again waiting for the
stopped child. Noted when childs from cronjobs were stopped, just to
make more processes (by wosch).

The fix is not to return from a job wait when the wait returned for a
stopped child while in non-interactive mode. This bahaviour seems to
be what bash2 and ksh implement. I tested for correct behaviour for
finnaly killing the child with and without forgrounding it first.
When not foregrouding before killing, the shell continues with the
script, which is what the other shells do as well.

Reviewed by: Silence on -current


71977 04-Feb-2001 mckay

In the hope of saving others from hours of tedious recovery work,
document that cp still isn't very useful for recursive copies even
with the -R flag. This is because hard links are broken by cp.


71895 01-Feb-2001 ru

mdoc(7) police: split punctuation characters + misc fixes.


71606 24-Jan-2001 jdp

Note that rmdir(2) does not follow symbolic links.


71578 24-Jan-2001 jhb

- Catch up to new proc flags.


71195 17-Jan-2001 ben

Document the restrictions on changing times in high securelevels.

PR: 23502
Submitted by: Robert Boyd <rboyd@pokerspot.com>


71169 17-Jan-2001 ache

Activate Greek message catalog


71097 16-Jan-2001 ru

Prepare for mdoc(7)NG.


71029 14-Jan-2001 alfred

Special case the error reporting when errno is ENOTDIR or ENOENT.

This makes "mkdir /nonexistant/foo" complain that /nonexistant
doesn't exist rather than /nonexistant/foo which doesn't make much
sense.

Submitted (in a different form) by: W.H.Scholten <whs@xs4all.nl>


70436 28-Dec-2000 hoek

grammar gnit: "relationships (plural) _are_ complex"


70249 21-Dec-2000 ru

mdoc(7) police: simplify construct.


70219 20-Dec-2000 obrien

Display pathname of item being rm'ed.

Submitted by: Peter Pentchev <roam@orbitel.bg>


70197 19-Dec-2000 ru

Prepare for mdoc(7)NG.


70190 19-Dec-2000 ru

Prepare for mdoc(7)NG.


70150 18-Dec-2000 ru

Prepare for mdoc(7)NG.


70079 16-Dec-2000 mckusick

Restore the rss (-u) keyword that got deleted in my somewhat over-zealous
cleanup effort.

Submitted by: Mark Peek <mark@whistle.com>


70056 15-Dec-2000 ru

Prepare for mdoc(7)NG.


70013 14-Dec-2000 ru

mdoc(7) police: removed history info from the .Os call.


69896 12-Dec-2000 mckusick

Change the proc information returned from the kernel so that it
no longer contains kernel specific data structures, but rather
only scalar values and structures that are already part of the
kernel/user interface, specifically rusage and rtprio. It no
longer contains proc, session, pcred, ucred, procsig, vmspace,
pstats, mtx, sigiolst, klist, callout, pasleep, or mdproc. If
any of these changed in size, ps, w, fstat, gcore, systat, and
top would all stop working. The new structure has over 200 bytes
of unassigned space for future values to be added, yet is nearly
100 bytes smaller per entry than the structure that it replaced.


69793 09-Dec-2000 obrien

Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.


69640 05-Dec-2000 obrien

Change the spelling of `.' to `.' from .OBJDIR since `.' really is where
generated files land. Also give precedence to generated files.


69551 03-Dec-2000 ache

Remove ${DESTDIR} from _PATH_TCSHELL, it is call path, not install path
Add gethost to build-tools to help cross-building


69476 01-Dec-2000 obrien

Fix a "#ifdef" where a comparison operator was used.
GCC 2.96 does not like this.


69457 01-Dec-2000 brian

Exit if malloc() returns NULL

Submitted by: Chris Faulhaber <jedgar@fxp.org>


69415 30-Nov-2000 ache

Upgrade to 6.10


69404 30-Nov-2000 jhb

Document the mtxname keyword.

Reviewed by: sheldonh


69372 29-Nov-2000 jhb

Introduce a 'mtxname' keyword that displays the current mutex that a
process is blocked on or '-'.


69321 28-Nov-2000 jkh

Add support for an "erase2" so that both ^H and DEL can be used
for backspacing.

Submitted By: Rui Pedro Mendes Salgueiro <rps@mat.uc.pt>


69262 27-Nov-2000 ru

Eliminate groff(1) warnings.


69247 27-Nov-2000 kris

Constify


69195 26-Nov-2000 kris

Don't call err() with user data and without a format string


69119 24-Nov-2000 ru

mdoc(7) police: minor fixes.


69110 24-Nov-2000 phk

Let the pwd program double as realpath(1).

This lets you resolve pathnames to their underlying physical path:

critter# realpath /sys/kern/subr_disk.c
/freebsd/src/sys/kern/subr_disk.c

Update the pwd man-page slightly.


69089 23-Nov-2000 ben

kenv(1) first appeared in FreeBSD 4.1.1, not FreeBSD 5.0.

PR: 23020
Submitted by: Simon Dick <simond@irrelevant.org>


69050 22-Nov-2000 ru

mdoc(7) police: Er macro usage cleanup.


69029 22-Nov-2000 kris

Use secure temporary filenames during build.

Audited by: markm, cracauer


69026 22-Nov-2000 ru

log


68963 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


68935 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


68875 18-Nov-2000 ru

mdoc(7) police: now that Nm macro accepts punctuation characters
as argument, unbreak this page by escaping the `[' character.

Noticed by: sheldonh


68754 15-Nov-2000 ben

more removal of trailing periods from SEE ALSO.


68716 14-Nov-2000 ru

Use Fx macro wherever possible.


68575 10-Nov-2000 ru

Avoid use of direct troff requests in mdoc(7) manual pages.


68542 10-Nov-2000 obrien

Install `chflags' in the root partition, NOT /usr where it is not available
in single user mode.


68389 06-Nov-2000 ru

Properly declare the multiple-columns list.


68381 06-Nov-2000 ru

Finish conversion from man(7) to mdoc(7).


67870 29-Oct-2000 jedgar

Remove obsolete /dev/drum references

Reviewed by: alex, asmodai, billf


67849 29-Oct-2000 dougb

Finish the job of conditionalizing UUCP by preventing files in /etc/uucp
from being installed, and make rmail conditional on neither of
NO_SENDMAIL and NOUUCP.

PR: bin/21321
Submitted by: Me


67660 26-Oct-2000 gshapiro

Add a MAINTAINER= line so people know who to blame


67451 22-Oct-2000 green

Allow negative seek offsets for files that can be seeked upon. It
makes dd(1) a more complete "filter", even if this functionality is
limited to seekable streams.


67183 16-Oct-2000 brian

Include sys/types.h


66961 11-Oct-2000 gshapiro

Style fixes


66907 10-Oct-2000 wollman

Don't depend on <sys/stat.h> bogusly including <sys/time.h> (and thereby
<time.h>).


66612 03-Oct-2000 brian

Implement the <> redirection operator.


66417 28-Sep-2000 kris

No need to work around SCCS variable expansion any more.


66377 26-Sep-2000 brian

Support multiple (comma separated) names as arguments to -U

PR: 11051


66073 19-Sep-2000 ru

Use .Cm macro where appropriate.


66064 19-Sep-2000 sheldonh

Fix horrendous abuse of the Nm and Pa mdoc macros, and remove troff
bold markers \fB and \fR.


66019 18-Sep-2000 ken

Add two new features to chio(1):
- The ability to specify elements by volume tag instead of their actual
physical location. e.g., instead of:
chio move slot 3 slot 4
you would now use:
chio move voltag FOO slot 4

- The ability to return an element to its previous location, as specified
by the source element. e.g., instead of:
chio move drive 0 slot 4
you would now use:
chio return drive 0
or
chio return voltag FOO

These features will obviously only work with changers that support volume
tags and/or source element IDs. chio(1) should fail gracefully if the user
attempts to use these new features and the source element ID or volume tag
are not found.

PR: bin/21178
Submitted by: "C. Stephen Gunn" <csg@waterspout.com>
Reviewed by: ken


65970 17-Sep-2000 gshapiro

Give users a way to alter the sendmail (and related utilities) build
environment so they can enable functionality such as SASL, LDAP, Hesiod.


65557 07-Sep-2000 jasone

Major update to the way synchronization is done in the kernel. Highlights
include:

* Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The
alpha port is still in transition and currently uses both.)

* Per-CPU idle processes.

* Interrupts are run in their own separate kernel threads and can be
preempted (i386 only).

Partially contributed by: BSDi (BSD/OS)
Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh


65542 06-Sep-2000 marko

Fix markup typo

PR: 21084
Submitted by: Gerhard Sittig <Gerhard.Sittig@gmx.net>


64788 17-Aug-2000 sheldonh

Fix style bugs and poor wording introduced in rev 1.12.

Submitted by: bde


64787 17-Aug-2000 sheldonh

Fix style bugs and inconsistencies introduced in rev 1.16.

Submitted by: bde


64705 16-Aug-2000 cracauer

Disable part of my 8-bits fixes from December 1999.

Serious fix still needed, see discussion on -current
(Subject: /bin/sh dumps core with here-document of 8bit text)

Problem in this code originally spotted by
Jun Kuriyama <kuriyama@FreeBSD.org>


64704 16-Aug-2000 cracauer

Fix type builtin for absolute paths and relative paths with directory
names in them.

Also use a colon in the answer of `type` everytime the questioned item
is not usable.

PR: bin/20567


64702 16-Aug-2000 cracauer

From submitter:
growstackblock() sometimes relocates a stack_block considered empty
without properly relocating stack marks referencing that block.
The first call to popstackmark() with the unrelocated stack mark
as argument then causes sh to abort.

Relocating the relevant stack marks seems to solve this problem.

The patch changes the semantics of popstackmark() somewhat. It can
only be called once after a call to setstackmark(), thus cmdloop() in
main.c needs an extra call to setstackmark().

PR: bin/19983
Submitted by: Tor.Egge@fast.no
Reviewed by: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>


64692 16-Aug-2000 imp

Don't explicitly declare optarg and optind. These are declared in
unistd.h, which is already included.


64638 14-Aug-2000 sheldonh

Add the -i option, as found in rm(1), which provides an interactive
mode in which the user is prompted for confirmation before an
existing file is replaced.

Submitted by: alex


64604 13-Aug-2000 joe

Un-deprecate the -G flag at obrien's request. Colour sequences are still
dependent upon the output being directed to a terminal however.
(Use the CLICOLOR_FORCE variable to force output).


64570 12-Aug-2000 joe

Correct spelling: depricated -> deprecated.


64568 12-Aug-2000 joe

A change to the way that colours are switched on in ls. The -G
flag has been depricated, although it still works with a warning
message, and replaced with an environment variable CLICOLOR (command
line interface colour). This could be used by other tools that
want to be able to control colour output.

In addition if the environment variable CLICOLOR_FORCE is defined
colour sequences are output irrespective of whether the output is
directed to a terminal (as long as TERM references a colour capable
terminal of course ;)

PR: bin/20291 and bin/20483


64567 12-Aug-2000 gshapiro

The rest of the changes needed to support the new version of sendmail (8.11.0).
Beyond changes to the build system, this includes fixing up the sample
freebsd.mc configuration for changes in defaults and syntax, removing
outdated documentation, and updating the release notes.


64561 12-Aug-2000 joe

".It" -> ".It Ev" in a couple of places.


64013 29-Jul-2000 peter

Optimize out no-op chmod() syscalls.


63950 28-Jul-2000 jwd

Try to clean the manpage up according to the mail from Sheldon
in committers (Message-Id: <72836.964344168@axl.ops.uunet.co.za>).

Also cleaned up a .Pq macro which was causing problems previous
to the original update I made.

Reviewed by: sheldonh
Approved by: jkh


63799 24-Jul-2000 sheldonh

Mark up the -a flag to unalias as a flag (Fl), not an argument (Ar).


63798 24-Jul-2000 sheldonh

Add missing punctuation to one line.


63761 22-Jul-2000 jwd

Expand the -r option to support hex. Though undocumented, the -r
option already supported octal. Add a comment to the -r option
in the man page so it's a bit more specific.

Discrepancy brought to my attention by: sasdrq@unx.sas.com
Approved by: jkh


63755 22-Jul-2000 se

Add overflow tests


63748 22-Jul-2000 green

Add the missing flags to ls(1)'s usage: -Bb.


63688 20-Jul-2000 green

Make the comment regarding ftruncate() correct.


63680 20-Jul-2000 sada

Don't emit a warning message if fchflags() returns EOPNOTSUPP

Requested by: FUJISHIMA Satsuki <k5@cheerful.com>
Obtained from: OpenBSD


63498 19-Jul-2000 sheldonh

Update stale references to update(4) with references to the new
syncer(4) manual page.


63417 18-Jul-2000 sheldonh

Fix one grammar problem which crept in from rev 1.40 to rev 1.42, and
one mdoc problem from rev 1.40 (unnecessarily populated Nm macro).


63359 17-Jul-2000 marko

Document the builtin echo command

Reviewed by: Matthew Hunt <mph@astro.caltech.edu>


63302 17-Jul-2000 sheldonh

Locale support was added by ache long ago.


63225 15-Jul-2000 sada

To make inherit file flags when mv(1) moves file between directories
on different file systems.

PR: bin/12375
Submitted by: Takashi SHIRAI <shirai@nintendo.co.jp>
No response by: steve
No problem with: building 5-current world


63224 15-Jul-2000 marko

Re-worded the description of the -r option

PR: 18792
Submitted by: Bob Johnson <bobj@atlantic.net>
Approved by: Alexander Langer <alex@freebsd.org>


63223 15-Jul-2000 sada

Fixd with alias missing.

PR: bin/19475
Approved by: Martin Cracauer <cracauer@cons.org> (with conditions)


63155 14-Jul-2000 alex

Now, the mdoc fixes, such as:
* remove hard sentence breaks
* use of Fl with Ar if argument available
* Dq -> Sq where better
* Ql -> Dq and Ql -> Fa where better
* include sections to Xr macro
* It Ar .ss -> It Ar ss


63153 14-Jul-2000 alex

As per request by sheldonh and others on IRC, seperate language and mdoc
fixes (very important in this case). Version 1.40 should be discarded.

This version includes the language diffs. To receive them, use
cvs diff [-u] -r 1.39 -r 1.41


63150 14-Jul-2000 alex

Fix several language, style and mdoc improvements (such as correct
usage of .Xr and removal of hard sentence breaks).

PR: 18880
Submitted by: Christian Weisgerber <naddy@unix-ag.uni-kl.de>
Obtained from: OpenBSD (in parts)


62963 11-Jul-2000 dwmalone

Use lstat(2) instead of stat(2) when deciding if we should fastcopy
a file. This fixes moving symlinks across partitions.

PR: 17847
Reviewed by: bde


62926 10-Jul-2000 se

Extend numeric operations to support 64 bit numbers.


62925 10-Jul-2000 se

Add support for 64bit integer comparisons.


62887 10-Jul-2000 kris

Don't call warn() with no format string. This is potentially exploitable, although it
would be difficult both technically and in practise.


62813 08-Jul-2000 peter

Initial kenv(1) hack for dumping the kernel environment. This can be
used to extract modified boot hints to make loader(8)-time changes
"sticky". It tries to use \ style quoting so that it can be used directly
with foo.conf files. It can also extract specific variables.


62803 08-Jul-2000 will

Fix the exit code for the case where nentries == 0; if a PID doesn't exist,
ps(1) should not be returning a success code (0), it should return an
error code (1). This was fixed on OpenBSD over 3 years ago.

PR: 19069
Submitted by: Jim Sloan <odinn@atlantabiker.net>
Reviewed by: rwatson


62779 07-Jul-2000 sheldonh

Explain the dependence of colour support on the capabilities of the
terminal emulator.

As pointed out by jhb, a more scalable solution would be preferable
when multiple applications in the base system begin linking against
libh.

Submitted by: Doug Barton <DougB@gorean.org>


62759 07-Jul-2000 ache

restore tabs lost from prev commit

Asked-by: bde


62692 06-Jul-2000 ache

curses -> termcap, mainly for purity and to indicate which functions family
really used


62597 04-Jul-2000 assar

make sure we do not write out non-printable characters in file names
and symbolic links (by default)

PR: bin/19354
Reviewed by: silence on -current


62311 01-Jul-2000 green

Various cleanups are made to reduce warnings and make code prettier :)
Also, check for ftruncate() return value and die on failure, but only
try to ftruncate() when the file is a regular file.


62213 28-Jun-2000 nbm

Fix the rmdir -p a/b/c/ case, where rmdir -p a/b/c works, and rmdir c/
works.

PR: PR 6521
Submitted by: Rudolf Cejka <xcejka00@dcse.fee.vutbr.cz>
Reviewed by: eivind (in brief retrograde)


62208 28-Jun-2000 mpp

Grumble. The previous commit still had the wrong date in the
example. Oct 29 0:30 +3 hours is still Oct 29, no matter what the
DST setting is, and not Oct 30..


62207 28-Jun-2000 mpp

Typo fix.

PR: docs/19554
Submitted by: Kazuo Horikawa <horikawa@psinet.com>


62167 27-Jun-2000 sheldonh

Use Dq Li (double-quoted literal) instead of Ic (internal command) to
mark up a sample invocation, since it is not a command internal to the
described utility.

Do not use Ar (argument) to mark up something which is not an argument
to the utility or one of its internal commands.


62137 26-Jun-2000 mph

Add \a and \e to "echo -e" escape handling.


61960 22-Jun-2000 ache

Use %Ef


61952 22-Jun-2000 sheldonh

Fix changes from 1.34 through 1.37:

Remove newly added hard sentence breaks.
Mark ANSI up as a type name (Tn).
Avoid parenthesized sentences and paragraphs.


61949 22-Jun-2000 brian

Mention the timezone where appropriate (for the -v option).
correct one of the -v options.


61921 21-Jun-2000 joe

Order the ENVIRONMENT section alphabetically.


61920 21-Jun-2000 joe

I broke locale sensitive ordering of date and month in
the long -l output format with the last commit. Fix it
by replacing the "%b %e" strftime format with "%Ef".

Make a note in the manual page that the LANG environment
variable affects the running of ls.

Reviewed by: ache


61814 18-Jun-2000 joe

Don't assume that the output of strftime for "%c" ("national
representation of time and date") won't change in time. Instead
of hard coding the locations of the time elements and hoping that
they don't move use strftime to generate the desired formats in
the first place.

PR: bin/7826


61749 17-Jun-2000 joe

Switch over to using the new fflagstostr and strtofflags library calls.


61535 11-Jun-2000 ache

Activate Japanese NLS and KANJI support


61338 06-Jun-2000 ache

Fix one conditionalization in my prev. commit


61337 06-Jun-2000 ache

Greately simplify oxtabs fix by simple setting f_notabs for f_color


61336 06-Jun-2000 ache

Honor f_notabs flag even in COLORLS


61334 06-Jun-2000 ache

Back out spaces to TABs replace removing for COLORLS
Rewrite corresponding comment to say what happens in reality with oxtabs
and current terminal column.


61325 06-Jun-2000 ache

Don't replace TABs with spaces for COLORLS because "some terminals get confused"
as comment says. I know no terminal confused by this. If even such terminal
exists, it must be termcap flag for this, not hardcoded in ls.


61324 06-Jun-2000 ache

Add -G to usage: if COLORLS


61323 06-Jun-2000 ache

Staticize more functions


61322 06-Jun-2000 ache

Move colorquit() prototype to extern.h
Add "extern" to variables declarations in extern.h to not make them
commons into each compiled file.


61321 06-Jun-2000 ache

Make signal handler safe - don't use stdio (pointed by bde)
Staticize some color functions
Add yet one tolower() call which is forgotten after check
Don't check for OOPS - not really needed


61316 06-Jun-2000 ache

Reflect reality:
yellow -> brown
white -> light grey


61296 05-Jun-2000 ache

Get rid of curses completely - use tgoto instead of tparm


61295 05-Jun-2000 cracauer

Do SIGINT cleanup for SIGQUIT as well.


61294 05-Jun-2000 ache

Kill yourself in ^C handler, not exit(1) to allow script to sense signal


61292 05-Jun-2000 ache

Cosmetique of prev. optimization - don't use global variable


61291 05-Jun-2000 ache

Don't use curses includes, include termcap.h instead
Don't use curses functions, use tputs instead
Add ^C reaction - reset colors
Optimization - don't turn off colors after EACH file printed.
Fix wrong ctype macro arg type in LSCOLORS parsing


61289 05-Jun-2000 ache

Don't use curses includes, include termcap.h instead
Add ^C reaction set


61288 05-Jun-2000 ache

Don't use ncurses, use termcap
Add DPADD


61271 05-Jun-2000 joe

Don't look up the ANSI sequences each time a colour is changed,
this is extremely inefficient, instead write them all down at the
beginning.

The correct sequence to switch colours off is to first use 'op' if
it exists, otherwise use 'oc'. If neither of these exist then we
shouldn't be doing colour with this terminal.

Reviewed by: ache


61269 05-Jun-2000 joe

Disable colour support in ls when building the fixit floppy, and make
a note of it in the release Makefile.


61268 05-Jun-2000 joe

* Re-implement colour support using termcap's AF and AB capabilities
to manage the ANSI colour sequences. Colour support is disabled
unless the TERM environment variable references a valid termcap.

* Allow optional compilation of the colour support in the Makefile,
defaulting to yes. This allows us to switch it off for fixit
floppies and other mediums where space is an issue and the extra
bloat of statically linking with ncurses isn't acceptable.

* Display a warning if colour is requested with '-G' but support
for it isn't compiled in.


61227 03-Jun-2000 jwd

Add -g for gigabyte sizes.

Approved by: jkh


61178 02-Jun-2000 joe

Add colour support to /bin/ls (at a cost of 1056 bytes on my system).

It is not switched on by default and must be enabled with the -G
flag. When using ls -G the output behaviour is modified with ANSI
colour sequences wrapped around filenames to help distinguish file
types. (Colours can be redefined in the LSCOLORS environment
variable as described in the manual page.)

Colour support is silently disabled (if switched on) if stdout
isn't a tty.

Based on: asami's colorls port.
PR: bin/18900 && ports/18616.


60859 24-May-2000 obrien

Fix ``dd if=/dev/zero of=/dev/daN'' on the Alpha by allowing the label
to be overwritten.

Submitted by: green


60836 23-May-2000 brian

Propogate the ``call mktime'' flag from adjwday() down to adjday().

Submitted by: Christian Weisgerber <naddy@mips.inka.de>


60718 19-May-2000 dbaker

Correct confusion and differentiate appropriately between GMT and UTC when
date is launched with the "u" argument. It now operates in the documented
manner.

Fix typo in date man page.

Submitted by: David McNett <nugget@slacker.com>


60611 15-May-2000 obrien

In its current state, this file is no longer needed.


60599 15-May-2000 bde

Don't forget to clean csh.1.

Fixed some style bugs.


60593 15-May-2000 cracauer

Fix parsing of string for eval command.

PR: 18447
Submitted by: Koji Mori <mori@tri.asanuma.co.jp>


60592 15-May-2000 cracauer

Fix environment passung to eval'ed commands.

PR: bin/6577
Submitted by: Anatoly Vorobey <mellon@pobox.com>
Approved by: silence amoung other sh experts


60311 10-May-2000 sheldonh

Supply only one author name per instance of %A, as per mdoc.samples(7).

PR: 18465
Submitted by: Kazu TAKAMUNE <takamune@avrl.mei.co.jp>


60258 09-May-2000 sheldonh

Fix miscellaneous mdoc macro argument limit infringements.

PR: 18465
Reported by: Kazu TAKAMUNE <takamune@avrl.mei.co.jp>


60126 07-May-2000 kris

Remove test for block device.


60029 05-May-2000 jkoshy

Install a manual page for `tcsh(1)', for completeness.

Approved by: obrien


59863 01-May-2000 asmodai

Remove unused #include.


59797 30-Apr-2000 joe

Fixes a potential buffer overflow with 'ed [MAXPATHLEN + 1 characters]'.

Submitted by: Mike Heffner <spock@techfour.net>
Submitted on: audit@freebsd.org


59790 30-Apr-2000 ache

Fix warn format

Pointed-by: bde


59788 30-Apr-2000 ache

Back out all drainwait changes. It is enough controllable via sysctl or
comcontrol, having it in stty cause too many problems with existing drivers
and tty access permissings of non-superuser.

Asked-by: bde


59787 30-Apr-2000 ache

gfmt: set drainwait only if changed
It allows to restore tty state without a warning for non-superuser


59718 27-Apr-2000 ache

Describe drainwait


59716 27-Apr-2000 ache

part of gfmt really changed commit


59715 27-Apr-2000 ache

gfmt: set 'changed' flags only if something really changed.


59714 27-Apr-2000 ache

Add ability to manipulate with drain wait time


59581 24-Apr-2000 ache

Activate ja nls if WANT_KANJI
Fix 'make release'
Suppress 'make distribute'


59576 23-Apr-2000 obrien

Pass "WANT_KANJI" from make.conf to the compiler.


59575 23-Apr-2000 obrien

MBYTEDEBUG not needed for "WANT_KANJI"

Submitted by: Hajimu UMEMOTO <ume@mahoroba.org>


59471 21-Apr-2000 obrien

Until it's impact is better understood, only active KANJI/DSPMBYTE/MBYTEDEBUG
if "WANT_KANJI" is defined in /etc/make.conf.

Submitted by: Hajimu UMEMOTO <ume@mahoroba.org>


59462 21-Apr-2000 ache

Fix 'make distribute'


59461 21-Apr-2000 ache

Disable ja NLS until clarifying what needed else to support it


59438 20-Apr-2000 cracauer

Rename the trace() function (that is build only in the -DDEBUG=2
case), so that it doesn't clash with the ncurses function of the same
name when linking statically with -ltermcap.

The linker only complains when -static is used, and it is not clear
whether this is a bug.

PR: bin/18104
Submitted by: Anatoly Vorobey <mellon@pobox.com>


59437 20-Apr-2000 cracauer

Include <errno.h> when compiling with -DDEBUG=2

PR: bin/18104
Submitted by: mellon@pobox.com


59436 20-Apr-2000 cracauer

Fix warnings, some of them serious because sh violated name
spaces reserved by the header files it includes.

mkinit.c still produces C code with redundant declarations, although
they are more harmless since they automatically derived from the right
places.


59432 20-Apr-2000 ache

Activate NLS.
Optimize NLS by not wasting space copying the same .cat but use symbolic links
instead.


59425 20-Apr-2000 ache

Activate finnish set


59424 20-Apr-2000 obrien

Add NLS files. Finish and Greek are WIPs.

Submitted by: ache


59394 19-Apr-2000 obrien

Use our system malloc().


59393 19-Apr-2000 obrien

Install /bin/tcsh also.


59355 18-Apr-2000 obrien

Upgrade csh.


59337 17-Apr-2000 obrien

Add a NO_TCSH knob.


59239 14-Apr-2000 asmodai

Sync us up to OpenBSD's cat.1 v1.18 and cat.c v1.9.

This gets rid of a bogus cast of NULL in setbuf().
Lets us know the buffer malloc failed.

Reworks the manpage a bit to make it more mdoc(7) compliant, adds
examples.


59214 14-Apr-2000 imp

Use #include <errno.h> rather than extern int errno;.


59211 13-Apr-2000 asmodai

Remove unnecessary empty line.
Remove trailing whitespace.


59175 12-Apr-2000 brian

Change -v so that variences in units of days or less are sensitive to
DST. Explain in more detail what date -v does when mixed with DST.

Previous code suggested broken by: wollman


59022 05-Apr-2000 brian

Always give mktime a timeval with tm_isdst set to -1, otherwise
things get a bit out-of-phase when we step backwards 1 hour from
between 0:00 and 1:00 on the first of the month following the
transition into Summer time. This is probably actually a bug
in mktime().

PR: 10963

If mktime() fails and 68 < year < 138, assume that the reason is
because of Summer time and adjust up or down according to our
adjusting context by one hour. This assumes that all DSTs are
multiples of 1 hour.

PR: 6223, 17750


59009 04-Apr-2000 bde

Fixed prototype for setflags(). setflags() returns int, not u_long,
and "extern" in function prototypes is a style bug. The type mismatch
broke chflags(1) on i386's with 64-bit longs and may have broken it on
alphas.


58987 03-Apr-2000 jdp

Document that the flags can be specified as an octal number.


58669 27-Mar-2000 bde

Fixed LDADD. Using ${LIBM} instead of -lm gave the wrong libm in most
cases and broke the world in some cases.

Fixed some style bugs (the usual ones for DPADD and LDADD, misplacement
of DPADD and LDADD, and misplacement of $FreeBSD$).


57803 07-Mar-2000 sheldonh

Correct confusing description of the -r option.

PR: 17250
Submitted by: cjclark@home.com (Crist J. Clark)


57717 03-Mar-2000 sheldonh

Revert the previous commit. I knew I should leave non-mdoc stuff alone.


57695 02-Mar-2000 sheldonh

Remove more single-space hard sentence breaks.


57669 01-Mar-2000 sheldonh

Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.


57663 01-Mar-2000 sheldonh

Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.


57639 01-Mar-2000 green

After Bruce kindly explained the whole groff "sentence" idea to me, I've
put the whitespace in the right place.


57622 29-Feb-2000 markm

Change DISTRIBUTION name to match reality.


57534 27-Feb-2000 green

Fix style bugs I introduced in the last revision.

Brucified by: bde


57523 26-Feb-2000 green

Add iseek= and oseek= aliases for the preexisting skip= and seek=
operands. Can _YOU_ tell skip= and seek= apart with 100% accuracy
every time?

This also seems to make us option-for-option compatible with the
Solaris dd(1).

Approved by: jkh
Suggested by: peter


57454 24-Feb-2000 markm

Use libcrypto inst=ead if libdes.


57326 18-Feb-2000 alfred

Re-add "May" to the list of dates supported.

Approved by: jkh


57308 18-Feb-2000 gsutter

Reflect that dd accepts octal and hexadecimal numbers (in addition to decimal).

PR: 16750
Submitted by: Giorgos Keramidas <keramida@ceid.upatras.gr>


57279 17-Feb-2000 unfurl

From the PR:

The description of -X option in csh(1) manpage uses a wording
that references the descriptions of -x, -v and -V. This might
be a little confusing. Changed this to a complete description
that does not reference other paragraphs.

PR: 16762
Submitted: Giorgos Keramidas <keramida@ceid.upatras.gr>


57276 17-Feb-2000 unfurl

From the PR:

The first paragraph of "Argument list processing" says that an
argument of - will make csh be a login shell. However, running
csh with only a - as an argument fails with the error message.

csh(1) corrected to reflect this.

PR: 16754
Submitted by: Giorgos Keramidas <keramida@ceid.upatras.gr>


57274 17-Feb-2000 unfurl

From the PR:

Three minor changes to the manpage of chmod(1).

1. At the description of -H option, I added that symlinks are
not followed _by default_ to show that links can be followed,
but the default chmod behavior is not to do so.

2. Moved a misplaced .Va file command up to the place it belongs.

3. Simplified the grammar that describes symbolic modes.

PR: 16749
Submitted by: Giorgos Keramidas <keramida@ceid.upatras.gr>


57225 15-Feb-2000 cracauer

Fix ${#varname} (getting length of string) when in double-quotes.

Approved-by: jkh

PR: bin/12137
Submitted by: "Danny J. Zerkel" <dzerkel@columbus.rr.com>


57003 05-Feb-2000 joe

Revert part of the last commit, remove {g|s}etflags from the libc
interface, and statically link them to the programs using them.
These functions, upon reflection and discussion, are too generically
named for a library interface with such specific functionality.
Also the api that they use, whilst ok for private use, isn't good
enough for a libc function.

Additionally there were complications with the build/install-world
process. It depends heavily upon xinstall, which got broken by
the change in api, and caused bootstrap problems and general mayhem.

There is work in progress to address future problems that may be
caused by changes in install-chain tools, and better names for
{g|s}etflags can be derived when some future program requires them.
For now the code has been left in src/lib/libc/gen (it started off
in src/bin/ls).

It's important to provide library functions for manipulating file
flag strings if we ever want this interface to be adopted outside
of the source tree, but now isn't necessarily the right moment
with 4.0-release just around the corner.

Approved: jkh


56853 29-Jan-2000 peter

Don't report the tablet line discipline, it "doesn't happen (TM)"


56692 27-Jan-2000 joe

Historically file flags (schg, uschg, etc) have been converted from
string to u_long and back using two functions, flags_to_string and
string_to_flags, which co-existed with 'ls'. As time has progressed
more and more other tools have used these private functions to
manipulate the file flags.

Recently I moved these functions from /usr/src/bin/ls to libutil,
but after some discussion with bde it's been decided that they
really ought to go in libc.

There are two already existing libc functions for manipulating file
modes: setmode and getmode. In keeping with these flags_to_string
has been renamed getflags and string_to_flags to setflags.

The manual page could probably be improved upon ;)


56420 23-Jan-2000 mharo

fix cp -vi bug

Submitted by: Dan Papasian (bugg_ on irc)


55829 12-Jan-2000 brian

Fix various mandoc bugs


55762 10-Jan-2000 phantom

Add `.Nm red' to NAME section.


55562 07-Jan-2000 phantom

. mdoc(7)'fy
. add Xrs to hosts.equiv(5), auth.conf(5), services(5) to some pages
. sort Xrs in SEE ALSO sections

Patches based on PR: docs/15680
Submitted by: Christian Weisgerber <naddy@mips.rhein-neckar.de>


55514 06-Jan-2000 bde

Print negative minor numbers in hex. Negative minor numbers are
essentially large unsigned ones, and we already print minor
numbers > 255 in hex.


55476 05-Jan-2000 bde

Actually remove unrequired SRCS.


55302 01-Jan-2000 joe

Added missing DPADD's. Removed unrequired SRCS's.

Obtained from: bde


55301 01-Jan-2000 joe

Removed bogus dependancy on libutil.

Noticed by: bde


55271 30-Dec-1999 joe

Retire stat_flags.c; it's now in libutil.


55270 30-Dec-1999 joe

Moved flags_to_string and string_to_flags into libutil. It's used in
many places nowadays.


55225 29-Dec-1999 sheldonh

Back out previous commit and replace with a cleaner solution adapted
from the source attributed below. In particular, this removes a goto
inside a switch and replaces those horrendous ATOI macros with
something acceptable.

More clean-ups to come.

PR: bin/14151
Reported by: Christian Weisgerber <naddy@mips.rhein-neckar.de>
Obtained from: NetBSD


55179 28-Dec-1999 sheldonh

Take into account the fact that "[" may be called with a path,
for example "/bin/[".

Reported by: Vlad Skvortsov <vss@ulstu.ru>
Reported by: Peter Jeremy <peter.jeremy@alcatel.com.au>
Message-Id: 99Dec27.111307est.40321@border.alcanet.com.au


54982 22-Dec-1999 jhb

Mention the hostname variable in /etc/rc.conf since that is the most
common way of setting the hostname. The man page already mentioned that
the hostname is set by /etc/rc.network, so this just explains where
/etc/rc.network gets the hostname from.

PR: docs/14319
Submitted by: rwatson
Reviewed by: cmc


54948 21-Dec-1999 roberto

Fix a bug where a pointer would be one character too far after putting
a '\0' at the end of a string.

Submitted by: Martin Birgmeier <Martin.Birgmeier@aon.at>


54943 21-Dec-1999 sheldonh

Fix cut'n'paste niggles in previous commit.


54895 20-Dec-1999 sheldonh

Add link(1) and unlink(1) as special cases of ln(1) and rm(1)
respectively, in accordance with SUSv2.

This differs from the approach taken in NetBSD, but provides
less obscure error messages in at least the EISDIR case and
does not take up additional disk space for new binaries.

PR: 13071
PR: 13074
Requested by: James Howard <howardjp@wam.umd.edu>


54884 20-Dec-1999 cracauer

Fix command hash handling on
PATH=... command

Noted by and fix works for Marcel Moolenaar <marcel@scc.nl>


54827 19-Dec-1999 roberto

Rewriting of flags_to_string() and string_to_flags() to use an array.

PR: bin/3648
Submitted by: Martin Birgmeier <mbirg@austria.ds.philips.com>


54679 16-Dec-1999 cracauer

Second part of 8-bit fixes.


54643 15-Dec-1999 cracauer

Document ulimit -b for RLIMIT_SBSIZE.


54631 15-Dec-1999 cracauer

First round of 8-bit fixes.


54621 15-Dec-1999 mharo

add human readable output (-h and -H)

Obtained from: parts of human readable code from OpenBSD
Reviewed by: obrien

add POSIX, byte and megabyte block size ouput flags

PR: 13579 (POSIX flag)
Submitted by: Mike Meyer <mwm@phone.net>


54278 08-Dec-1999 green

I've been Brucified! I did evil things with typedefs, but I'll do it
the correct (but less aesthetic) way, now. New lesson: correctness
and aestheticity may be mutually exclusive at times.

Brucified by: bde


54245 07-Dec-1999 green

Do proper constification in args.c. This shuts up -Wcast-qual (thanks,
bfumerola for that pointer!) in GCC complaining about losing a const.

While I'm here, might as well mark in the Makefile that I'm the
${MAINTAINER}. It seems like that's what everyone's doing these days.


54145 05-Dec-1999 cracauer

make '|' character visible.

PR: docs/15265
Submitted by: takamune@avrl.mei.co.jp


54132 04-Dec-1999 cracauer

Fix "subscript has type `char'" warnings by casting to int, as
discussed on -arch.


53891 29-Nov-1999 cracauer

Include strerror(errno) in error messages after failed system calls.
Fix a warning.


53824 28-Nov-1999 obrien

Default to not -v.
Fix usage() style bug spotted by BDE.


53819 28-Nov-1999 mharo

brucify

Reviewed by: obrien


53780 27-Nov-1999 obrien

Add "-v".


53507 21-Nov-1999 charnier

Correct use of .Nm. Add DIAGNOSTICS section. Add rcsid


53349 18-Nov-1999 sheldonh

Follow-up on mdoc fixes in rev 1.35; this includes things that I missed
in that revision as well as things I broke in that revision. A note-
worthy instance of the latter case was the inversion of -E and -V in the
subsection on Commandline Editing.


53282 17-Nov-1999 cracauer

The pipleline problem introduced in version 1.22 wasn't fully fixed in
1.23. This revision should work for long pipes both in
here-documents/backquote and in normal cases.

Fix works for jmz, bde.


53278 17-Nov-1999 peter

I'm probably jumping the gun, but what the heck, this is -current.
Turn off setgid-kmem for /bin/ps, it's now quite functional without it.
ps no longer needs /dev/*mem or /proc. (It will still use some /proc
files if they are available for -e, but it's not required, so it'll
happily run in a jail or chroot).

The proc stats are now part of eproc (obtained via sysctl) and no longer
needs to beat up the u-page reading code and the problems with that.

This also has the side effect of disabling 'ps -e' for normal users
*EXCEPT* when looking at their own processes. ie: they can see
environments in processes with their uid, enforced by the ownership of
/proc/*/mem. Root can still see them all, as it can open all /proc/*/mem.


53276 17-Nov-1999 peter

Use eproc.e_stats, not a series of crude hacks to fetch it from the u-area.
Also, fix some indentation that got messed up somehow..


53239 16-Nov-1999 phk

Introduce commandline caching in the kernel.

This fixes some nasty procfs problems for SMP, makes ps(1) run much faster,
and makes ps(1) even less dependent on /proc which will aid chroot and
jails alike.

To disable this facility and revert to previous behaviour:
sysctl -w kern.ps_arg_cache_limit=0

For full details see the current@FreeBSD.org mail-archives.


53170 15-Nov-1999 kris

Typo (appropiate -> appropriate)

Obtained from: OpenBSD (inspired by)


53082 10-Nov-1999 sheldonh

Allow the year to be specified with an optional century.

PR: 14472
Reported by: j_guojun@lbl.gov (Jin Guojun)


53081 10-Nov-1999 sheldonh

Don't call bash(1) a Korn shell clone. Instead, use pdksh(1) as an
example of such a clone.

PR: 14601
Submitted by: Matthias Buelow <mkb@altair.mayn.de>


52972 07-Nov-1999 steve

Correct logic from previous commit - middle processes in long pipes
don't have their stdin closed indisciminantly.

Reviewed by: markm


52900 05-Nov-1999 cracauer

When a backquote command inside a here-document had a pipe with more
than two processes (got that? :-), the stdin fd of the middle
processes that has just been set up was accidetially closed. Don't do
this.

PR: bin/14527


52735 01-Nov-1999 julian

Most modern OSs have the ability to flag certain mounts as ones to
be ignored by default by the df(1) program. This is used mostly to
avoid stat()-ing entries that do not represent "real" disk mount
points (such as those made by an automounter such as amd.) It is
also useful not to have to stat() these entries because it takes
longer to report them that for other file systems, being that these
mount points are served by a user-level file server and resulting in
several context switches. Worse, if the automounter is down
unexpectedly, a causal df(1) will hang in an interruptible way.

PR: kern/9764
Submitted by: Erez Zadok <ezk@cs.columbia.edu>


52604 28-Oct-1999 ru

Restore reference to sleep(3).


52526 26-Oct-1999 cracauer

Fix ';' command when used with -e flag.

PR: bin/14509


52319 16-Oct-1999 obrien

Add `n' to the synopsis.

Forgotten by: sheldonh


52072 09-Oct-1999 green

Implement ulimit -b for RLIMIT_SBSIZE.


52071 09-Oct-1999 green

This implements the RLIMIT_SBSIZE ("sbsize") administrative limits for
userland. Currently, it can be enforced by login and csh. More
shells supporting sbsize are welcome.


51985 07-Oct-1999 sheldonh

Mdoc cleanup, with a few grammar cleanups on the side.

Reviewed by: mpp


51913 03-Oct-1999 green

Nuke the FIODTYPE compatibility bits. It's time.


51835 01-Oct-1999 ru

Let sleep(1) handle fractions of a second (up to nanosecond).

This is a conservative change. It does the same thing in weird
cases like the old one. For example, 'sleep abcd' still sleeps
for zero seconds. `sleep 10.a' and `sleep 10.05aa' do the best
and not abort (ie: 10.a == 10 seconds, 10.05a == 10.05 seconds).


51434 19-Sep-1999 markm

Fix for new Kerberos4.


51335 16-Sep-1999 green

Make count=0 set cpy_cnt to -1, which is slight overloading, but makes
what I was trying to do work much better (ie at all. I could have sworn
it was working...) Fix a SEEK_SET to be SEEK_CUR, and make Bruce's
lseek() test work correctly.


51326 16-Sep-1999 green

Let count=-something fail, while count=0 may succeed, thus making dd(1)
useful as a seeking-tool as well as its many other uses. Previously,
dd(1) would succeed with count=0, but wouldn't get to the point that
blocks were to be read/written. This is a more useful behavior, and
this specific case doesn't seem to be handled by POSIX.


51275 14-Sep-1999 sheldonh

Correct some hard sentence breaks. Only those surrounding the previous
commit and those which cause ugly nroff output have been fixed, since
the purpose of the style guideline which they contravene is to reduce
the sizes of deltas.

Reported by: bde


51249 13-Sep-1999 green

Even more dd(1) cleanups! Thanks to Bruce for staying on my case until
we're done (not yet!) :)


51248 13-Sep-1999 phantom

Fix SEE ALSO section:
. add printenv(1)
. correct reference to "CSH introduction"

Reviewed by: mpp


51230 13-Sep-1999 bde

Fixed longstanding breakage of rm of deep directories in rev.1.2.
rm must not use FTS_NOCHDIR, since chdir'ing is required for removing
deep directory trees and the ability to remove such trees is required
by POSIX.2 and POLA. The breakage didn't make much difference until
recently, since fts(3) didn't work in deep directory trees. It isn't
clear whether using FTS_NOCHDIR ever fixed anything (Net/2's rm.c is
similar to Lite1's). Perhaps it was actually to limit the damage
caused by the fts bug.


51212 12-Sep-1999 green

ISDISK -> ISSEEK

Allow a device type of D_DISK or D_MEM to be ISSEEK.


51208 12-Sep-1999 green

Even more cleanups to dd(1). This is probably the culmination of the
BDEification process of dd(1). Most of the changes are from BDE's archive.
Support for negative offsets is gone again, but the case where you
lseek() onto byte -1 of something from a negative offset using seek/skip
is fixed; if you end up on -1, you won't get a false positive lseek failure.
The biggest changes are to data types (more size_t, for instance) and
argument parsing. skip/seek on /dev/{,k}mem now occurs (instead of "read
until you reach the offset") due to mem devices now being D_DISK. Some
const things are now correctly declared as such, and the "case table"
building is better. The only thing that seems to be left to make dd(1)
everything TOG wants it to be is l10n.


51148 11-Sep-1999 obrien

Add verbose processing flag.


51137 11-Sep-1999 green

Make a bit more headway with dd's argument parsing, etc. get_bsz() is
renamed get_num() since it's not just about block sizes. skip and
seek can be any offset, including negative, now. Some style bogons are fixed.


51090 08-Sep-1999 sheldonh

Improve shell documentation:

* Consistently misspell built-in as builtin.

* Add a builtin(1) manpage and create builtin(1) MLINKS for all shell
builtin commands for which no standalone utility exists. These MLINKS
replace those that were created for csh(1).

* Add appropriate xrefs for builtin(1) to the csh(1) and sh(1) manpages,
as well as to the manpages of standalone utilities which are supported
as shell builtin commands in at least one of the shells. In such
manpages, explain that similar functionality may be provided as a
shell builtin command.

* Improve sh(1)'s description of the cd builtin command. Csh(1) already
describes it adequately. Replace the cd(1) manpage with a builtin(1)
MLINKS link.

* Clean up some mdoc problems: use Xr instead of literal "foo(n)"; use
Ic instead of Xr for shell builtin commands.

* Undo English contractions.

Reviewed by: mpp, rgrimes


50872 04-Sep-1999 mharo

brucify, `v' before `W', mention -v is non-standard in manpage and
make code slightly easier to read

Reviewed by: obrien


50871 04-Sep-1999 mharo

mention that -v is non-standard

Reviewed-by: obrien


50870 04-Sep-1999 mharo

brucify and add comment about -v being non-standard to manpage

Reviewed by: obrien


50698 31-Aug-1999 sheldonh

Revert to using .Xr for builtins. The cross-references don't work now,
but that doesn't mean that they will never work.

Requested by: mpp, rgrimes


50648 30-Aug-1999 sheldonh

Clean-up:

Fix grammar and spelling nits.
Use .Dq and .Qq where appropriate.
Divorce trailing punctuation from quoted elements.
Use .Dq instead of .Xr for builtins.
Remove trailing whitespace and blank lines.

PR: 13340


50613 30-Aug-1999 bde

Yet another previously forgotten merge from Lite2. (Describe
`opaque', fix reversed description of `nodump', and don't use
`nodump' as an example of adding a `no' prefix since the double
negative would be confusing (it's still confusing -- the implicitly
documented `nonodump' flag doesn't exist).)


50593 29-Aug-1999 mharo

fix rm -r

Submitted by: John Hay -- John.Hay@mikom.csir.co.za


50544 29-Aug-1999 mharo

add verbose flag


50543 29-Aug-1999 mharo

brucify and move printf() to catch cases of special files


50539 29-Aug-1999 mharo

add verbose flag
exit(1) --> exit(EX_USAGE)

Reviewed by: obrien


50529 28-Aug-1999 mpp

Fix typo in previous commit that documented the -v option.


50528 28-Aug-1999 mharo

add verbose flag

Reviewed by: obrien


50487 28-Aug-1999 green

Relax things a bit. Not having FIODTYPE will be a warning for now.

Pointy hat: green
Pointed out by: peter


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


50471 27-Aug-1999 peter

$Id$ -> $FreeBSD$


50460 27-Aug-1999 green

Use FIODTYPE to unbogosify much of the file type checking in dd.


50412 26-Aug-1999 sheldonh

Don't suggest sysctl(8) as a means for discovering what filesystem types
are available; suggest lsvfs(1) instead.

Reported by: Neil Blakey-Milner <nbm@rucus.ru.ac.za>


50394 26-Aug-1999 tg

Make the behaviour of `read -e', ie. treating backslashes as special,
the default. Add -r option for the read builtin to reverse this.

PR: 13274
Reviewed by: cpiazza, hoek, sheldonh


50381 26-Aug-1999 mharo

Add a verbose mode to show what files are being copied.
Idea taken from obrien.

Reviewed by: obrien


50353 25-Aug-1999 jkh

Remove obsolete BUGS section which describes something which stopped
being relevant when we ripped out the BSD/VAX code.

Submitted by: Guy Harris <gharris@flashcom.net>


50341 25-Aug-1999 chris

Sort cross-references. Move mount(8) down the list where it belongs, in
particular.


50302 24-Aug-1999 green

Make the comments nice, short-but-sweet XXX format.

Submitted by: sheldonh


50204 23-Aug-1999 chris

Backed out my -n change to imply -l by request of sheldonh.


50200 23-Aug-1999 chris

Make -n flag compliant to the Single Unix Specification.

To quote their ls(1) specification:

-n
The same as -l, except that the owner's UID and GID numbers are
written, rather than the associated character strings.

Reviewed by: green


50189 22-Aug-1999 green

Make a comment I added a bit nicer.


50087 20-Aug-1999 green

Finally: fix test -x as completely as possible.

Reviewed by: bde
Reworked by: bde


50051 19-Aug-1999 sheldonh

Take integer rounding into account in the buffer size approximation
macro. So now it's (1 +) for the sign and (+ 1) for rounding.

Reported by: bde


50050 19-Aug-1999 sheldonh

Style issues in previous commit:

Use an upward approximation of the number of characters required
for decimal representations of uid_t, gid_t and u_quad_t, intead
of arbitrary values that may not be safe in the future.

Fix disordering.

Requested by: bde


49993 18-Aug-1999 green

The new test(1) did not use access() correctly. I don't know why, since
supposedly it's ksh-derived, and it's not broken in pdksh. I've added
a test for test running as root: if testing for -x, the file must be
mode & 0111 to get "success", rather than just existant.

Reviewed by: chris


49891 16-Aug-1999 ru

Describe proper signals behavior rather than just removing it.
Remove obsoleted reference to alarm(3).

Submitted by: bde


49884 16-Aug-1999 sheldonh

Replace our test(1) with NetBSD's pdksh-derived version. The code is
significantly easier to read and extend and offers a few new tests.
A few style changes taken from style(9) and OpenBSD, as well as
whitespace cleanups.

This change was discussed on freebsd-committers and freebsd-hackers
and met with approval from at least des, eivind and brian.

PR: 13091
Obtained from: NetBSD


49721 14-Aug-1999 chris

Bad reference of mount(1) changed to mount(8).


49707 14-Aug-1999 chris

Minor style fix - change 'if(!*v)' to 'if (!*v)'


49576 09-Aug-1999 ru

There is no special handling for SIGALRM as
sleep(3) is implemented using nanosleep(2).


49544 08-Aug-1999 chris

Document -f flag:

-f Do not display a diagnostic message if chmod could not modify the
mode for file.


49373 02-Aug-1999 sheldonh

Add -n option to print numeric user and group IDs instead of names
in a long (-l) listing.

MFC-jockies should make sure that bde's concerns regarding the number
of digits required to represent a uid_t and the use of snprintf
on the associated PR have been addressed before going wild.

PR: 12866
Reported by: Philip Kizer <pckizer@nostrum.com>
Obtained from: NetBSD


48983 22-Jul-1999 kris

Correct some style issues in my previous commit.

Submitted by: bde


48896 19-Jul-1999 sheldonh

Fix handling of the cd command inside evaluations. It was changing PWD,
which it should not do.

PR: 12578
Reported by: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
Submitted by: Niall Smart <niall@pobox.com>


48802 13-Jul-1999 green

Implement seekability for disk devices (not just regular files).
Also, fix pos_out() to do the same checks pos_in() did.

Done for: jdp, luigi, the good of the world


48725 10-Jul-1999 kris

Add -W and fix the warning due to missing struct initializer


48560 04-Jul-1999 bde

Improved error handling in rev.1.18: don't ignore failure of execve().

Fixed some style bugs in rev.1.18.


48366 30-Jun-1999 kris

Correct reference to the obsolete vadvise() to madvise() (with appropriate
arguments)

PR: 11586
Submitted by: David Gilbert <dgilbert@velocet.ca>
Reviewed by: Doug Rabson


48214 25-Jun-1999 cracauer

Don't continue if parsing failed when -f is in use. Exit with nonzero value.


48073 21-Jun-1999 kris

Undo some of the reversions from previous revisions, and attempt to
minimize diffs with {Net,Open}BSD

Hinted-More-Or-Less-By: bde


48051 20-Jun-1999 green

This is the second round of dd(1) changes. Some changes made/reversed by
request of Bruce. More changes may follow later. 'g' multiplier has
been added (i.e. dd seek=5g if=bigfile.) Some minor corrections were made
as well.

Noticed by: bde


48026 19-Jun-1999 green

Miscellaneous dd(1) changes: mainly fixing variable types (size_t, ssize_t,
off_t, int, u_int64_t, etc.). dd(1) should now work properly with REALLY
big amounts of data.


47816 07-Jun-1999 kris

Changes from OpenBSD:
* Better usage() - correct syntax, display available commands
instead of examples
* Accept command abbreviations
* sprintf -> snprintf (for paranoia)
* manpage capitalisation tweak

Obtained from: OpenBSD


47584 28-May-1999 kris

Use .Dq instead of ``'' in manpage
Use optimal blocksize for rm -P, instead of always using 8192-byte blocks
to overwrite the file.

Obtained from: OpenBSD


47442 23-May-1999 imp

getopt(3) returns -1 not EOF.


47367 21-May-1999 jmz

Chflags was clearing all flags supplied on the command line after a
clearing flag like dump or noschg, etc.

PR: bin/10071
Submitted by: Andreas Klussmann <andreas@infosys.heitec.net>


47129 14-May-1999 jmg

the month and three days are up for -hackers and the 24hrs for -committers.

add a -j flag that tells date not to try to set the date. This allows you
to use date as a userland interface to strptime.

example:
TZ=GMT date -j -f "%a, %d %b %Y %T %Z" "Sun, 08 Nov 1998 02:22:20 GMT" +%s

which is the standard format for Last-modified headers in HTTP requests.

only one to respond: eivind


47070 12-May-1999 kris

Grammatical fixes.

Obtained from: OpenBSD


46684 08-May-1999 kris

Various spelling/formatting changes.

Submitted by: Philippe Charnier <charnier@xp11.frmug.org>


46155 28-Apr-1999 phk

This Implements the mumbled about "Jail" feature.

This is a seriously beefed up chroot kind of thing. The process
is jailed along the same lines as a chroot does it, but with
additional tough restrictions imposed on what the superuser can do.

For all I know, it is safe to hand over the root bit inside a
prison to the customer living in that prison, this is what
it was developed for in fact: "real virtual servers".

Each prison has an ip number associated with it, which all IP
communications will be coerced to use and each prison has its own
hostname.

Needless to say, you need more RAM this way, but the advantage is
that each customer can run their own particular version of apache
and not stomp on the toes of their neighbors.

It generally does what one would expect, but setting up a jail
still takes a little knowledge.

A few notes:

I have no scripts for setting up a jail, don't ask me for them.

The IP number should be an alias on one of the interfaces.

mount a /proc in each jail, it will make ps more useable.

/proc/<pid>/status tells the hostname of the prison for
jailed processes.

Quotas are only sensible if you have a mountpoint per prison.

There are no privisions for stopping resource-hogging.

Some "#ifdef INET" and similar may be missing (send patches!)

If somebody wants to take it from here and develop it into
more of a "virtual machine" they should be most welcome!

Tools, comments, patches & documentation most welcome.

Have fun...

Sponsored by: http://www.rndassociates.com/
Run for almost a year by: http://www.servetheweb.com/


46125 27-Apr-1999 hoek

.Xr chflags 1 ,


46073 25-Apr-1999 imp

First set of fixes to keep egcs happy. These include {} around single
statement if blocks[*] when the else could be ambiguous, not defaulting
to int type and removal of some unused variables.

[*] This is explicitly allowed by style(9) when the single statement
spans more than one line.

Reviewed by: obrien, chuckr


46062 25-Apr-1999 bde

Reverted some more of rev.1.9 (emphasize that -H != -h).


46057 25-Apr-1999 dt

Quick fix to allow transfer files >2GB.


45993 24-Apr-1999 nik

Revert part of the previous commit. Keep the example that shows how the
"-h" flag is used, but use "chown" in the example instead of "file".

Prompted by: bde


45916 21-Apr-1999 cracauer

Next approach to make loops in interactive interruptable.

PR: bin/9173


45834 19-Apr-1999 max

Typo fix.


45683 14-Apr-1999 nik

Change description of file(1) following symlinks to the truth (namely,
by default, file(1) does not follow symlinks, the -L flag must be
specified.

PR: docs/8602
Submitted by: Kazuo Horikawa <k-horik@yk.rim.or.jp>
Reviewed by: nik


45649 13-Apr-1999 cracauer

Remove my temporary detection for PR 7059, Tor Egge fixed this bug.

PR: 7059


45644 13-Apr-1999 tegge

During variable expansion, the internal representation of the expression
might be relocated. Handle this case.
PR: 7059


45621 12-Apr-1999 cracauer

Fix typo in source-explaining comment.


45618 12-Apr-1999 cracauer

Add a guarded abort() for the problem in PR bin/7059 (no fix so far,
this is hairy).

Reformat this file to comply to style(9). It had mixed styles before.

PR: bin/7059


45514 09-Apr-1999 tegge

When a variable expansion is enclosed in double quotes, the internal
representation of the expression is quoted. Take care of this when
doing pattern matching in conjunction with trimming.

#!/bin/sh
c=d:e; echo "${c%:e}"

PR: NetBSD PR#7231
Noticed by: Havard Eidnes <Havard.Eidnes@runit.sintef.no>


45367 06-Apr-1999 peter

Update p_flags doc.


45366 06-Apr-1999 peter

Look at p_lock instead of P_NOSWAP etc as an indicator of unswappability.
(While here, put a #ifndef pgtok around the macro that gets a redefinition
warning)


45266 03-Apr-1999 cracauer

In interactive shells, break loops to the topmost level when a child
is killed by a signal.

(In non-interactive shells - that means a shellscript - the shell just
exits, this was already working)

PR: bin/9173


45263 03-Apr-1999 cracauer

Implement -a flag. A test shell script can be found at
http://www.cons.org/cracauer/download/sh-interrupt/testsuite/test_export.sh
The PR also had test cases the new version passes.

Fix typo in comment.

PR: bin/1030


45243 02-Apr-1999 cracauer

-T was missing in the synopsis line.

Submitted by: BDE


45227 01-Apr-1999 wpaul

On FreeBSD/alpha, ps(1) does not correctly report process start times
and CPU runtime because it can't access the user area via /proc/<pid>/mem.
This is because the uarea is not mapped into the process address space
at USRSTACK on the alpha like it is on the x86.

Since I'm haven't been able to wrap my brain around the VM system enough
to be able to figure out how to achieve this mapping, and since it's
questionable that such an architectural change is correct, I implemented
a workaround to allow ps(1) to read the uarea from /dev/kmem using
kvm_read() instead of from the process address space via kvm_uread().
The kludge is hidden inside #ifdef __alpha__/#endif so as not to impact
the x86. (Note that top(1) probably uses this same gimmick since it works
on FreeBSD/alpha.)

Reviewed by: dfr


45221 01-Apr-1999 cracauer

The immediate execution of traps I introduced in September 1998 (to
make /etc/rc interruptible in cases when programs hang with blocked
signals) isn't standard enough.

It is now switched off by default and a new switch -T enables it.

You should update /etc/rc to the version I'm about to commit in a few
minutes to keep it interruptible.


45202 31-Mar-1999 brian

sh doesn't support <> redirections.
PR: 7325


44598 09-Mar-1999 brian

Support seconds with -v.
PR: 6308
Submitted by: Max Euston <meuston@jmrodgers.com>


44282 25-Feb-1999 jkh

Don't emit usage() message when no arguments given to -f. This
appears to be consistent with other Unixen, like Solaris.

PR: 10240
Submitted by: jun_sun@hlla.is.tsukuba.ac.jp


44060 15-Feb-1999 fenner

Clean up some .Os macro uses: quotes are not needed, multiple arguments
don't really work if the first one isn't "FreeBSD", and "FreeBSD-Experimental"
isn't an OS name.


43920 12-Feb-1999 alex

Removed occurrences of consecutive repeated words (such as "the the").


43352 28-Jan-1999 wollman

Fix synopsis to match 1003.2. Add text describing the way in which
our implementation does not meet 1003.2 (rather than the now outdated
``is expected to comply' language).


43208 26-Jan-1999 julian

Enable Linux threads support by default.
This takes the conditionals out of the code that has been tested by
various people for a while.
ps and friends (libkvm) will need a recompile as some proc structure
changes are made.

Submitted by: "Richard Seaman, Jr." <dick@tar.com>


42617 13-Jan-1999 danny

Example "19%y" changed to "%Y" to discourage poor usage.


42612 13-Jan-1999 julian

Re-enable the options in ps(1) that were disabled with the Linux
threads support.

Submitted by: "Richard Seaman, Jr." <dick@tar.com>


41931 19-Dec-1998 julian

Reviewed by: Luoqi Chen, Jordan Hubbard
Submitted by: "Richard Seaman, Jr." <lists@tar.com>
Obtained from: linux :-)

Code to allow Linux Threads to run under FreeBSD.

By default not enabled
This code is dependent on the conditional
COMPAT_LINUX_THREADS (suggested by Garret)
This is not yet a 'real' option but will be within some number of hours.


41916 18-Dec-1998 jkoshy

Add references to test(1) and expr(1).


41915 18-Dec-1998 jkoshy

Add cross-references to test(1) and expr(1) respectively.

PR: docs/9111
Submitted by: Josh Gilliam <josh@quick.net>


41851 16-Dec-1998 peter

Cleaning out old stuff from one of my source trees:
use mkdtemp() rather than mktemp() and fix a trivial memory leak.


41844 16-Dec-1998 imp

Free memory from setmode.

Obtained from: OpenBSD


41843 16-Dec-1998 imp

Use getcwd in stead of using getwd so that we try harder to avoid
overflowing a buffer.

Obtained from: Either OpenBSD or a discussion in bugtraq.


41842 16-Dec-1998 imp

Free memory obtained from setmode.

Obtained from: OpenBSD


41585 07-Dec-1998 bde

Don't put compiler warning flags in leaf Makefiles.


41584 07-Dec-1998 bde

CFLAGS+= -Wall -Wformat for all of src/bin. All warnings except 2 minor
ones in rmail have been fixed.


41583 07-Dec-1998 bde

Fixed printf format errors.


41582 07-Dec-1998 bde

Fixed warnx format errors in printf and csh, and snprintf format errors
in sh, by using separate macros for the 1, 2 and 3-arg calls to warnx.
(The 3-arg warnx macro in sh/bltin/bltin.h used to require bogus dummy
args.)


41580 07-Dec-1998 bde

Fixed -Wall regression (broken in rev.1.12). Removed unused includes.


41579 07-Dec-1998 bde

Fixed printf format errors (new bugs in rev.1.7). Fixed a spelling error
(rev.1.7 blew away most of rev.1.2-1.6; I'm only fixing blowing away of
rev.1.4).


41568 06-Dec-1998 archie

Tweaks to allow compiling -Wall (mostly adding "const" to char rcsid[]).


41553 06-Dec-1998 obrien

Rev 1.13 fixes PR bin/8958


41539 05-Dec-1998 obrien

There is a bug in /bin/pax -s option processing. The code assumes that all
pattern matches will occur at offset zero of the source string. The bug causes
the input source string pointer to be incremented by the offset of the end of
the match, instead of it's length. The fix is to only increment the pointer by
the length of the pattern match (eo-so).

Of course, the one example in the man page shows a situation where the match
occurs at offset 0.

Submitted by: John W. DeBoskey <jwd@unx.sas.com>
Obtained from: freebsd-current@freebsd.org


41467 02-Dec-1998 billf

Fix typo. "If the an entry" --> "If an entry"

PR: docs/8140
Submitted by: Sue Blake <sue@vedanix.welearn.com.au>


41432 30-Nov-1998 billf

superceded -> superseded, which after some debate on #FreeBSD is in
fact the proper spelling.

PR: docs/8697
Submitted by: Sascha Blank <blank@fox.uni-trier.de>


41431 30-Nov-1998 billf

changable -> changeable

PR: docs/8697
Submitted by: Sascha Blank <blank@fox.uni-trier.de>


41411 29-Nov-1998 bde

Describe `bs=n' more precisely. Fixed some English errors.

Obtained from: OpenBSD


41324 25-Nov-1998 dfr

Fix formatting of %CPU value on alpha.

Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>


41280 21-Nov-1998 jkh

Indicate that the thing not found was not /bin/pwd but rather $CWD (or .).


41238 18-Nov-1998 bde

Don't use mmap() for non-regular files, since st_size is only meaningful
for regular files. This fixes recent breakage of cp'ing from /dev/zero.
/dev/zero doesn't support mmap(), but the device driver mmap routines are
not called for mapping 0 bytes, so the error was not detected. mmap()
can't even be used for cp'ing special files that support mmap(), since
there is general way to determine the file size.


41156 14-Nov-1998 wosch

Use mmap for file coping. 5-10% faster than the read system call.


40606 23-Oct-1998 msmith

Fix behaviour for 'mkdir -m 777 / /tmp/foo'. Play "guess the style bug"
with Bruce again.

Reported by: bde


40602 22-Oct-1998 msmith

Honour the spirit rather than the implementation of the previous changes;
if we are invoked with -m, use chmod() on the final directory component
in order to ensure the mode is correctly set.


40537 20-Oct-1998 msmith

Make this compile, and honour the spirit of the original design while
incorporating the intended fix. Attempt to address some of the
putative style bugs introduced. Others doubtless remain.

Embarrassed by: bde


40535 20-Oct-1998 msmith

- mkdir -m should call chmod because the high-order bits get ignored
by the kernel as a security feature of some sort.

Submitted by: Wilfredo Sanchez <wsanchez@apple.com>


40533 20-Oct-1998 msmith

- Fix off-by-one problem in tar where filenames of length 100
and dirnames of length 99 don't archive.

Submitted by: Wilfredo Sanchez <wsanchez@apple.com>
Obtained from: OpenBSD


40301 13-Oct-1998 des

Calls one or more of malloc(), warn(), err(), syslog(), execlp() or
execvp() in the child branch of a vfork(). Changed to use fork()
instead.

Some of these (mv, find, apply, xargs) might benefit greatly from
being rewritten to use vfork() properly.

PR: Loosely related to bin/8252
Approved by: jkh and bde


40300 13-Oct-1998 des

Doh. What was I smoking when I wrote this?

PR: bin/8301
Submitted by: Tetsuya Furukawa <tetsuya@secom-sis.co.jp>


40288 13-Oct-1998 jkoshy

Correct a grammatical nit and remove ambiguity about the effect of
the -p option.

PR: 8229
Submitted-by: Sheldon Hearn <axl@iafrica.com>


40101 09-Oct-1998 markm

Add JKH's auth.conf-file parser to turn Kerberos on/off in userland.


39934 04-Oct-1998 jkh

Null commit, just to test something. Please ignore.


39925 03-Oct-1998 alex

Added missing #include <string.h>


39876 01-Oct-1998 ken

Fix 'chio params' so that it actually prints out the current picker.
(This was broken when the volume tag changes went in.)

Submitted by: Josef Karthauser <joe@pavilion.net>


39227 15-Sep-1998 gibbs

Updated the ch(4) driver and chio(1) command to include volume
tag support. These changes have been tested with a Breeze Hill
Q47 DLT and a DEC DLT2500 media changer. The latter has no
volume tag support.

The chio(1) command was updated to include various flags to the
status subcommand. These flags can be used to select additional
information to be displayed (like volume tags).

A new chio(1) subcommand named 'voltag' has been added which allows
for changes to volume tags inside the media changer controller.
This could not be tested as the Q47 does not provide the functio-
nality.

Submitted by: Hans Huebner


39160 14-Sep-1998 dfr

Portability fixes when sizeof(int) != sizeof(long).


39138 13-Sep-1998 imp

Fix minor style bugs noticed by the Bruce Filter.[tm]

Bruce-Filter-By: bde


39137 13-Sep-1998 tegge

Be more consistent with handling of quote mark control character.
Don't output double-quotes inside variable expansion/arithmetic
expansion region in here-documents. When leaving the arithmetic
expansion syntax mode, adjust the dblquote flag according to
previous syntax, in order to avoid splitting of quoted variables.


39065 11-Sep-1998 imp

Silence -Wall -W -Wkitchen-sink. Use ssize_t in preference to int,
make a char * const that should have been. Use new style function
declaration for main. Mostly a Bruce Filter[tm] test commit.


39056 10-Sep-1998 cracauer

Narrow down conditions to break wait() to process traps.
Improve comments.


39053 10-Sep-1998 bde

Fixed breakage of %CPU and %MEM in the previous commit. sysctlbyname()
was called with wrong args so it always failed.

PR: 7881


39049 10-Sep-1998 cracauer

Fix an inefficiency I introduced in my last commit.
Include "expand.h" vom memalloc.c to pull function declartion into scope


38950 08-Sep-1998 cracauer

If traps are set, they are now executed even when a signal-blocking
foreground child is running. Formerly, traps were exceuted after the
next child exit.

The enables the user to put a breaking wrapper around a blocking
application:
(trap 'echo trap ; exit 1' 2; ./pestyblocker; echo -n)

The "echo -n" after the child call is needed to prevent sh from
optimizing the trap-executing shell away. I'm working on this.


38914 07-Sep-1998 cracauer

Add -S flag to test for sockets.
PR: bin/7507
Reviewed by: I tested the patch
Submitted by: Stefan `Sec` Zehl sec@42.org


38887 06-Sep-1998 tegge

Better handling of word splitting. Don't record the same region
multiple times when performing nested variable expansion, and
preserve some quoting information in order to avoid removing
apparently empty expansion result.


38886 06-Sep-1998 tegge

Don't blindly eliminate `..' and the previous pathname component.
PR: 2541
Obtained from: NetBSD


38652 30-Aug-1998 gpalmer

Split lines into one subdir per line.


38536 25-Aug-1998 cracauer

Improve bookkeeping of in_waitcmd and style fixes.
Submitted by: Bruce Evans


38535 25-Aug-1998 cracauer

Re-enable killing childs with SIGQUIT. Spotted by Bruce Evans.


38530 24-Aug-1998 cracauer

Got two volatile sig_atomic_t and int mixed up. Spotted by Gary Palmer.


38521 24-Aug-1998 cracauer

Do not exit on SIGINT in non-interactive shells, fixes PR 1206,
i.e. this makes emacs usable from system(3). Programs called from
shellscripts are now required to exit with proper signal status. That
means, they have to kill themself. Exiting with faked numerical exit
code is not sufficient.

Exit with proper signal status if script exits on signal.

Make the wait builtin interruptable, both with and without traps set.

Use volatile sig_atomic_t where (and only where) appropriate.

(Almost) fix printing of newlines on SIGINT.

Make traps setable from trap handlers. This is needed for shellscripts
that catch SIGINT for cleanup work but intend to exit on it, hance
have to kill themself from a trap handler. I.e. mkdep.

While I'm at it, make it -Wall clean. -Wall is not enabled in
Makefile, since vararg warnx() macro calls in usr.bin/printf/printf.c
are not -Wall-able.
PR: 1206
Obtained from: Basic SIGINT fix from Bruce Evans


38330 15-Aug-1998 jb

Now that alpha uses FreeBSD syscalls, all these work.


38161 07-Aug-1998 dfr

Silence some warnings when building on the alpha.


38149 06-Aug-1998 markm

Fix LIBDIR (for aout/ELF).


38093 04-Aug-1998 peter

Use sendmail-8.9.1 rmail (with our changes).


38026 02-Aug-1998 hoek

Add missing "else", without whom the prev. commit is a null change.
Fix a 2nd level indentation style bug.


38018 02-Aug-1998 bde

Fixed printf format errors (time_t is not necessarily long).


37968 30-Jul-1998 jkoshy

Document behaviour of "-" and "--" on the command line.

PR: docs/5399


37932 29-Jul-1998 hoek

Allow env. variable LS_COLWIDTHS to specify minimum column widths,
effectively overriding the dynamically-sized-column feature. This
is mostly useful for non-interactive use, where it may be necessary
to ensure that listings taken at different times have columns that
line-up correctly. I have been assured that at least one large,
well-known program will soon be taking advantage of this. :-)

PR: bin/7011
Submitted by: Joel Ray Holveck <joelh@gnu.org>


37896 27-Jul-1998 nectar

Document the printf built-in.


37895 27-Jul-1998 nectar

csh built-in printf now expands arguments. e.g.
printf '%d\n' `echo 23`
now works as expected.
PR: bin/2969
Submitted by: Gareth McCaughan <gjm11@dpmms.cam.ac.uk>


37793 21-Jul-1998 jkoshy

Fix use of -man macro, correct description of the behaviour of the `+n'
command to match whats there in the source.

PR: 7328


37456 07-Jul-1998 bde

Added a `build-tools' target for internal tools.

Removed explicit dependencies of foo.o on foo.c. These were mainly
placeholders for comments about missing dependencies of tools objects
on headers. This problem needs to be handled more generally.


37317 30-Jun-1998 phk

Pick up kernel variables/constants using sysctl rather than through /dev/mem

Use /dev/null for opening the kvm library, we don't need access to /dev/mem
anymore.

ps can now run without the setgid(kmem) bit. If it does it will not be
able to show argv/envp for another uid's processes unless you are root.


37246 28-Jun-1998 bde

Fixed printf format errors (second round with non-i386 typedefs).


37245 28-Jun-1998 bde

Fixed printf format errors.


37232 28-Jun-1998 bde

Oops, the previous log message should have read "Fixed type mismatches -
don't assume that time_t is long".


37231 28-Jun-1998 bde

Fixed printf format errors.


37230 28-Jun-1998 bde

Fixed printf format errors.


37027 17-Jun-1998 jkoshy

Remove compile time dependency on ARG_MAX.

PR: 1791 (partial)
Reviewed by: Bruce Evans <bde@freebsd.org>, Tor Egge <tegge@freebsd.org>


36838 10-Jun-1998 peter

Don't attempt to change owner/mode/flags that don't need to changed.
This should calm down attempts to `cp -p' to a nfs mount or some other
filesystem that doesn't accept flags or all combinations of flags.
It will warn if it fails to change flags though.


36812 09-Jun-1998 dt

Print correct error message if we copy an unreadable directory.


36785 09-Jun-1998 imp

Make sure we don't overflow the path buffer. Exit if we do.
Obtained from or inspired by: A similar change in OpenBSD by theo


36784 09-Jun-1998 imp

Make sure we pass the length - 1 to readlink, since it adds its own
NUL at the end of the path.
Inspired by: OpenBSD's changes in this area by theo de raadt


36649 04-Jun-1998 steve

Fix a bunch of spelling errors.

PR: 6856
Submitted by: Josh Gilliam <josh@quick.net>


36635 04-Jun-1998 jkoshy

Fix errors that crept into the previous commit.


36631 04-Jun-1998 jkoshy

1. `ps' output now shows 3 characters in the `TT' field, not 2, after
rev 1.6 of "ps.c".
2. Reword description of `-f' option.

PR: 5340
Submitted by: Jorge Goncalves <j@bug.fe.up.pt>


36599 03-Jun-1998 jkoshy

Correct description of -crtscts.

PR: 6836
Submitted by: Andrew <andrew@ugh.net.au>


36546 31-May-1998 steve

Clarify the example a bit.

PR: 6801
Reviewed by: David Kelly <dkelly@hiwaay.net>


36497 31-May-1998 bde

Fixed imperfections in previous commit (a poor variable name,
excessive 64-bit arithmetic, and excessive changes).


36441 28-May-1998 phk

Some cleanups related to timecounters and weird ifdefs in <sys/time.h>.

Clean up (or if antipodic: down) some of the msgbuf stuff.

Use an inline function rather than a macro for timecounter delta.

Maintain process "on-cpu" time as 64 bits of microseconds to avoid
needless second rollover overhead.

Avoid calling microuptime the second time in mi_switch() if we do
not pass through _idle in cpu_switch()

This should reduce our context-switch overhead a bit, in particular
on pre-P5 and SMP systems.

WARNING: Programs which muck about with struct proc in userland
will have to be fixed.

Reviewed, but found imperfect by: bde


36410 27-May-1998 phk

"make world" replaces /bin/rmail even when NO_SENDMAIL has been set to
true in /etc/make.conf. Both qmail and smail use a different rmail, so
replacing rmail is a Bad Thing.

PR: 6762
Reviewed by: phk
Submitted by: Bill Trost <trost@cloud.rain.com>


36383 25-May-1998 steve

Don't append a '/' to the destination directory if there
is already one there.

PR: 3025


36352 25-May-1998 steve

If no value is present for the login name set it to '-'.
Also pretty-up the display of 'ps -Ortprio'.

PR: 4947
Submitted by: Martin Kammerhofer <dada@sbox.tu-graz.ac.at>


36175 19-May-1998 jkoshy

Improve description of absolute modes.

Submitted by: Josh Gilliam <josh@quick.net>
PR: 6634


36152 18-May-1998 charnier

Correct use of .Nm. Add rcsid.


36151 18-May-1998 charnier

Correct use of .Nm. Add section number to .Xr references. Add rcsid.


36150 18-May-1998 charnier

Add rcsid. Spelling.


36149 18-May-1998 charnier

Correct use of .Nm. Add rcsid.


36148 18-May-1998 charnier

Correct use of .Nm. Add section number to .Xr references.


36146 18-May-1998 charnier

.Nm rm -> .Nm.


36143 18-May-1998 jkoshy

kill.1: Remove reference to obsolete sigvec(2) man page. Removed
self reference in sigaction(2) man page.

Submitted by: Josh Gilliam <josh@quick.net>
PR: 6617


36049 15-May-1998 charnier

Correct use of .Nm. Add rcsid.


36048 15-May-1998 charnier

correct use of .Nm. Add rcsid.


36047 15-May-1998 charnier

Correct use of .Nm. Typo.


36046 15-May-1998 charnier

Correct use of .Nm. Add rcsid.


36014 13-May-1998 phk

.Sh ENVIRONMENT VARIABLES -> .Sh ENVIRONMENT

PR: 6599
Reviewed by: phk
Submitted by: Josh Gilliam <josh@quick.net>


36012 13-May-1998 charnier

Correct use of .Nm. Add rcsid.


36011 13-May-1998 charnier

Correct use of .Nm.


36010 13-May-1998 charnier

Convert to mdoc.


36009 13-May-1998 charnier

Correct use of .Nm. Add rcsid.


36008 13-May-1998 charnier

Correct use of .Nm.


36007 13-May-1998 charnier

Restore Lite-2 sccsid. Restore include of sys/types.h.


36006 13-May-1998 charnier

Restore Lite-2 sccsid. Restore include of sys/param.h.


36005 13-May-1998 charnier

Restore include of sys/types.h and sys/param.h.


36003 13-May-1998 charnier

Restore Lite-2 sccsid.


36002 13-May-1998 charnier

Restore original Lite-2 sccsid. Restore include of sys/types.h.


36001 13-May-1998 charnier

Do not remove include of <sys/param.h> and <sys/types.h>. They should
be here before including almost any POSIX header.
Requested by: Bruce


36000 13-May-1998 charnier

Restore Lite2 sccsids by removing `const'. Improve documentation a little.
Suggested by: Bruce


35853 09-May-1998 jb

Of these programs, only df and ps aren't compatible with FreeBSD/Alpha.
All the rest work! Actually, I don't know if chio works because I can't
test that. df can be built using NetBSD's mount.h. ps depends on libkvm
so there is no point trying.


35783 06-May-1998 bde

Backed out previous backout. Put y.tab.h back in SRCS.


35773 06-May-1998 charnier

Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc.


35772 06-May-1998 charnier

Correct use of .Nm, .An and other cosmetics. Add rcsid. Remove unused #inc.


35737 05-May-1998 bde

Backed out previous commit. It was tested, but not for the case where
a separate object tree doesn't exist. Crufty makefiles will have to
put y.tab.h in SRCS so that we know not to create foo.h from foo.y.


35708 04-May-1998 bde

Fixed races in `make -jN' using new yacc rules.


35702 04-May-1998 bde

Simplified using new yacc rules and by not generating y.tab.h.


35675 04-May-1998 cracauer

When calling a shell function, remember whether exit status is tested.
This is needed for the '-e' option. See the PR for more details.
PR: 6047
Reviewed by: PR submitter, silence on review request.


35515 29-Apr-1998 imp

Add note about BLOCKSIZE variable to -s flag.


35465 26-Apr-1998 bde

Backed out most of rev.1.19 (explicit dependencies of object files
on generated headers). This is now handled generally in bsd.prog.mk.


35441 25-Apr-1998 ache

Fix nasty error in len_octal, result not initialized


35440 25-Apr-1998 ache

Fix ctype error #1 - chars must be unsigned


35435 24-Apr-1998 des

Remove the bogus -? option after reading the getopt() manual :)


35426 24-Apr-1998 des

o Removed two unused variables (f_dirname and f_newline) in ls.c

o Added the -H and -P options for treatment of symbolic links.

o Removed the #ifdef BSD4_4_LITE, since it does not seem to do anything
useful

o Fixed up prn_octal() so its output looks more like that of AT&T Unices
when -b is given.

The next two lines apply only to the first two changes above:

PR: bin/6140
Submitted by: Max Euston


35425 24-Apr-1998 des

Updated references to the behaviour of ls(1).

PR: bin/6140
Submitted by: Max Euston


35417 24-Apr-1998 des

o Renamed '-b' (show unprintables in octal) to '-B'

o Added a new '-b' which behaves as in AT&T Unices (show unprintables in
octal, using C escape codes when possible)

o Added '?' to the getopt() string, since the code in the switch considers
it as a valid option.


35373 21-Apr-1998 des

Added -b option to display unprintables in octal.
PR: 1315


35355 20-Apr-1998 rnordier

Spelling/typo fixes: (preceeded, friday).


34899 26-Mar-1998 markm

Rats. I was too quick. Work needs to be done on the non-Kerberos
case. Re-enable SUID mode.


34898 26-Mar-1998 markm

KTH announced a weakness in their implementation of KerberosIV.
FreeBSD was not vulnerable, but their fix had some useful features.
Incorporate the best of those - rcp(1) no longer needs to be SUID
to root.


34668 19-Mar-1998 charnier

.Sh AUTHOR -> .Sh AUTHORS
Use .An/.Aq


34554 13-Mar-1998 jb

Some things only work on i386.


34135 06-Mar-1998 bde

Fixed existence test for secure sources (don't test for secure objects).

Fixed some formatting.


33919 28-Feb-1998 jraynard

Don't assume sigset_t and int are equivalent.


33776 24-Feb-1998 bde

Exit with a nonzero status if we get killed by a SIGINT. POSIX.2
specifies exiting with a zero status if the file was copied
successfully, and with a nonzero status if an error occurred. We
are too sloppy to tell if the file was copied successfully when we
get killed by a SIGINT, but it is unlikely to have been. Added a
comment about related sloppiness (calling exit() from a signal
handler).


33592 18-Feb-1998 dima

Add 'f' flag to the optstring.


33591 18-Feb-1998 dima

cosmetic change for optstring


33261 12-Feb-1998 jdp

Explicitly describe the rules the shell uses to search for a file
sourced by the "." command.


33238 11-Feb-1998 eivind

spelling

Obtained from: OpenBSD (src/bin/chio/chio.c rev 1.7) by todd@openbsd.org


33234 11-Feb-1998 asami

Fix printing for bytes read > 4G.

Reviewed by: bde


33142 06-Feb-1998 cracauer

Back out my previous attempt to fix SIGINT/SIGTERM behaviour


33138 06-Feb-1998 cracauer

Fix handling of SIGINT/SIGQUIT for foreground subprocesses. Most
urgent need is when you run sh around a program that intentionally
uses SIGQUIT/SIGINT for asynchronous events, i.e. $EDITOR started from
system(2), like many mailers do. This fixes PR bin/1206 and possibly
bin/4241.

The solution committed has been tested for a large number of possible
cases (see recent discussion on cvs-committers). I completed a make
world, made sure 'make world' is interruptable and used the changed
/bin/sh as a login shell all day, including job control and using
SIGQUIT-catching programs (to write this message :-).

PR: bin/1206
Reviewed by: discussion on cvs-commiters


33010 02-Feb-1998 dyson

Display VSZ much more accurately now.


32983 01-Feb-1998 steve

setpwent now has a void return type, so remove the now bogus cast.


32756 25-Jan-1998 jb

Cast a size_t to a long to avoid a gcc warning.


32645 20-Jan-1998 bde

Removed definition of _NEW_VFSCONF. The new vfsconf interface is now
the default.


32588 17-Jan-1998 bde

Fixed syntax error in normally-unconfigured code in previous commit.


32540 16-Jan-1998 bde

Fixed handling of short writes. Previously, we stopped copying and
printed a bogus warning with a stale errno if write() returns a short
count. Now we continue copying. We still print a bogus warning if
write() returns an "impossible" short count of 0.


32361 09-Jan-1998 jb

Make a couple of the stat flags dependent on the sys/stat.h header file
that this source is compiled against. This source is referenced by
install which is needed as a build tool and must be able to compile
against NetBSD headers and libraries if we have a hope of supporting
another architecture.

With this change, that's two working programs down and 3945 (?) to go.
The other one was make, but that didn't need any changes to work under
FreeBSD/Alpha. 8-)


32325 07-Jan-1998 joerg

Oops, back out rev 1.5, it wasn't my intention to also commit the
-g. ;)


32324 07-Jan-1998 joerg

Use the correct value in the call to swab(3) with conv=swab. Previously,
dd if=/dev/zero of=/dev=null obs=23520 conv=swab
coredumped.

Please somebody review it, i'm not 105 % sure i'm understanding all
this mess correctly.

Detected by: Holm Tiffe <holm@geophysik.tu-freiberg.de>


32194 02-Jan-1998 steve

Correct a bogon in an example.

PR: 5415
Submitted by: Sergei S. Laskavy <laskavy@pc759.cs.msu.su>


32138 31-Dec-1997 helbig

Ensure stdout is line buffered.
Change "pat" -> "re" in man page.


32066 29-Dec-1997 alex

Added $Id$.


31989 25-Dec-1997 hoek

Use consistent spelling,
writeable -> writable (recall prior debate over this? :-)
initialise -> initialize
recognise -> recognize

Merry Christmas! :)


31921 21-Dec-1997 brian

Add (BSD) copyright headers.


31862 19-Dec-1997 bde

Don't strip trailing slashes (for the initial rmdir). It breaks
following of the symlink for `rmdir symlink/' and is unnecessary
for ordinary directories (POSIX doesn't require rmdir(1) to do
anything for trailing slashes; it requires rmdir(2) to let them
"refer to a directory", and following the symlink for symlink/ is
what BSD does). This also fixes bugs in the slash-stripping code
(for paths consisting entirely of slashes, the pointer into the
string was decremented to "before" the beginning of the string,
and the path was at best stripped to "".

The behaviour is unchanged except for the final directory for
`rmdir -p ...'. There is no alternative to stripping intermediate
slashes since they must be specified. The sloppy slash-stripping
code is adequate for intermediate directories, since the all-slashes
case fails early.


31746 15-Dec-1997 eivind

It's more portable to use <errno.h> than <sys/errno.h>

Pointed-out-by: bde (a long while ago)


31743 15-Dec-1997 eivind

Revert 1.15 - duplicate code (initialization).

Pointed-out-by: bde


31688 12-Dec-1997 eivind

Make code slightly more robust towards change by calculating size
in-place.

Obtained from: OpenBSD ar_subs.c rev 1.7 by Tood Miller <millert@openbsd.org)


31687 12-Dec-1997 eivind

Make this lint more cleanly

Obtained from: OpenBSD file rev 1.4 by mickey


31686 12-Dec-1997 eivind

Merge from OpenBSD:
>sprintf -> snprintf paranoia

Obtainted from: OpenBSD src/bin/stty/print.c v1.5
by Todd Miller <millert@openbsd.org>


31668 11-Dec-1997 brian

Put [+format] at the end of the usage message.
Make `date -?' output (pretty much) the same as
the man page
PR: 5269


31666 10-Dec-1997 eivind

Remove simultaneous include of <sys/param.h> and <sys/types.h>.
Reorder includes to be alphabetical some places since I already was in
here.


31664 10-Dec-1997 eivind

Merge from OpenBSD:
> Error out if someone tries to mv a mount point. Old behavior was to
> move all files contained in the mounted filesystem to the dest. dir
> which could be quite nasty. Personally, I think rename(2) should
> return EPERM or EINVAL instead of EXDEV.

Obtained from: OpenBSD mv.c rev 1.6 by Todd Miller <millert@openbsd.org>


31633 08-Dec-1997 wosch

Add -P option to cp(1) for local to local copying.
Pointed out by: bde


31615 07-Dec-1997 wosch

Use `cp -R' instead `cp -r' for local to local coping
(e.g.: rcp -r /tmp/1 /tmp/2). See the cp(1) manpage for more details.


31589 07-Dec-1997 peter

Move procctl to the Attic, it's been copied to usr.sbin/procctl as
suggested by bde via sef.


31566 06-Dec-1997 sef

Add procctl to the list of programs built.


31565 06-Dec-1997 sef

First checkin of the procctl program.


31553 05-Dec-1997 dyson

Document the new -f flag.
PR: 5196
Submitted by: Matt Dillon <dillon@best.net>


31552 05-Dec-1997 dyson

Add an option to building PS, so that the upages are explicitly paged in only
for users who are root, or in group wheel. This is useful on large timesharing
systems where a PS command can cause the system to grind to a halt. The
ability to get the information isn't diminished for those who really need the
additional detail (administrators.) Normal users won't see any difference unless
the processes are swapped out. The "really get it mode" is invoked by the
use of an additional flag in the command string "-f". New/old behavior is
selectable with a compile option.

PR: 5196
Submitted by: Matt Dillon <dillon@best.net>


31144 13-Nov-1997 julian

Reviewed by: hackers@freebsd.org in general
Obtained from: Whistle Communications tree

Add an option to the way UFS works dependent on the SUID bit of directories
This changes makes things a whole lot simpler on systems running as
fileservers for PCs and MACS. to enable the new code you must
1/ enable option SUIDDIR on the kernel.
2/ mount the filesystem with option suiddir.
hopefully this makes it difficult enough for people to
do this accidentally.
see the new chmod(2) man page for detailed info.


31128 12-Nov-1997 jdp

Document the exit status for a command that was terminated by a
signal.


31120 11-Nov-1997 joerg

Sort "sparse" into alphabetical order, since dd's `conv' options need
to be sorted. This temporarily broke the "osync" option.


31098 10-Nov-1997 bde

Fixed some type and value mismatches. setsignal() returned a bogusly
cast value that was always ignored. Rev.1.9 of trap.c made this
more bogus by returning a semantically different value after calling
siginterrupt(). Avoid these problems by not returning a value.


30969 05-Nov-1997 ache

1) Fix longstanding bug:
trap 'echo xxx' 1 2 3 15
read x
is not interrupted by ^C (due to restartable read syscall) and must be
interrupted per POSIX
Worse case:
read -t 5 x
hangs forever after ^C pressed (supposed to timeout after 5 secs)
Fixed by adding siginterrupt(signo, 1) after catch handler installed

2) Do not reinstall sighandler immediately after it is called,
BSD do it for us


30727 26-Oct-1997 helbig

Synchronize usage() and man page.
Pointed out by bde.


30370 13-Oct-1997 joerg

Style police: keep a variable list in alphabetical order, and add
pointless paren's to return statements.

Nitpicked by: bde :)


30340 12-Oct-1997 joerg

Make df(1) exit with non-success status if something went wrong.

PR: bin/4415


30312 11-Oct-1997 joerg

Teach dd(1) about an option to write sparse files. Can be useful for
things like diskless clients' swap files etc.

Submitted by: pascal@zuo.dec.com (Pascal Pederiva) (ages ago, with many
stylistic changes by me)


30247 09-Oct-1997 eivind

Un-clobber mktemp->mkstemp patch.


30246 09-Oct-1997 eivind

Add <sys/errno.h>


30233 08-Oct-1997 eivind

make signal handlers errno safe

Obtained from: OpenBSD (file rev 1.11) - Theo de Raadt <deraadt@openbsd.org>


30232 08-Oct-1997 eivind

mktemp -> mkstemp

Obtained from: OpenBSD (file rev 1.4 by Theo de Raadt <deraadt@openbsd.org>)


30231 08-Oct-1997 eivind

make signal handlers errno safe

Obtained from: OpenBSD (file rev 1.5) Theo de Raadt <deraadt@openbsd.org>


30230 08-Oct-1997 eivind

Slightly improved fix compared to my insiration

don't munge argv strings -- copy them first. avoids 'w' showing:
deraadt p8 zeus.theos.com 8:26AM 3 dd if of bs

Obtained from: OpenBSD (file rev 1.3) by Theo de Raadt <deraadt@openbsd.org>


30208 07-Oct-1997 eivind

save errno in sigchld handler

Obtained from: Theo deRaadt <theo@openbsd.org> (OpenBSD rev 1.6)


30207 07-Oct-1997 eivind

vsprintf -> vnsprintf paranoia.

Obtained from: Todd Miller <millert@openbsd.org> (OpenBSD rev 1.3)


30206 07-Oct-1997 eivind

Don't honor $HOME if >= MAXPATHLEN

Obtained from: Todd Miller <millert@openbsd.org> (OpenBSD csh.c rev 1.3 and 1.4)


30113 05-Oct-1997 jkh

Changes to support full make parallelism (-j<n>) in the world
target.
Reviewed by: <many different folks>
Submitted by: Nickolay N. Dudorov" <nnd@nnd.itfs.nsk.su>


30106 04-Oct-1997 wosch

mv(1) is too silent if used with the option -i. It should
print which input mv(1) expect (y/n) and print a warning if the
file was not overwritten.


30088 03-Oct-1997 wosch

cp(1) is too silent if used with the option -i. It should
print which input cp(1) expect (y/n) and print a warning if the
file was not overwritten.


30086 03-Oct-1997 wosch

Change example from US to international standard date notation.


30073 03-Oct-1997 danny

Back out suppress '\n' mod.


30021 01-Oct-1997 danny

Add the '-s' flag to the usage string.


30020 01-Oct-1997 danny

Add the ability to supress the '\n' at the end of the date printed.


30013 30-Sep-1997 joerg

Fix the broken `date HHMM.SS' handling.

PR: bin/4661
Submitted by: blank@sliphost37.uni-trier.de (Sascha Blank)


29983 29-Sep-1997 msmith

Add the '-t timeout' option to the 'read' builtin. This allows the
'read' command to return an error if the user fails to supply any
input withink a given time period. The behaviour of this option is
similar to that of the like-named option in ksh93.

Reviewed by: joerg


29933 28-Sep-1997 wosch

Endless loop.

$ touch from to
$ echo -n loop | mv -i from to
overwrite to?
^C


29914 28-Sep-1997 markm

Change to use the new KTH Kerberos.
Also make -Wall a bit quieter.


29563 18-Sep-1997 charnier

environmental -> environment.


29560 18-Sep-1997 sef

Fix sorting of directories when doing '-d'.

PR: bin/4558
Submitted by: Keith Bostic


29332 13-Sep-1997 wosch

PR: docs/4449
The -c flag is not documented in the sh(1) manapge.

Submitted by: adrian@virginia.edu


29329 13-Sep-1997 wosch

spelling corrections.

PR: docs/4450
Submitted by: josh@quick.net


29315 12-Sep-1997 jkh

This command doesn't need to be setuid root, it's only asking
for potential trouble.
Reviewed by: security officers.
Noted by: OpenBSD


28929 30-Aug-1997 jmg

fix misspelling

Submitted-by: Josh Gilliam

Closes PR:4427


28927 30-Aug-1997 jmg

fix misspelling

Submitted-by: Josh Gilliam

Closes PR:4425


28904 29-Aug-1997 sos

Dont have an internal function named "warn" it clashes with libc..
Needed for ELF.


28729 25-Aug-1997 bde

Restored clobbered parts of rev.1.15 (build intermediate object files
for tools).


28642 24-Aug-1997 steve

Correct confusing error message when called as 'stty -sane'.

PR: bin/3573


28554 21-Aug-1997 jlemon

Disallow empty arguments (eg: '') as process ids.
PR: 2631
Submitted by: Arne Henrik Juul <arnej@imf.unit.no>


28433 19-Aug-1997 jlemon

Document correct option in manual page.

PR: 3769
Submitted by: johnp@lodgenet.com


28430 19-Aug-1997 jlemon

Pad the input buffer whenever sync is used, not just if the noerror flag
is also set.
Change osync to not to tack on an empty block if the input buffer is null,
or an even multiple of the blocksize.
Also change osync to pad the output with nulls/spaces depending whether
this is a block-oriented conversion or not (same as sync).

PR: 3818


28383 18-Aug-1997 brian

Hint at how to use TZ.
Submitted by: grog@lemis.com


28346 18-Aug-1997 steve

Make all status values an integral type and use
pid_t when referring to process IDs.


28170 13-Aug-1997 steve

Use -I${.CURDIR}/../../sys so that the path is relative
to the source code directory.

Submitted by: bde


28130 12-Aug-1997 ache

Describe signals behaviour now


28054 11-Aug-1997 steve

Oops, add #include's (forgotten in last commit) to make this
compile again.


28053 11-Aug-1997 steve

Use -I../../sys instead of -I/sys.


28052 11-Aug-1997 steve

Remove #ifdef NEWVM code and remove extra "key.name = p" line.


28051 11-Aug-1997 steve

Fix seg fault when invalid keywords are used.

PR: bin/4253
Submitted by: Jesse Rosenstock <jmr@ugcs.caltech.edu>


28038 10-Aug-1997 brian

Remove forgotten debug statement.


28037 10-Aug-1997 brian

Add "-f fmt date" for specification of the
date using strptime(3).
Suggested by: Michael Smith <msmith@atrad.adelaide.edu.au>

Change mm & dd to MM & DD so that they don't
clash with the month.


28025 09-Aug-1997 brian

Change [-DMHW [+|-]val] to [-v [+|-]val[ymwdHM]]
Support Hours & Minutes
Add -Wall to Makefile


27970 08-Aug-1997 steve

More minor nits (mostly using memove instead of memcpy).


27969 08-Aug-1997 steve

More $@ -> ${.TARGET} that I missed earlier.


27968 07-Aug-1997 steve

Observe precedence set by Philippe Charnier when adding an
rcsid.


27967 07-Aug-1997 steve

Observe precedence set by Phillippe Charnier in adding an
rcsid.


27965 07-Aug-1997 steve

Changes include: sccsid -> rcsid, bcopy -> memcpy, don't use the
register keyword, and -Wall cleaning.

Obtained from: similar changes in NetBSD


27964 07-Aug-1997 steve

Remove remaining Lite1 stuff from the man page and uphold the
precedence in changing sccsid to rcsid as set by Phillippe
Charnier in his previous 100 or so commits.

pointed out by: Bruce Evans <bde@zeta.org.au>


27963 07-Aug-1997 steve

sccsid -> rcsid and fix some minor nits.


27962 07-Aug-1997 steve

Add Bruce's _NEW_VFSCONF flag to make this compile cleanly and
sccsid -> rcsid.


27960 07-Aug-1997 steve

#include <err.h> for err(3) call and replace extern reference to errno
with #include <errno.h>.


27959 07-Aug-1997 steve

Remove #if(n)def BSD_4_4_LITE cruft and change sccsid to rcsid.


27958 07-Aug-1997 steve

Remove #if(n)def BSD_4_4_LITE cruft and sccsid -> rcsid.


27874 04-Aug-1997 brian

Add [-DWMY] flags for date adjustment.
Discussed with: freebsd-hackers


27857 03-Aug-1997 peter

Fix "lstart". (Displays "19" rather than time)

PR: 4206
Submitted by: Tetsuya Furukawa <tetsuya@secom-sis.co.jp>


27856 03-Aug-1997 peter

Kill #ifndef NEWVM etc. It affected a lot of other things besides
VM structure (eg: credentials etc) and it's highly unlikely we'll ever
get to see the "tainted" BSD<=4.3 VM code in public use. Although it
indicated the way some things used to be done, it obfuscates things too
much.


27357 13-Jul-1997 bde

devname.c moved to libc before Lite1 and isn't in ps in Lite2.


27161 01-Jul-1997 bde

Bury this properly.


27160 01-Jul-1997 bde

This commit was generated by cvs2svn to compensate for changes in r27159,
which included commits to RCS files with non-trunk default branches.


27107 30-Jun-1997 charnier

Remove lines inside #ifdef 0/#endif.


27040 29-Jun-1997 pst

NOSHARED takes a yes/YES no/NO value, not "true, false, hey mon!".
NOPIC is used to not generate a shared library, not NOSHARED.
Make NOSHARED advisory where appropriate.
Remove bogus NOSHARED (kbdio).


26883 24-Jun-1997 charnier

Document the use of `ls -lo' to see flags.
Obtained from: OpenBSD.


26747 19-Jun-1997 jkh

Back out previous fix - this bug's got diplomatic immunity as a registered
political issue.


26743 19-Jun-1997 jkh

>Number: 3780
>Category: bin
>Synopsis: WEXITSTATUS() may return nagative value, which causes sh to generate bad $?

PR: 3780
Submitted by: sanewo@ba2.so-net.or.jp


26730 19-Jun-1997 jdp

Try again to explain the existence of lchown() and the absence of
lchmod() and lutimes().


26649 14-Jun-1997 jdp

Update some text to reflect the fact that symbolic links now have
owner and group attributes.


26488 06-Jun-1997 ache

Now [^abc] means the same as [!abc] like bash and *csh already does


26468 06-Jun-1997 charnier

Typo in usage string. Looks like the man page now.


26467 06-Jun-1997 charnier

Err(3) was locally defined (for portability reasons). Use #ifdef 0/#endif
to hide this so libc is kept instead.


26466 06-Jun-1997 charnier

Correct usage string. Man page don't reflect reality for now.


26465 06-Jun-1997 charnier

Cosmetic change in usage string.


26464 06-Jun-1997 charnier

Do not use __progname.


26435 04-Jun-1997 charnier

Revert part of previous patch: Don't use __progname.


26434 04-Jun-1997 charnier

Revert part of previous patch: Don't use __progname.


26405 03-Jun-1997 charnier

Add xref to lchown(2) and symlink(2).
Obtained from: {Net|Open}BSD


26404 03-Jun-1997 charnier

Signal # NSIG (32) is invalid.
Obtained from: {Net|Open}BSD


26403 03-Jun-1997 charnier

/etc/netstart -> /etc/rc.network
Use __progname in usage string. Change usage string to match the man page.


26402 03-Jun-1997 charnier

/etc/netstart -> /etc/rc.network
Add usage() and use __progname. Change usage string to match man page.


26394 02-Jun-1997 max

Add X-reference to ch(4).


26367 02-Jun-1997 charnier

Typo fix.


26365 02-Jun-1997 charnier

Typo (the the -> the).


26363 02-Jun-1997 charnier

Off by 1 adjustment. Properly NUL terminate after strncpy.
Obtained from: {Net|Open}BSD


26362 02-Jun-1997 charnier

Off by 1 adjustment.


26361 02-Jun-1997 charnier

Remove unused variables. Suppress -Wall warnings. Check for potential buffer
overflow. Display available command in usage string.
Obtained from: {Net|Open}BSD


26360 02-Jun-1997 julian

Submitted by: Whistle Communications (archie Cobbs)

These changes add the ability to specify that a UFS file/directory
cannot be unlinked. This is basically a scaled back version
of the IMMUTABLE flag. The reason is to allow an administrator
to create a directory hierarchy that a group of users
can arbitrarily add/delete files from, but that the hierarchy
itself is safe from removal by them.
If the NOUNLINK definition is set to 0
then this results in no change to what happens normally.
(and results in identical binary (in the kernel)).
It can be proven that if this bit is never set by the admin,
no new behaviour is introduced..
Several "good idea" comments from reviewers plus one grumble
about creeping featurism.

This code is in production in 2.2 based systems


26104 24-May-1997 steve

Make sh(1) less aware of the bit fields returned by wait by
using the WIF* macros in sys/wait.h.

PR: bin/3668
Submitted by: dholland@eecs.harvard.edu


25960 21-May-1997 steve

Remove y.tab.h from the beforedepend target. Also add a
rule that shows the dependency of arith_lex.[co] on y.tab.h.

Suggested by: Bruce Evans <bde@zeta.org.au>


25906 19-May-1997 steve

Add explicit y.tab.h rule so that 'make depend clean all' does
not fail with an "don't know how to make y.tab.h" error.


25905 19-May-1997 steve

Use the __unused attribute where warranted.


25903 19-May-1997 steve

Miscellaneous sorting and addition of rules for object files that
depend on generated headers.

Reviewed by: Bruce Evans <bde@zeta.org.au>


25612 09-May-1997 joerg

Ensure string termination after strncpy().

PR: 2997
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>


25529 07-May-1997 steve

Revise the section that explains how to protect parts of an $ENV script
from being executed in non-interactive mode.

Suggested and Reviewed by: Brian Somers <brian@freebsd.org>


25471 05-May-1997 steve

Don't source $ENV unless this is an interactive shell.


25317 30-Apr-1997 bde

Fixed overflow for attempts to seek to offsets > ULONG_MAX. See the
OpenBSD version for more complete fixes. E.g., to seek to offsets >
INT_MAX using a block size of 1, block numbers need to be off_t's
instead of u_long's.


25280 29-Apr-1997 dfr

Enable whiteout code since we now have the lite2 support for them.


25271 29-Apr-1997 jkh

Dynamically adjust size of displayed username to the longest username which
appears, not the longest _maximum_ username (this should probably also go
into 2.2, for the day when we bump up the username length there too).

Submitted-By: Terry Lambert <terry@lambert.org>


25236 28-Apr-1997 steve

Change spelling of ECBDIC to EBCDIC. Closes PR #3402

Submitted by: h-nokubi@nmit.mt.nec.co.jp


25235 28-Apr-1997 steve

Turn on the new type builtin.


25233 28-Apr-1997 steve

Sync with NetBSD's revision 1.29 of this file.

Obtained from: NetBSD


25232 28-Apr-1997 steve

Remove an extra semicolon and nuke register keyword usage.


25231 28-Apr-1997 steve

Fix redirection of unopened file descriptors and nuke register
keyword usage.

Obtained from: NetBSD


25230 28-Apr-1997 steve

Revert changes from rev 1.16 to 1.17 for now. Closes PR 2879.


25229 28-Apr-1997 steve

mdoc-ify and cleanup UNIMPLEMENTED messages. Closes PR 2880.


25228 28-Apr-1997 steve

Reorder declarations slightly.


25227 28-Apr-1997 steve

Avoid a possible NULL pointer dereference, nuke register usage,
and remove an unnecessary reset.

Obtained from: NetBSD


25226 28-Apr-1997 steve

Nuke register keyword usage, #if -> #ifdef, and avoid void *
arithmetic.

Obtained from: NetBSD


25225 28-Apr-1997 steve

Nuke register keyword usage, rename pread to preadfd, and open
input files FD_CLOEXEC.

Obtained from: NetBSD


25224 28-Apr-1997 steve

When NO_HISTORY is defined and the history command is used
show an error message.

Inspired by: NetBSD


25223 28-Apr-1997 steve

Add a type builtin and nuke register keyword usage.

Obtained from: NetBSD


25222 28-Apr-1997 steve

Nuke register keyword usage and #if -> #ifdef.

Obtained from: NetBSD


25221 28-Apr-1997 steve

Shamelessly pilfer most of NetBSD's Makefile so that the
problem with 'make -j n' and no .depend file goes away.
I think Bruce mentioned this somewhere on one of the
mailing lists.

Obtained from: NetBSD


24983 16-Apr-1997 jdp

When "-c" is specified, don't pad the command with spaces if it is
the last field on the line. "ps -axlc" was needlessly wrapping
around on 80-character windows.


24976 16-Apr-1997 danny

Fix typo in comment; Document in an example that years beyond 1999
are handled; fix typo in same example.


24735 09-Apr-1997 mpp

Provide examples of how to remove file names that begin with
a dash in non-getopt implementations. E.g.:
rm /home/mpp/-filename
rm ./-filename

Requested by: bde


24731 08-Apr-1997 mpp

Improve the wording in the NOTES section. Closes PR# 3223.


24524 01-Apr-1997 mpp

Fix several problems with mkdir:

1) Fix mkdir -p to exit with the proper exit status and issue an error
message if it was unable to create all of the specified directories
and they did not previously exist. POSIX says:

The mkdir utility shall exit with one of the following values:

0 All the specified directories were created successfully or the
-p option was specified and all the specified directories now
exist.

E.g.

% mkdir -p /var/mkdir
mkdir: /var/mkdir: Permission denied

% touch /tmp/file
% mkdir -p /tmp/file/dir
mkdir: /tmp/file: Not a directory

Previously the above examples would exit with a zero exit status
and no error message. Something like the following run as a
normal user will still not produce an error:

% id
uid=629(mpp) gid=629(mpp)....
% mkdir -p /usr/local/etc
% ls -ld /usr/local/etc
drwxr-xr-x 4 bin bin 512 Dec 26 14:55 /usr/local/etc/

2) Cleaned up the mode handling to be more efficient when multiple
directories are being created.

3) Fixed a problem where directories could be created with the wrong mode
if the the -p option was specified and the build() routine returned
and error. It would leave the umask set incorrectly at this point.

4) Removed an unused variable.

Closes PR# 2304.


24360 29-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


24348 28-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


24301 26-Mar-1997 obrien

make usage() and SYNOPSIS agree with each other and add missing options
documented in the DESCRIPTION section.


24181 24-Mar-1997 imp

Use mkstemp rather than mktemp to prevent races.

Obtained from: OpenBSD


23852 13-Mar-1997 bde

Merged from Lite2. The -t option is now handled better. The only visible
change should be that the usage message now actually matches the man page.


23851 13-Mar-1997 bde

Merged from Lite2. The man page no longer attempts to list all the
vfs types.

Fixed ordering of FreeBSD `k' option in synopsis.


23850 13-Mar-1997 bde

Merge from Lite2. Straightforward changes.


23789 12-Mar-1997 mpp

Correct the self reference in the description of the "tabs" option.
It should really refer to "oxtabs".

Obtained from: NetBSD-bugs mailing list PR# 3320


23622 10-Mar-1997 guido

Fix buffer overflow


23621 10-Mar-1997 guido

This is a funny one: df for a device that was not mounted used to fail
for root only.


23610 10-Mar-1997 guido

Fix buffer overflow (probably unexploitable).


23525 08-Mar-1997 guido

Make mv more robust. A race has been fixed, as well as an extra warning
added when sbits are cleared.
Fixes PR 1351 and 1377 (I hope).


23460 07-Mar-1997 mpp

Typo fix.


23451 06-Mar-1997 joerg

Acitvate chio(1).


23450 06-Mar-1997 joerg

This commit was generated by cvs2svn to compensate for changes in r23449,
which included commits to RCS files with non-trunk default branches.


23363 04-Mar-1997 ache

Big usernames fixes


23321 03-Mar-1997 ache

Use MAXLOGNAME-1 for width because MAXLOGNAME includes NUL


23091 25-Feb-1997 mpp

Add a missing period in the -o option description.

Document the depreciated -g option.

Inspired by: OpenBSD PR# 119


22988 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


22921 19-Feb-1997 mpp

Use the .Bx macro in the HISTORY section.


22908 19-Feb-1997 obrien

Add history section. Follows chflags(2).


22826 17-Feb-1997 jkh

Include <ufs/ufs/ufsmount.h>.


22777 16-Feb-1997 steve

Fix a expansion bug that caused the result of `echo $((1 << 30))`
to get truncated.

Submitted by: bde


21786 16-Jan-1997 alex

Sweep through the tree fixing mmap() usage:

- Use MAP_FAILED instead of the constant -1 to indicate
failure (required by POSIX).
- Removed flag arguments of '0' (required by POSIX).
- Fixed code which expected an error return of 0.
- Fixed code which thought any address with the high bit set
was an error.
- Check for failure where no checks were present.

Discussed with: bde


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


21635 13-Jan-1997 wosch

Sort cross references.


21547 11-Jan-1997 mpp

Minor mdoc cleanup.


21546 11-Jan-1997 mpp

Add a blurb describing the fact that ls will print the
year in place of the hour/minute fields if the time is
more than 6 months in the past or future.

Also some minor mdoc cleanup.


21545 11-Jan-1997 mpp

Make ls include the year when displaying times that are more than
6 months into the future. Closes PR# 1657.

Submitted by: Sakari Jalowaara <sja.home.tekla.fi>


21352 06-Jan-1997 steve

Fix a problem that caused some foreground pipelines to die with:

tcsetpgrp failed, errno=1

Discovered and Reviewed by: joerg


21301 04-Jan-1997 steve

Make sh(1) think and be in the same place at the same time. This closes
PR#2331: strange output of sh's pwd on symlinked directories.


20970 28-Dec-1996 wosch

add some string examples, eg. test "" -o ""


20960 28-Dec-1996 ache

Use strcoll instead of strcmp for file names comparation

Should be in 2.2


20903 25-Dec-1996 steve

Fix handling of -o and -a operators in the 3 argument case.

Submitted by: Tom Rush <tarush@mindspring.com>


20902 24-Dec-1996 steve

With these changes sh(1)'s trap command should be POSIX-compliant,
while remaining (becoming :) compatible with other popular shells.
Specifically these changes include:

1) Implement 'trap -l' to get a list of valid signals names. This
is useful if you wanted to do something like reset all signal
handlers to there defaults values, in which case something like
this will do the trick.

trap `trap -l`

2) Reformat the output of 'trap' so it can be saved and later eval'd
to restore the saved settings.

3) Allow the use of signal names as well as signal numbers.

4) Fix trap handling of SIGCHLD so that commands like the following
(albeit, contrived) won't cause sh(1) to recurse ad infinitum.

trap uname 0 20

5) Make variables static that are used only in trap.c.

6) Minor 'style(9) police' mods.


20887 23-Dec-1996 steve

Oops, it needs little more caulk to get it right.


20886 23-Dec-1996 steve

Apply a little dab of bit caulk to keep those beggars
from leaking out.

Noticed by: bde


20848 23-Dec-1996 steve

Don't use _POSIX_PATH_MAX to limit the size of the path, instead
use 'getcwd(NULL, 0)' just as pwd(1) does.

Suggested by: bde


20774 21-Dec-1996 steve

Make sh(1) a little braver in the face of adversity. sh(1)
now handles the getpwd() init problem the same way as bash
and ksh do. Also while I was in here, I cleaned up the format
a little, removed some unnnecessary #if SYMLINKS cruft, and
changed the pwd builtin to use getcwd(3) as Joerg suggested.


20746 21-Dec-1996 steve

This doesn't change any behavior, but may be a slight
optimization. (num-- > 0) --> (--num >= 0).

Obtained from: NetBSD


20744 21-Dec-1996 steve

Remove extra #undef.


20742 21-Dec-1996 steve

Fix a problem caused by finger failure on my part. The builtin
getopts should now work as expected. This fix was in the NetBSD
code that I was merging from but missed getting into FreeBSD's
version because of 'drain bamage' on my part.

Submitted by: NetBSD, joerg


20425 14-Dec-1996 steve

Merge in NetBSD mods and -Wall cleaning.

Obtained from: NetBSD, me


20424 14-Dec-1996 steve

-Wall cleaning.


20423 14-Dec-1996 steve

Cleanup man page and -Wall cleaning.


20422 14-Dec-1996 steve

-Wall cleaning and implement -p commandline option.

-p mod obtained from: NetBSD


20421 14-Dec-1996 steve

Merge Lite2 mods, and -Wall cleaning. Unimplemented undelete(2)
cruft is protected by a #ifdef (BSD4_4_LITE) that should be
removed when this is supported by the kernel.


20420 14-Dec-1996 steve

-Wall cleaning.


20419 14-Dec-1996 steve

Merge Lite2 mods, cleanup man page, and -Wall cleaning.


20418 14-Dec-1996 steve

Cleanup man page and -Wall cleaning.


20417 14-Dec-1996 steve

Merge Lite2 mods, and -Wall cleaning. undelete(2) cruft
not yet implemented is protected by a define (BSD4_4_LITE)
that should be removed when this call is supported by the
kernel.


20416 14-Dec-1996 steve

Merge Lite2 mods, and -Wall cleaning.


20415 14-Dec-1996 steve

Merge Lite2 mods, -Wall cleaning, and show usage if
incorrectly called.

Incorrect usage mod obtained from: NetBSD


20414 14-Dec-1996 steve

Merge Lite2 mods, cleanup man page, and -Wall cleaning.


20413 14-Dec-1996 steve

Merge Lite2 mods, fix incorrect default string, cleanup
use of .Nm macros, and -Wall cleaning.


20412 14-Dec-1996 steve

Merge Lite2 mods and -Wall cleaning.


20411 14-Dec-1996 steve

Cleanup man page and -Wall cleaning.


20317 11-Dec-1996 jkh

The manual page of df called cd9660 file systems by the name
isofs while the df command itself used the name iso9660fs or
cdfs. Both of these were inconsistent with the name cd9660 which
is used by the mount command. I modified df to recognize all of
the names cd9660, cdfs, isofs, and iso9660fs, and take them all
to refer to the same thing. Naturally I added a note of this
behaviour in the manual page too.

Submitted-By: Jukka Ukkonen <jau@jau.csc.fi>


20190 07-Dec-1996 bde

Fixed `stty [-]extproc'. It set extproc to a semi-random state (always
off if there are no other options, always (?) on if another option that
changes the state is processed earlier).


19720 13-Nov-1996 phk

Bruce says: "You have been programming in the kernel for too long :-)."

and he's right ... I forgot about this floating point stuff you can
use in user-land :-)

Increase precision of duration to microseconds.
No heuristics to avoid overflow in calculation needed - just depend
on DBL_MAX being a bit larger than LONG_MAX.

Use double instead of `struct timeval' in dd.h so that everything
doesn't have to include <sys/time.h>.

Fixed style bugs in recent and old FreeBSD changes.

Reviewed by: phk
Submitted by: bde


19694 12-Nov-1996 phk

Increase precision of duration to milliseconds.
Some heuristics to avoid overflow in calculation attempted.


19683 12-Nov-1996 peter

Back out rev 1.7 which was to fix PR#1206 (to be reopened).

This patch causes too many side effects, one of which bites hard is
when interrupting a 'make fetch' in the ports tree (PR#1990).
This whole area is a real can of worms....

This most definately should go into 2.2

Reviewed by: steve, bde


19596 10-Nov-1996 hsu

Remove unneeded #include <sys/proc.h>.


19282 31-Oct-1996 ache

Replace collate_range_cmp call with its code


19281 31-Oct-1996 ache

1) define STATIC as static and not empty
2) replace collate_range_cmp call with its code


19240 29-Oct-1996 steve

Add the -p (privileged) commandline switch
found in bash, zsh, and friends.

Reviewed by: joerg


19176 25-Oct-1996 bde

Build intermediate object files for mkinit, mknodes and mksyntax
so that simple regresssion tests based on `cmp' work. mkdep still
doesn't work right for these tools. They should probably be in
separate directories.

Sorted dependencies.


19084 22-Oct-1996 steve

Close PR# 1206. sh(1) now ignores SIGINT and SIGQUIT
when a child is forked and the -c commandline switch
has been specified.

Reviewed by: joerg


19068 21-Oct-1996 peter

Implement a -c option to ps to display the short command name instead of
the full argument vector.

I've bumped into a few things that expected this switch to be present,
the most recent was the snmp package in ports. I'm not 100% sure of the
origins of this, but Linux has it, so does the "BSD-compatable" version
of ps on our SVR4 systems (so I assume SunOS has it too).


18954 16-Oct-1996 steve

Benign | --> || correction.


18754 06-Oct-1996 steve

Fix a problem with sh that conflicts with the -e
flag text in the man page. Now this will work
correctly:

/bin/sh -ec 'false && true; echo hi'

Obtained from: VaX#n8 <vax@linkdead.paranoia.com>


18718 05-Oct-1996 wosch

delete doubled words, e.g.: "the the" -> "the"


18614 01-Oct-1996 peter

re-activate the printf builtin now that src/usr.bin/printf.c has been
tweaked to work as a builtin better (ie: calls the real printf formatting
code, not sh's cut-down out1fmt() function)


18578 30-Sep-1996 ache

Activate LC_CTYPE locale and additionly use !isprint() for 8bit characters


18546 28-Sep-1996 imp

Merge in the NetBSD changes to cat.c. These appear to have come from
the 4.4 lite 2 tape as well. There are now only two diffs between
NetBSD's cat and FreeBSD's cat:
getopt return value is -1 on NetBSD and EOF on FreeBSD.
NetBSD has added setlocale calls before anything else.


18536 28-Sep-1996 bde

Close files up to getdtablesize() instead of up to NOFILE.

csh was one of the 3 programs in /usr/src that (mis)used NOFILE.


18471 22-Sep-1996 wosch

add forgotten $Id$


18409 20-Sep-1996 nate

ts_sec -> tv_sec
ts_nsec -> tv_nsec


18267 12-Sep-1996 adam

Mend 'exit' without breaking 'exit 1'
*blush* %-\

Pointed out by: bruce


18254 12-Sep-1996 bde

Backed out last change. It broke even `exit 1'.


18202 10-Sep-1996 peter

Ok, lets try this again, shall we? It was definatly my mistake, not
Steve's.. :-]


18200 10-Sep-1996 peter

ack! back these out so I can see what I did wrong. It looks like a
patch-by-hand botch, but it sig-11's during make world.


18198 10-Sep-1996 peter

Fix for PR#1248, sh doesn't expand past ${9}

Submitted by: Steve Price <sprice@hiwaay.net>


18154 08-Sep-1996 adam

let the "exit" command return status when it is implicit


18019 03-Sep-1996 peter

eek, how did that happen? I must have committed something left over from
when I was experimenting looking for an alternate format. *blush*


18018 03-Sep-1996 peter

Fix for PR#1287. This makes sh behave sensibly in case statements in the
face of aliases. Note, bash doesn't do aliases while running scripts, but
"real" ksh does..

Also:
Reduce redundant .Nm macros in (unused) bltin/echo.1
nuke error2, it's hardly used.
More -Wall cleanups
dont do certain history operations if NO_HISTORY defined
handle quad_t's from resource limits

Submitted by: Steve Price <sprice@hiwaay.net> (minor tweaks by me)


18016 03-Sep-1996 peter

Misc cleanups and fixes from Bruce:
- don't put \n on error() calls, error adds it already.
- don't prepend "ulimit" on error() calls in miscbltin.c.
- getopt typo on ulimit -p -> -u conversion
- get/setrlimit() calls were not being error checked

ulimit formatting cleanup from me, use same wording as bash on Bruce's
suggestion. Add ulimit arg to output on Joerg's suggestion.


17988 01-Sep-1996 peter

oops, I didn't mean for the unconditional DEBUG code to go in, it's been
off in FreeBSD for some time. I realised this a few seconds after the
commit started..


17987 01-Sep-1996 peter

Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is a
merge of parallel duplicate work by Steve Price and myself. :-]

There are some changes to the build that are my fault... mkinit.c was
trying (poorly) to duplicate some of the work that make(1) is designed to
do. The Makefile hackery is my fault too, the depend list was incomplete
because of some explicit OBJS+= entries, so mkdep wasn't picking up their
source file #includes.

This closes a pile of /bin/sh PR's, but not all of them..

Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter


17891 29-Aug-1996 wosch

[HISTORY] command appeared in Version 1 AT&T UNIX
Obtained from: A Quarter Century of UNIX, Peter H. Salus, page 41


17852 27-Aug-1996 adam

set error status on exit, to be consistent with manpage and standard commands.


17849 27-Aug-1996 wosch

sync copyright with /usr/share/examples/etc/bsd-style-copyright


17772 22-Aug-1996 wosch

[HISTORY]
cat command appeared in Version 1 AT&T UNIX, not Version 6
Apparently the cat man page was the first written man page

Obtained from: A Quarter Century of UNIX, Peter H. Salus
[BUGS]
fix a typo


17562 12-Aug-1996 ache

Take out 0201-0207 range - those characters abused by sh


17561 12-Aug-1996 ache

Convert to newly added collate compare function


17557 12-Aug-1996 ache

Convert to newly added collate compare function


17538 12-Aug-1996 ache

Simplify expression


17529 12-Aug-1996 ache

Use collate for alpha character ranges


17526 11-Aug-1996 ache

Fix unsetenv of locale variable


17525 11-Aug-1996 ache

Localize it


17517 11-Aug-1996 ache

Pick collate info for RE character ranges


17516 11-Aug-1996 ache

Localize it
8bit cleanup


17496 10-Aug-1996 adam

chmod(2) directories once only (was twice)


17367 31-Jul-1996 dg

Updated to match kernel changes for timer/run queue.


16950 03-Jul-1996 wosch

add a reference to killall(1)


16949 03-Jul-1996 mpp

The default swap device is /dev/drum, not /dev/swap
as ps.1 states.

Submitted by: Zahemszhky Gabor <zgabor@code.hu>


16930 03-Jul-1996 mpp

Fix some minor formatting problems in some examples.

Obtained from: Partially obtained from NetBSD-bugs mailing list


16835 29-Jun-1996 peter

Make %CPU add up closer to 100%.. At least, it now agrees with top.. :-)

Pointed out by: bde


16833 29-Jun-1996 peter

Fix (I think) the %MEM count in 'ps -u'. It was bogusly taking the
vm_rssize (in pages, not bytes), then dividing (bogusly) by the page size,
then using that as a fraction of the total pages.


16663 24-Jun-1996 jkh

Bring in my changes for removing the pestilent obj links (unless you
really want them) from /usr/src. This is the final version of the
patches, incorporating the feedback I've received from -current.


16491 19-Jun-1996 wosch

Add a better TEST script. I was surprised how much can be wrong
with program test(1) or builtin test(1).


16070 02-Jun-1996 phk

Backup yacc changes.


16069 02-Jun-1996 phk

Backout yacc changes


16013 30-May-1996 phk

Use new yacc rules. (I'm fixing the tree as fast as I can :-)


16012 30-May-1996 phk

Use default yacc rule.


15921 27-May-1996 peter

This commit was generated by cvs2svn to compensate for changes in r15920,
which included commits to RCS files with non-trunk default branches.


15900 24-May-1996 peter

Nuke the undocumented -F flag, since it doesn't do anything anymore.

It used to allow root to hard-link directories (and screw up programs that
expexted the ".." entry to point to the parent dir)


15877 23-May-1996 tg

Output line count to stdout. Complies to POSIX.2.

Reviewed by: joerg


15679 07-May-1996 wosch

``mv'' -> ``mv -f''
``rm'' -> ``rm -f''
so mv/rm may not ask for confirmation if you are not root


15541 02-May-1996 phk

CLSIZE -> getpagesize()


15527 02-May-1996 phk

Replace NBPG with getpagesize()


15319 19-Apr-1996 smpatel

Fix up the badly out of date struct proc's p_flags.
Flags aren't printed in hexadecimal, as documented.


15073 06-Apr-1996 mpp

Correct some cross references and some path names.


15068 06-Apr-1996 ache

For nonexisten time use proper diagnostic instead of bad format and usage


14952 31-Mar-1996 ache

Use unsigned char for isprint


14933 31-Mar-1996 bde

Fixed typo.

Reported by: andreas@knobel.gun.de


14575 12-Mar-1996 nate

Fix 'stutter' in manpage.
The man page for date(1) talks about "a a" maximum, not just
"a" maximum.

Submitted by: Simon Burge <simonb@telstra.com.au> via NetBSD GNATS


14539 11-Mar-1996 joerg

err() --> errx() for non-errno related failures.


14416 08-Mar-1996 wosch

Option -f implemented (remove + create)
option -f and -i are exclusive
respond `Y' is equal to `y'
fix usage string
remove isatty(3) check

Reviewed by: pst


14409 07-Mar-1996 wosch

fix usage string
respond `Y' is equal to `y'

Add a note how to delete file name with beginning `-'


14305 01-Mar-1996 wosch

delete unused label endarg
correct indent of last new code
fix usage string, option -f before option -i (alphabetic order)


14166 20-Feb-1996 wosch

option -f and -i are exclusive (Posix)
respond `Y' is equal to `y'
update usage string
prompt only if source exist


14158 19-Feb-1996 pst

Don't initialize udata, fix usage string


14157 19-Feb-1996 pst

Don't initialize udata, remove bogus case, fix usage string


14156 19-Feb-1996 pst

-- is implemented in getopt(3)
-? is an unnecessary case statement and not useful


14154 19-Feb-1996 wosch

delete my last commit
Submitted by: pst, ache


14148 18-Feb-1996 pst

Remove unnecessary '?' case and don't zero global udata, it's already zero


14146 18-Feb-1996 wosch

update usage string
all flag variables initialized with zero
respond `Y' is equal to `y'


14145 18-Feb-1996 wosch

Option -f implemented (remove + create)
option -f and -i are exclusive
all flag variables initialized with zero
respond `Y' is equal to `y'
update usage string


14144 18-Feb-1996 wosch

option -f and -i are exclusive
all flag variables initialized with zero
respond `Y' is equal to `y'
update usage string
prompt only if source exist

ignore -i option if file descriptor stdin not refers to a valid
terminal type device


14105 16-Feb-1996 joerg

Add an .Xr for chflags(1) into the SEE ALSO sectoin.

Submitted by: jhs


14041 12-Feb-1996 mpp

Added a update(4) man page to describe the kernel initiated update
process and changed all of the old references to update(8) to update(4).


14038 11-Feb-1996 mpp

Correct a bunch of man page cross references and generally
try and silence "manck".

ncurses, rpc, and some of the gnu stuff are still a big mess, however.


14024 11-Feb-1996 markm

#include <kerberosIV/des.h> -> #include <des.h>


13978 08-Feb-1996 pst

Close bin/937 - handle negative timestamps


13882 03-Feb-1996 joerg

Fix the borokeness that crept in with rev 1.10 of parser.c, the sh
didn't correctly start background jobs anymore. Strange that nobody
was complaining...

Add a dummy target for `builtins' in the Makefile, to prevent it
from attempting to build this file by compiling builtins.c. :-/


13851 02-Feb-1996 mpp

Fix some incorrect locations in the FILES sections of some man pages.


13719 29-Jan-1996 mpp

Fix some spelling errors.


13514 20-Jan-1996 mpp

Use the correct buffer size from limits.h for the error buffer
passed to kvm_open. Closes PR# 476.

Submitted by: Jeffrey Hsu <hsu@freebsd.org>


13513 20-Jan-1996 mpp

Remove unused include of utmp.h from print.c. Closes PR# 486.

Submitted by: Tom Samplonius <tom@haven.uniserve.com>


13424 14-Jan-1996 bde

Partially fixed negative and truncated "Avail" counts in df output.
This fixes PR943.

ffs/ffs_vfsops.c:
ffs_statfs() multiplied by (100 - minfree) as part of calculating the
minfree percentage (complemented in 100%), so with the standard minfree
of 8, it was broken for file systems of size >= 1TB/92 = 11GB. Use the
standard freespace() macro instead. This also fixes a rounding bug (the
"Avail" count was sometimes 1 too small).

ffs/* (not fixed):
The freespace() macro multiplies by minfree, so with the standard
minfree of 8, it is broken for file systems of size >= 1TB/8 = 128GB.
This bug is more serious since it affects block allocation.

ffs/ffs_alloc.c (not fixed):
Ordinary users are sometimes allowed to allocate 1 (partial) block
too many so that the "Avail" count goes negative. E.g., if there is
1 fragment available and the file is fairly large, one more full
block is allocated.

df/df.c:
ufs_df() used/uses essentially the same code as ffs_statfs(), so it
had/has the same bugs.

ufs_df() gratuitously replaced "Avail" counts of < 0 by 0, so it
gave different results for non-mounted file systems in this case.


13399 12-Jan-1996 peter

oops. I forgot to add the "[-U username]" option to the usage string.


13123 30-Dec-1995 peter

This commit was generated by cvs2svn to compensate for changes in r13122,
which included commits to RCS files with non-trunk default branches.


13120 30-Dec-1995 joerg

Print dev minor #'s > 255 in hex.

Reviewed by: jkh, kuku, phk


13117 30-Dec-1995 joerg

Small man page tweaks:

. mention the need for procfs
. make it clear that default sorting is first by ctty, then by PID

Submitted by: schweikh@ito.uni-stuttgart.de (Jens Schweikhardt)


13020 26-Dec-1995 peter

Implement a new option to ps.. `-U username'. This allows you to
list the processes belonging to a particular user without having to use
`-u' and grepping for the username. Basically you can now get a short
`ps -x' like list (with more space for the command) for other users.


12845 14-Dec-1995 bde

Restored formatting from the old printf/printf.c.


12733 10-Dec-1995 joerg

The shell incorrectly gave & precedence over ;. This breaks the
traditional behaviour, and it violates Posix.2.

Fixes PR # bin/880: /bin/sh incorrectly parse...

Fixes also an earlier problem report about the shell not evaluating
loops correctly. (Not files via GNATS.)

Submitted by: nnd@itfs.nsk.su (Nickolay N. Dudorov)


12730 10-Dec-1995 joerg

Move out some of the shell builtin bogosity from printf's source to
sh's builtin/bltin.h.


12378 18-Nov-1995 joerg

Fix my own brokeness for the colon operator, when one of the arguments
was a valid integer. The actual decision between integer and string
is now context-dependant on the operator being used.


12273 14-Nov-1995 peter

A fix for the "cd -" coredump on a brand new /bin/sh. The problem was
noticed on a NetBSD bugs mailing list but this is entirely my own work.

Inspired by: Scott Reynolds <scottr@plexus.com>, for NetBSD


12202 11-Nov-1995 bde

Fixed descriptions of ignpar and parmrk.


12043 03-Nov-1995 peter

Implement allowing 'set -v' in the middle of a script to work.
This means that a script containing:
echo 1
set -v
echo 2
will now produce output, like it does on SYSV machines and other 'proper'
/bin/sh implementations..

This is done by a slight restructure of the input processor allowing it to
read chunks from the file at a time, but process the data by line from the
chunk.

Obtained from: Christos Zoulas for NetBSD. <christos@deshaw.com>


11890 28-Oct-1995 phk

I add #include <sys/user.h>


11855 28-Oct-1995 ache

Fix -h option:
sense symlink even it is unresolved


11809 26-Oct-1995 ache

Change local to LC_ALL, there is no bitmask


11808 26-Oct-1995 ache

Change locale to LC_ALL, there no bitmask


11779 25-Oct-1995 torstenb

fix bad dependencies (LIBMATH -> LIBM)


11748 23-Oct-1995 ache

Add missing reaction on LC_ALL and LC_COLLATE


11747 23-Oct-1995 ache

Add setlocale LC_CTYPE


11746 23-Oct-1995 ache

Remove unneded ctype.h everywhere
Add setlocale LC_TIME


11745 23-Oct-1995 ache

Change LC_ALL to LC_CTYPE|LC_TIME - small optimization


11744 23-Oct-1995 ache

Add setlocale LC_CTYPE|LC_TIME


11743 23-Oct-1995 ache

Remove unneded ctype.h


11740 23-Oct-1995 ache

Add setlocale LC_ALL


11738 23-Oct-1995 ache

Add setlocale(LC_TIME,...


11684 22-Oct-1995 ache

Wrong library was picked by ed


11601 21-Oct-1995 joerg

o rename ulimit -p into ulimit -u, so we are in agreement with bash

o fix brokeness for 1>&5 redirection, where `5' was an invalid file
descriptor, but no error message has been generated

o fix brokeness for redirect to/from myself case


11571 19-Oct-1995 joerg

Implement the "ulimit" builtin. This is the analogon to csh's "limit"
command and badly needed in sh(1) for everybody who wants to modify
the system-wide limits from inside /etc/rc.

The options are similar to other system's implemantations of this
command, with the FreeBSD additions for -m (memoryuse) and -p (max
processes) that are not available on other systems.


11377 09-Oct-1995 joerg

Fix my breakage of the $0 handling during $ENV processing.

Since the broken version went into 2.1, this fix should, too.


11298 07-Oct-1995 bde

Handle trailing slashes in source filenames correctly. E.g., rewrite
`mv foo/ ../..' to `mv foo/ ../../foo/', not to `mv foo/ ../../'. The
latter caused a panic. Before the trailing slash changes in the kernel,
the trailing slashes caused the rename() for this mv to fail earlier, so
there was no panic in 2.0.

Fixes part of PR 760.


11149 03-Oct-1995 markm

Correctly build the secure ed(1) only if secure/ exists.
Pointed out by: bde


11146 03-Oct-1995 bde

Preserve sticky bit for `cp -pR'. It was already preserved for `cp -R'.
This also fixes loss of the sticky bit for `mv' across file systems.


11145 03-Oct-1995 bde

Fix exit status. `cat no-such-file >/dev/null' exited with status 0.
This has been broken since cat's own err() function was sloppily
replaced by the library functions warn() and err().


11113 01-Oct-1995 joerg

Make the mkinit internal command issue an #undef for each #define, to
avoid "duplicate definition" warnings.


11111 01-Oct-1995 joerg

Posixize:

sh -c [-aCefinuvx] command_string [ command_name [argument ...] ] 1

4.56.3 Options

-c Read commands from the command_string operand. Set the
value of special parameter 0 (see 3.5.2) from the value of
the command_name operand and the positional parameters
($1, $2, etc.) in sequence from the remaining argument
operands.

Pointed out by: Kaleb Keithly (kaleb@x.org)


11108 01-Oct-1995 markm

Define CRYPTOBJDIR if secure is being built


11107 01-Oct-1995 markm

ed/Makefile is able to 'decide' for itself whether to build secure or
unceumbered ed. Remove the superfluous .if (...) / .endif


11106 01-Oct-1995 markm

Use the same make technique as passwd and xntpd for the secure ed(1). This
will allow the secure/bin/ed directory to be cleaned out and the bin/Makefile
to be cleaned up.


11065 29-Sep-1995 ache

Build secure ed if available and allowed


11021 26-Sep-1995 peter

Correct the alignment of the tty column, which was affected by my change to
allow more than two tty characters.

David Greenman pointed out that when a process that had been revoked from
it's controlling tty, the "-" sign was detached from any two-character
names.


11015 26-Sep-1995 mpp

Uncomment out references to FIFOs for the -F and -l options.
Also mention sockets in the text for -F.

Partially obtained from the NetBSD commit mail list.


10934 21-Sep-1995 bde

Fix relocation of job table.

while { sleep 1 & wait; } do echo 1; done

corrupted the job table every 4th iteration.


10917 20-Sep-1995 dg

Don't dereference a NULL pointer in the case of a null pipe.
e.g.:
ls |> foo.out

sh now behaves the same as it does under SunOS 4.x for this case.


10824 16-Sep-1995 pst

If mail is received with no from address, invoke sendmail with
/usr/sbin/sendmail -f <> dest
rather than
/usr/sbin/sendmail -f dest.

Submitted by: Michael Butler <imb@scgt.oz.au>
Obtained from: Eric Allman <eric@cs.berkeley.edu>


10663 10-Sep-1995 markm

Updating /usr/include/kerberosIV/des.h so eBones will build breaks
rcp and rlogin.
(patch supplied)

Submitted by: John Capo <jc@irbs.com>


10553 04-Sep-1995 peter

Increase the tty column width from 2 to 3 characters.

This gives us more room to breath with tty names, especially with drivers
that support large numbers of ports.. eg: specialix and digiboard.

This does not actually change the current tty names, it just allows room
for reporting more characters if the drivers use them.


10498 31-Aug-1995 jkh

Well, it would appear that the "ayes" have it (though by a slim margin).
Apply my \c changes to echo. It should also be noted that this is:
A) going into 2.2, not 2.1
B) a functional no-op unless you actually use it!


10399 28-Aug-1995 joerg

Sigh. This will become a never ending story. :-(

When comparing my recent parser change against the ash in 1.1.5.1, i
found that a couple of other problems in the same area has been fixed
there, but not in 2.2. Semicolons and EOF do also delimit words...


10364 28-Aug-1995 dg

Correct the default format info to indicate "%+".


10354 27-Aug-1995 joerg

Make the shell handle a null command in a &&/|| sequence correctly.
The && and || tokens do also terminate a command, not only the
newline.

While i was at it, disabled trace code by default, it served no good
purpose since it required the use of a debugger anyway to be turned
on. Instead, placed a hint in the Makefile on how to turn it on.

This makes the shell ~ 10 % faster and ~ 4 KB smaller. :)

Pointed out by: jan@physik.TU-Berlin.DE (Jan Riedinger)


10181 23-Aug-1995 pst

Clean up compilation warnings.


10083 16-Aug-1995 nate

Fix possible FS corruption caused by extra parameter to pax.
oo
Turns out, it's pretty important if you use PAX for backup. In the man
page for PAX, there is an error (OK, we could call it a "potentially
catastrophic incompleteness"). It reads:

> The command:
>
> pax -r -v -f filename
>
> gives the verbose table of contents for an archive stored in filename.

Yup, it does do that. With a side effect: it also _replaces_ all the
files that come in from the archive. As is my custom, I did my
backup-validation real soon after the backup was written. Precisely
because I've seen the same sort of thing happen on other systems. So all
that file-restoring didn't do a lot of damage. Probably helped my
fragmentation somewhat (aha, an online defragger?) It did confuse one
hapless user, who lost an email message he _knew_ he hadn't deleted.
Apparently the system restored the file as of just before that critical
message came in.

The correct entry should read:

> The command:
>
> pax -v -f filename
>




> gives the verbose table of contents for an archive stored in filename.


Submitted by: John Beckett <jbeckett@southern.edu> via the BSDI mailing list


10068 15-Aug-1995 joerg

The command to `move' across file system boundaries is actually

cp -PRp source_file destination

Closes PR # bin/689: mv(1) manpage

Submitted by: wosch@cs.tu-berlin.de (Wolfram Schneider)


10025 11-Aug-1995 joerg

sh(1) incorrectly ignored an EOF condition when looking for the
closing backquote in a `foo` substitution.

Discovered by: Martin Welk <mw@theatre.pandora.sax.de>


10016 10-Aug-1995 ache

Fix csh to determine event number properly, i.e. stop by ^*-% too.
This fix match with what manpage said and other systems csh's do.
Submitted by: Bill Fenner <fenner@parc.xerox.com>


9991 08-Aug-1995 ache

Change ctime to strftime %c to use national date/time representation


9987 07-Aug-1995 wollman

Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.


9974 06-Aug-1995 joerg

Fix /bin/sh's broken handling of the builtin getopts(1). The options
``-ffoo'' and ``-f foo'' have been treated differently.

This has been in violation of Posix.2 (that deprecates -ffoo, but
doesn't disallow it).


9944 05-Aug-1995 ache

Use %+ to print data using LC_TIME


9909 04-Aug-1995 joerg

expr(1) didn't comply to Posix.2 and its own man page: any
comparisions have been made as string comparisions, even in cases
where both operands clearly qualified as integers.

The fix is to make the parser properly analyzing whether an operand is
a valid integer or not.


9673 24-Jul-1995 rgrimes

Set NOSHARED=true, having this binary static makes it much easier to
fix /usr/lib/*.so problems.

Submitted by: davidg


9434 07-Jul-1995 ache

Move first PATH initialization after sensing for interactive,
first relative path warning was disabled in old case


9433 07-Jul-1995 ache

Do the same check for interactive shell (PATH warning)
like in csh.c


9432 07-Jul-1995 ache

Produce importpath warning only for true interactive shells,
close PR 598


9393 04-Jul-1995 bde

Improve the recently changed and an old error message: don't report probe
errors.


9384 02-Jul-1995 joerg

stty fails with a non-obvious error message if it's run on a non-tty
stream, such as a rsh or vi pipeline.

The error message is:
stty: TIOCGETD: Operation not supported

It's immediately obvious to the knowledgable hacker type, but not
exactly comforting to the user who's not native to unix. It's
especially confusing if there's a stty command in their .cshrc and
it's showing up on rsh output.

(Fixes PR #bin/573)

Submitted by: peter@haywire.dialix.com (Peter Wemm)


9322 26-Jun-1995 bde

Improve the handling of large minor numbers:

cpio/copyout.c:
Don't output a file if the major, minor or totality of its rdev would be
truncated. Print a message about the skipped files to stderr but don't
report the error in the exit status. cpio's abysmal error handling doesn't
allow continuing after an error, and the rdev checks had to be misplaced
to avoid the problem of returning an error code from routines that return
void.

pax/pax.h:
Use the system macros for major(), minor() and makedev().

pax already checks _all_ output conversions for overflow. This has the
undesirable effect that failure to convert relatively useless fields
such as st_dev for regular files causes files not to be output. pax
doesn't report exactly which fields couldn't be converted.

tar/create.c:
Don't output a file if the major or minor its rdev would be truncated.
Print a message about the skipped files to stderr and report the error
in the exit status.

tar/tar.c:
For not immediately fatal errors, exit with status 1, not the error count
(mod 256).

All:
Minor numbers are limited to 21 bits in pax's ustar format and to 18
bits in archives created by gnu tar (gnu tar wastes 3 bits for padding).
pax's and cpio's ustar format is incompatible with gnu tar's ustar
format for other reasons (see cpio/README).


9259 18-Jun-1995 ache

Additionly print strerror(errno), when getwd() fails to start
in initial directory.
Obtained from: idea from NetBSD


9258 18-Jun-1995 ache

Fix error:
which /bin/ls
.//bin/ls
Obtained from: NetBSD


9257 18-Jun-1995 ache

When filec active, TCSANOW was used in any case instead of
sensing TCSADRAIN/TCSAFLUSH
Obtained from: NetBSD


9220 14-Jun-1995 bde

Don't unlink the target file if the copy failed. This behaviour isn't
documented and is incompatible with gnu cp. It has very few good effects
(it recovers some disk space) and many bad ones:
- special files are unlinked after certain errors.
- the data may not be recoverable if the source is a special file or fifo.
- unlinking destroys the target attributes as well as the target data.
- unlinking doesn't actually remove the target data if the target is multiply
linked.


8874 30-May-1995 rgrimes

Remove trailing whitespace.


8855 30-May-1995 rgrimes

Remove trailing whitespace.

Reviewed by: phk


8308 06-May-1995 ache

Describe -m option


8294 05-May-1995 adam

typo there --> their


8289 05-May-1995 dg

From "Philippe Charnier" <charnier@lirmm.fr>:

There is a bug in sh: the built in command "fc -l" generates
a core dump (*NULL in not_fcnumber).

According to the sh manual page (fc -l [-nr] [first [last]]), fc -l
is a correct sequence (in that case, values are defaulted to -16 and -1)
but fails when first is not given.


8170 29-Apr-1995 bde

Support nonstandard (not yet all supported) flow control options. `ctsflow'
and `rtsflow' are the components of `crtscts'. `dtrflow' and `dsrflow' are
new and not yet supported. `dtrflow' may be useful for Cyclades serial
careds, which have h/w support for it and no h/w support for `rtsflow'.

print.c:
Report NTTYDISC in case the line is in this obsolescent state.


8168 29-Apr-1995 bde

Fix `stty' on the output of `stty -g'. The changes for the gfmt1 option
weren't TIOCSETD'd unless another option changed something.


8148 28-Apr-1995 ache

Fix bugs:
cchars2 not used
can't set or report MIN or TIME == 255
TIOCSETD on wrong fd
PPPDISC is not reported


7837 15-Apr-1995 dg

Install with default BINOWN (as it once used to be).


7836 15-Apr-1995 dg

Install setgid kmem rather than setuid root. The problem with procfs that
was breaking this before has been fixed.


7798 13-Apr-1995 ache

Allow root to delete uchg/uappnd files


7608 03-Apr-1995 joerg

date(1) didn't emit a final newline if the format had been specified
with `+'. This breaks tradition and violates Posix 1003.2.

Discoverd by: luigi@labinfo.iet.unipi.it (Luigi Rizzo)


7572 02-Apr-1995 bde

Add braces to fix wrong if-if-else-if nesting that broke `cp -pR' for
fifos.


7502 30-Mar-1995 phk

Make build work, even if there is no obj subdir.


7282 23-Mar-1995 phk

Having BLOCKSIZE=K and using "-k" option ls would use 2K block size...


7165 19-Mar-1995 joerg

You will find enclosed some changes to make gcc -Wall more happy in
/usr/src/bin. Note that some patches are still needed in that directory.

I (Joerg) finished most of Philippe's cleanup. /bin/sh will still
need *allot* of work, however.

Submitted by: charnier@lirmm.fr (Philippe Charnier)


6971 09-Mar-1995 dg

Fix previous fix that removes an unnecessary space; the output is now
just like it was in 1.1.5.


6908 05-Mar-1995 jkh

Allow 0 as a signal number to match the man page.
Noticed by: Mike Murphy <mrm@Sceard.COM>


6904 05-Mar-1995 joerg

Use `interactive' (foreground) delivery by default. The old behaviour
of queuing mails only can be restored by uncommenting a CFLAGS+= line
in the makefile, so sites that _really_ need this (perhaps some huge
mail hubs) can still have it. The majority of FreeBSD boxes is better
served with an immediate delivery (and last time i've been asking on
the list, nobody complained).


6804 01-Mar-1995 guido

Fix the deletion of trailing newlines with backquote expansion.
Reviewed by:
Submitted by:
Obtained from:


6488 16-Feb-1995 jkh

1000000 usec -> 1 sec 0 usec; fix.
Submitted by: "Philippe Charnier" <charnier@lirmm.fr>


6170 03-Feb-1995 bde

Include <limits.h> to get the definition of INT_MAX - don't depend on
namespace pollution in <time.h>.


5879 25-Jan-1995 dg

Fix bogus format string; fixes problem reported by Wolfram Schneider.


5702 17-Jan-1995 ache

More koshering [ul]case fix, don't use pre-initialized tables at all,
treat 0xFF as valid character.


5701 17-Jan-1995 ache

Make conv=[lu]case works with localized ctype (8bit)


5606 14-Jan-1995 ats

Submitted by: David Muir Sharnoff
domainame has referenced getdomainname(2) instead of getdomainname(3).
bug report docs/137.


5598 14-Jan-1995 alm

fixed `s' to set dot to last line affected, not the last line in
a substitution range.


5507 11-Jan-1995 paul

What I think is a more correct fix for the handling of backslashes
inside backquotes. Reversed my previous fix.


5458 09-Jan-1995 paul

Fix a bug with handling backslash escapes inside some quotes.
Should solve our problems with edit-pr.


5292 30-Dec-1994 bde

Don't strip off the last slash in the pathname "/". cp used to
stat the pathname "" in order to decide that the pathname "/" is
a directory. This caused `cp kernel /' to fail if the kernel has
the POSIX behaviour of not allowing the pathname "" to be an alias
for ".". It presumably also caused `cp /etc/motd /' to fail in
the unlikely event that "." is not stat'able.

Be more careful about concatenating pathnames: don't check that
the pathname fits until prefixes have been discarded (the check
was too strict). Print the final pathname in error messages.
Terminate the target directory name properly for error messages.
Don't add a slash between components if there is already a slash.


5249 27-Dec-1994 bde

Document the arch flag. It has always worked in 2.0.

Document aliases for the flags.

The formatting of the section describing the flags is poor.


5234 26-Dec-1994 bde

Obtained from: partly from 1.1.5

Convert "" to "." for "cd" and "cd ''". chdir("") is required to fail
on POSIX systems.


5233 26-Dec-1994 bde

Obtained from: partly from 386BSD-0.1.2.4

Fix several bugs involving the obsolescent -d and -t options:
-d 0 and -t 0 were ignored
-t -600 was a usage error
-d 'atoi is not suitable for parsing args' and -t duh were not usage errors

Change some error messages to say which call to settimeofday failed.

Restore casts of NULL in function calls.

Finish conversion to using err() instead of perror().


5158 18-Dec-1994 joerg

Make ls recognize the COLUMNS environmental variable, even
in cases where it does not run on a terminal. This is important
e.g. for commands like

env COLUMNS=132 ls -CR | lpr -Psome-wide-printer


5155 18-Dec-1994 jkh

src/bin/ed will never build DES encumbered ed again. That is the job
for secure/bin/ed ...


5002 06-Dec-1994 bde

Use lstat() instead of stat() for checking if the final source file exists,
so that `ln -fs' works when the source is a symlink pointing to a non-
existent file.


4794 24-Nov-1994 dg

Re-apply an old patchkit days fix of mine for mempages:

* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
* -------------------- ----- ----------------------
* CURRENT PATCH LEVEL: 1 00051
* -------------------- ----- ----------------------
*
* 14 Aug 92 David Greenman Fixed NEWVM mempages calculation


4714 20-Nov-1994 wollman

Add DISTRIBUTION=krb for Kerberos case.


4347 10-Nov-1994 ats

Fix an error to prevent some core dumps from ps.
You can get ps easily to core dump, if you are running a "make depend"
on a kernel in one window and a "ps -auxww" in another. The ww will
try to give you the full argument list of the command that can
now be 64Kb large, but ps expected only 4Kb large arg arrays and
doesn't check for overflows.


4204 06-Nov-1994 pst

Add end of line check so mkinit doesn't produce garbage if you have a
MKINIT line that doesn't have a comment on it (we have at least two).

This mkinit program was written by someone who obviously doesn't believe
in defensive programming. :-( There's a LOT of work that needs to be done
on this thing. :-( :-( :-(


4192 06-Nov-1994 jkh

Get this braindead, mongoloid shell look in /stand for pwd if it can't
find it in /bin. This is something of a kludge, I know, but consider
my limited alternatives: I can't make this an execvp() without making
people scream that I introduced a failure point or slowed down pwd,
and I can't make it an optional macro since crunch doesn't let you pass
arbitrary command-line args to the build of one of its crunch-ees.
This is the simplest, if not the nicest looking, solution I could come up
with.


4171 05-Nov-1994 ache

Fix group permissions check for group list size > 1
Pointed by Bruce


4170 05-Nov-1994 ache

Fix root -w case according to manpage (-x & -r cases already accords)
Pointed by Bruce.


4168 05-Nov-1994 ache

Cosmetique, missing tab/spaces after patch


4167 05-Nov-1994 ache

More complex implementation of previos superuser fix
because rw and x bit treats differently infact


4166 05-Nov-1994 ache

test produce wrong results for superuser, i.e. tells
that file is unreadable when it is readable infact.


4128 03-Nov-1994 dg

Nuked #ifdef __386BSD__ since this is not appropriate and no longer defined
in our 2.6.1 gcc port.


3989 29-Oct-1994 phk

Don't check existence of -lcrypt to decide if DES is employed,
instead check that "NOCRYPT" isn't defined.


3686 18-Oct-1994 dg

Use kvm_uread instead of kvm_read to access the upages.


3459 09-Oct-1994 ache

Back out ctype fix, unneded with new ctype


3301 02-Oct-1994 ache

Skip 'cua' 3 chars like 'tty' 3 chars


3296 02-Oct-1994 dg

On second thought...back out previous commit.


3295 02-Oct-1994 dg

Include rtprio.h


3286 02-Oct-1994 ache

libcompat removed


3197 29-Sep-1994 csgr

First level of changes for bringing in eBones (kerberos).
- Get rid of inverse logic (NOKERBEROS and NOEBONES) in src/makefile,
and replace with MAKE_KERBEROS and MAKE_EBONES. (Far fewer contortions,
and both default to off.) IF YOU WANT KERBEROS, YOU HAVE TO EXPLICITLY
DEFINE ONE OF THESE.
- Make Makefiles kerberos-aware.


3107 26-Sep-1994 wollman

Actually implement this correctly.


3044 24-Sep-1994 dg

Added $Id$


2959 21-Sep-1994 bde

Remove bogus cast that was introduced in the previous commit.


2958 21-Sep-1994 bde

Remove redundant declarations that were added in the previous commit.


2955 21-Sep-1994 ache

Make ls ctype-aware


2928 20-Sep-1994 phk

fix ln to accept -f again. Thanks Bruce. Seems that Joe Grosch isn't
quite as safe as I thought. I will have to look much closer on his
patches. Damn.


2927 20-Sep-1994 phk

Applied patch to make -Wall and -Dlint shut up.

Reviewed by: phk
Submitted by: Josef Grosch <joeg@gagme.wwa.com>


2925 20-Sep-1994 phk

The former patch to sync.c was short-lived. Bruce pointed out that
"Now it is has 2 portability bugs, which is a lot for 5 lines of working code"


2924 20-Sep-1994 phk

/home/phk/jg


2923 20-Sep-1994 phk

Applied patch to make -Wall and -Dlint shut up.

Reviewed by: phk
Submitted by: Josef Grosch <joeg@gagme.wwa.com>


2889 19-Sep-1994 pst

Add support for '-k' option to print file allocation space in 'K' instead of
system blocks.

This is semi-original code, not the same way this crufty option was handled
in FreeBSD 1.x.


2864 18-Sep-1994 wollman

Added domainname.


2862 18-Sep-1994 wollman

A new domainname(1) command based on hostname(1), this time with a correct
manual page.


2760 14-Sep-1994 sef

With '!' being made into a keyword (yech!), case cases didn't work properly.
This should fix it (passed my test cases). Originally discovered with
perl's Configure (well, in FreeBSD, I don't know how the NetBSD folks
discovered it).

Reviewed by: sef
Submitted by: jtc@cygnus.com
Obtained from: NetBSD


2675 11-Sep-1994 csgr

Make get_int() think that "" (null) has the integer value 0.
(Which is the same behaviour as in 1.x)
The install blows up without this.
Reviewed by: rgrimes


2664 11-Sep-1994 csgr

- handle signs on integers properly,
- make sure error messages for bad integers are moderately sensible
- handle test ! "abc" -o "abc" (This should evaluate to true)
(and similar cases) ie:
and/or operator test added to POSIX special case processing.
- more test cases added.

Based on: Work done on 1.x's test(1) by Andrew Moore and Adam David.


2594 08-Sep-1994 jkh

[ From Dave Tweten ]

POSIX.2 looks pretty unequivocal to me, and it agrees with you.

Under the explanation of the "-p" option, it says, "Each dir operand that
names an existing directory shall be ignored without error." Under the
explanation of exit status zero, it says, "All the specified directories were
created successfully, or the-p option was specified and all the specified
directories now exist."

Seems to me POSIX requires exactly the behavior you want.

[ And I've made the change, which is also now compatible with 1.x - jkh ]

Reviewed by: jkh
Submitted by: jkh/tweten


2502 05-Sep-1994 bde

Explicitly include <sys/types.h> before including <regex.h>. This is
apparently required by POSIX. It will be required in practice when
the bogus inclusion of <sys/types.h> is removed from <stdio.h>.


2446 01-Sep-1994 dg

Added rtprio option/field.

Submitted by: Henrik Vestergaard Draboel


2375 28-Aug-1994 bde

Add dependencies on libraries to DPADD. Someday this should be done
automagically. -lfoo has to be right to work, but ${LIBFO0} is too
easy to forget or misspell; nothing checks it and it should be
different for shared libraries.


2374 28-Aug-1994 ats

Reviewed by:
Submitted by:
Added the FTS_NOCHDIR flag to the fts-open call. This is needed, so that
the fts don't change the current directory for rm and subsequent calls
to rmdir with relative pathnames don't fail.
Pulled over the bugfix in 1.1.5.


2364 28-Aug-1994 ats

Reviewed by:
Submitted by:
Oops, overlooked another typo in this man page.


2359 28-Aug-1994 ats

Reviewed by:
Submitted by:
Correct two typos in the format string usages.


2180 21-Aug-1994 bde

Touch init.c after making it in case mkinit refused to touch it after not
changing it. mkinit's attempted smartness about timestamps is mismatched
with the makefile. init.o is compiled _twice_ the first time it is made...


2111 18-Aug-1994 dg

Got rid of stupid warning message.


2110 18-Aug-1994 dg

Got rid of extra space between args and (command).


2041 12-Aug-1994 dg

The last commit was bogus...the putenv doesn't affect the parent process,
so the BLOCKSIZE doesn't need to be preserved.
Also initialized the flags variables, and used 1k instead of 1024 for
BLOCKSIZE.


2039 12-Aug-1994 dg

Implemented the -k flag more properly...don't destroy the user's setting
of the BLOCKSIZE environment variable.


2032 11-Aug-1994 wollman

Make `ps' set-uid root so that it can read the same set of arguments
that old `ps'es did. I'm not too thrilled about this, but I'm not
enough of an FS person to hack procfs so that /proc/xxx/mem is readable
by members of group `kmem'. If this is done, then `ps' can go back to
being set-gid kmem.


2008 10-Aug-1994 wollman

Gimme back my `-k' option!
Also document `-t' option in the usage message.


1967 08-Aug-1994 jkh

WHOOPS! Put that back! Sorry, wrong Makefile.inc!
[slinks away embarassed]. It's NOSHARED again ("Gee, sorry about that
honey! I could have *sworn* the safety was on!").

Reviewed by:
Submitted by: jkh


1966 08-Aug-1994 jkh

Removed NOSHARED. "It's safe now, honey."
Reviewed by:
Submitted by: jkh


1915 07-Aug-1994 jkh

The handling of err.h and const.h were in a real tangle and didn't
work if you didn't explicitly depend first; this should both simplify
things and make it work in all circumstances.
Reviewed by:
Submitted by:


1882 06-Aug-1994 wollman

Fix some dependency bobbles.


1881 06-Aug-1994 wollman

Disable Kerberos for now.


1864 05-Aug-1994 wollman

Fix makefiles for our macros.


1856 05-Aug-1994 dg

Converted 'vmunix' to 'kernel'.


1796 23-Jul-1994 phk

Submitted by: phk
Got rid of a couple of binary files by uuencoding. 49 more to go.
BTW: ed(1) seems to have an exit(2) problem, 5 tests fail.


1633 30-May-1994 rgrimes

Need ${LDFLAGS} one more place.


1625 29-May-1994 rgrimes

Need to sue ${LDFLAGS} when building local binaries so they get built
static if ${NOSHARED}==YES. This makes it easier to bootstrap a system.


1596 28-May-1994 rgrimes

Do not build /bin shared


1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources


1557 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1556,
which included commits to RCS files with non-trunk default branches.


1411 24-Apr-1994 jkh

Fix gross spelling and typographical errors pointed out by Keith Bostic.


1410 24-Apr-1994 jkh

Fix gross spelling and typographical errors pointed out by Keith Bostic.


1297 23-Mar-1994 alm

use umask 077 for buffer file


1078 03-Feb-1994 rich

Take -lgnuregex back out. Linking with it causes 'make install' to fail.


1057 01-Feb-1994 alm

Fixed range address bug: 1,2, == 2,2 not 2,.
Overhauled the name space, reworked some modules and removed the
obsolescent Addison-Wesley copyright.


540 04-Oct-1993 jtc

Document the new, less restrictive, behavior of the matching operator.


539 04-Oct-1993 jtc

Allow expressions like "expr 'ABC' : '^.*$' to work as is done in other
expr implementations.


468 14-Sep-1993 jtc

Fix grammar to eliminate support for unary minus expressions -- they
weren't supported, they aren't standard, and they caused expr to dump
core.


340 27-Aug-1993 alm

Renamed some files that were giving SUP trouble.


339 27-Aug-1993 alm

Only a single slash (/) is now necessary to repeat a search as per Theo's
request. So the command:
/pattern/;/
finds the second line containing "pattern" after the current line.
Caveat: The commands `st' and `sr' are now both legal and have very
different meanings. This is because ed(1) extends POSIX to include the
old Berkeley syntax s[rgp]*.
(So should two slashes still be required in the case of the substitute
command, as SunOS ed does?)


295 17-Aug-1993 jtc

1003.2 requires that lexical comparisons be done in locale specific manner,
so we have to use strcoll() instead of strcmp().
1003.2 requires that a null string be returned if a string does not match
a \( \) subexpression.
Replaced fprintf/exit with calls to err and errx as appropriate.


293 16-Aug-1993 alm

Nullify pattern after failed regcomp


268 09-Aug-1993 alm

added (unsiged) cast to avoid int overflow
removed REGEX directive


230 02-Aug-1993 conklin

Remove GNU regex.[ch] and use system's regex library. The library is still
GNU regex for now, but will be replaced as soon as an alternative is made
availiable.


229 02-Aug-1993 conklin

Remove -I${.CURDIR}, as we now use system's regex.h


228 02-Aug-1993 conklin

Use ./foo.sh, so scripts work if . is not in $PATH.


227 02-Aug-1993 conklin

Use system's posix compliant regex library (GNU regex for now).


182 21-Jul-1993 conklin

install new manual page


181 21-Jul-1993 conklin

Update to my latest expr (fixes bugs with comparison and matching operators)
Add man page I wrote.


171 20-Jul-1993 nate

Libcrypt upgrade


87 02-Jul-1993 alm

Consolidate mark code - no functional changes or fixes.


49 26-Jun-1993 alm

fixed undo within a global command (would corrupt the buffer)
changed move within a global to behave as in SunOS
added a couple error messages


31 19-Jun-1993 alm

added POSIX regex to expr


17 18-Jun-1993 alm

This commit was generated by cvs2svn to compensate for changes in r16,
which included commits to RCS files with non-trunk default branches.


5 12-Jun-1993 rgrimes

This commit was generated by cvs2svn to compensate for changes in r4,
which included commits to RCS files with non-trunk default branches.