| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
Update the list of the process flags for P_WKILLED.
|
| |
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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.
PR: 121568
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
These may be NFS mounted, and we should not touch them unless we are going
to do something useful with the information.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 may 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'
|
|
|
|
| |
as required by POSIX.
|
|
|
|
|
| |
Update the list of the process flags. Note that the lists of pending
signals for process and its threads are distinct.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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.
PR: bin/88056
Initial patch by: Graham J Lee leeg teaching.physics.ox.ac.uk
|
|
|
|
|
|
|
|
|
| |
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
Approved by: trasz (mentor)
|
|
|
|
| |
Fix breakage introduced in last commit.
|
|
|
|
|
| |
Improve ACL branding mismatch detection and reporting in some rare cases,
such as "setfacl -m ''".
|
|
|
|
| |
Add NFSv4 support to setfacl(1).
|
|
|
|
| |
Add NFSv4 ACL support to mv(1).
|
|
|
|
| |
Add NFSv4 ACL support to getfacl(1).
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
|
| |
Add NFSv4 ACL support to ls(1).
MFC r196773:
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.
|
|
|
|
|
| |
Make the code more readable and fix chmod(1) on symlinks with
NFSv4 enabled.
|
|
|
|
|
|
|
|
|
| |
(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)
|
| |
|
| |
|
|
|
|
|
| |
PR: bin/141835
Submitted by: Henning Petersen <henning.petersen t-online.de>
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
| |
like $((x)).
|
|
|
|
|
|
| |
Fix small resource leak (memory).
Reviewed by: gad
|
|
|
|
|
|
|
| |
I do not consider this a bug because POSIX permits it and argument strings
and environment variables cannot contain '\0' anyway.
PR: bin/25542
|
|
|
|
| |
Approved by: re (kib)
|
|
|
|
|
|
|
|
|
|
|
| |
sh: Fix crash when undefining or redefining a currently executing function
Add a reference count to function definitions.
Memory may leak if a SIGINT arrives in interactive mode at exactly the wrong
time, this will be fixed later by changing SIGINT handling.
PR: bin/137640
Approved by: re (kib)
|
|
|
|
|
|
| |
Submitted by: Emil Mikulic - emil at dmr dot ath dot cx
Approved by: re (kib)
MFC after: 1 week
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
| |
Approved by: re (kib)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
| |
We now pass the ifs.sh testsuite.
PR: standards/79067
Approved by: ed (mentor) (implicit)
Obtained from: NetBSD
|
|
|
|
|
|
| |
Also document various properties of special builtins that we implement.
Approved by: ed (mentor) (implicit)
|
| |
|
|
|
|
|
|
| |
It is usually but not always suitable for re-input to the shell.
Approved by: ed (mentor) (implicit)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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)
|
|
|
|
|
|
|
|
|
|
|
| |
- 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)
|