summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant close(2).trasz2008-09-091-1/+0
| | | | | Submitted by: kensmith Approved by: rwatson (mentor)
* Fix double free in setfacl(1). Description from the author:trasz2008-09-061-4/+6
| | | | | | | | | | | | | | 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)
* pkill(1) first appeared in /usr/bin, but later it was moved to /binyar2008-08-314-0/+1062
| | | | | | | 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
* Document the ulimit -p option in the sh(1) manual page.ed2008-08-301-1/+3
| | | | | | | 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
* Fix a bug in r177497 which caused the getopts state to be reset when 'set'stefanf2008-08-271-1/+1
| | | | | | was used to set a shell option (and not to change the positional parameters). Submitted by: Martin Kammerhofer
* Make stty(1) use tab0 and tab3 to handle tab completion.ed2008-08-233-8/+23
| | | | | | | | | | 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.
* Integrate the new MPSAFE TTY layer to the FreeBSD operating system.ed2008-08-201-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix ACL preservation, apparently broken in 1.47.trasz2008-08-071-1/+3
| | | | | Approved by: rwatson MFC after: 3 weeks
* Mark functions as __dead2 in order to help the LLVM static checkercperciva2008-08-043-3/+3
| | | | | | | 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".
* Pass the correct flags to expandarg() for NFROMFD and NTOFD. This fixes astefanf2008-07-301-1/+1
| | | | | | | segmentation fault when the argument expands to an empty string. Reported by: simon MFC after: 3 weeks
* Staticify symbols that will not be used in otherdelphij2008-07-191-11/+11
| | | | places.
* Remove unnessasary castkevlo2008-07-181-1/+1
|
* Remove OTTYDISC, NETLDISC and NTTYDISC definitions.ed2008-07-161-5/+0
| | | | | | | | | | | | | | | | 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)
* Add hard sentence breaks.csjp2008-07-061-8/+10
| | | | | Pointed out by: rwatson MFC after: 1 week
* Document default ACLs and how to use them.csjp2008-07-061-0/+16
| | | | MFC after: 1 week
* use 'const' for the parameters of the two static functions unalias() and ↵rse2008-06-071-4/+4
| | | | hashalias()
* remove an unnecessary includerse2008-06-071-1/+0
|
* Unbreak last commit to ln for amd64.keramida2008-06-071-1/+1
| | | | | | | | 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
* Add a -w warning flag to ln(1). When the -w option is enabled,keramida2008-06-062-7/+47
| | | | | | | | | | | 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
* Fix checking if a variable name is LINENO. As STPUTC changes the pointer if itstefanf2008-05-281-2/+5
| | | | | | needs to enlarge the buffer, we must not keep a pointer to the beginning. PR: ports/123879
* Expand $LINENO to the current line number. This is required by SUSv3's "Userstefanf2008-05-153-7/+35
| | | | | | | | | 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
* Sigh, when reapplying the patch to HEAD, I somehow forgot to commit this file.stefanf2008-04-281-6/+3
| | | | Reported by: Jaakko Heinonen
* - Fix bugs where the value of arithmetic expansion$((...)) was trucatedstefanf2008-04-273-14/+29
| | | | | | | | | | | 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)
* Turn a tab into a space. This fixes a misalignment for ls -l.imp2008-04-051-2/+2
| | | | Tabs Noticed by: Antoine Brodin
* - Add -D to usage().ru2008-04-042-4/+5
| | | | | - Bump document date for the addition of the -D option. - Reformat a sentence to look like a real sentence.
* Add -D option to specify exact format of date and time output with ls -l.grog2008-04-044-16/+46
|
* Reset the internal state used for the 'getopts' built-in when 'shift' or 'set'stefanf2008-03-221-2/+2
| | | | | | | | 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
* uuidgen has been repo-copied from usr.bin/ to bin/ to match its "new"obrien2008-03-132-3/+2
| | | | (2007/04/09) installation location.
* - P_SA has been removed.jeff2008-03-121-1/+0
|
* Add an '-a' option which is identical to specifying '-RpP' forjhb2008-03-103-5/+15
| | | | | | compatibility with other implementations. MFC after: 1 month
* Enhance realpath(1) in a number of ways:rwatson2008-03-092-7/+34
| | | | | | | | | | | | | - 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>
* Make chflags(1) more chmod(1)-like (and more feature complete):rwatson2008-03-092-17/+43
| | | | | | | | | | | | | | - 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>
* Split updatepwd() into two smaller functions. The first one, findpwd(),stefanf2008-02-241-38/+45
| | | | | | | | | | 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
* Fix "warning: comparison is always false due to limited range of data type"marcel2008-02-181-4/+1
| | | | | | | 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...
* Don't reset DST computed by strptime() (when e.g. setting theru2008-02-071-6/+3
| | | | | | | date via -f %s). Reported by: Eugene Grosbein Diagnosed by: Miguel Lopes Santos Ramos
* - Roll-back attempts to mimic rename(2) atomicity introduced in 1.47,dds2007-12-271-95/+69
| | | | | | | | | | | | | | 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
* As suggested, replace earlier changed warnx() / exit() with an errx()edwin2007-12-261-4/+3
| | | | Submitted by: Peter Jeremy <peterjeremy@optushome.com.au>
* When copying multiple files to a directory, make sure that a properedwin2007-12-251-1/+1
| | | | | | | | | 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@
* Calling any function from vfork other than exec* and _exit yieldsdds2007-12-171-3/+9
| | | | | | undefined behavior. Noted by: alfred
* Eliminate gcc "variable clobbered" warnings by declaring the variablesdds2007-12-161-1/+2
| | | | | | living across the vfork as volatile. Noted by: kan
* When moving a directory across devices to a place where a directorydds2007-12-161-22/+82
| | | | | | | | | | | | | | | | | 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
* Move WARNS as ed(1) also is only WARNS = 2 clean in the !DES case.marius2007-12-091-1/+1
| | | | | | | | | 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
* Revise the markup.ru2007-12-051-275/+382
|
* Reduce the WARNS level to avoid a compiler warning about a variablejb2007-11-181-1/+1
| | | | possibly being clobbered by a longjmp or a fork with gcc4.
* Express in the usage() and SYNOPSIS that -F depends on -s, andru2007-11-172-4/+8
| | | | that -f and -i are exclusive.
* Swap "source"/"target" where appropriate, to match documentation.ru2007-11-171-38/+38
|
* Teach ps(1) to parse pts TT values (i.e. '0', '1') for the -t flag.jhb2007-11-081-9/+23
| | | | | MFC after: 1 week Reported by: kris
* Bump document date on behalf of previous revision.ru2007-11-011-1/+1
|
* fix sorting of 'tdnam' keyword in keyword list.julian2007-10-281-2/+1
|
* Introduce a way to make pure kernal threads.julian2007-10-264-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
OpenPOWER on IntegriCloud