aboutsummaryrefslogtreecommitdiff
path: root/bin/ln
Commit message (Collapse)AuthorAgeFilesLines
* symlink.7: add a new section "mount options"Wolfram Schneider2026-01-191-2/+19
| | | | | | | Add a new section "mount options" to explain the mount option nosymfollow in more details. Differential Revision: https://reviews.freebsd.org/D54530
* ln: Simplify sameness checksDag-Erling Smørgrav2025-10-071-1/+1
| | | | | | Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D52927
* ln: Tweak append logic.Dag-Erling Smørgrav2025-04-152-8/+32
| | | | | | | | | | | If the target is "." or ends in "/" or "/.", we always want to append the source's basename, even in the Fflag case. MFC after: never Relnotes: yes Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D49842
* faccessat(2): Honor AT_SYMLINK_NOFOLLOWFernando Apesteguía2024-08-111-1/+2
| | | | | | | | | | | | Make the system call honor `AT_SYMLINK_NOFOLLOW`. Also enable this from `linux_faccessat2` where the issue arised the first time. Update manual pages accordingly. PR: 275295 Reported by: kenrap@kennethraplee.com Approved by: kib@ Differential Revision: https://reviews.freebsd.org/D46267
* Remove residual blank line at start of MakefileWarner Losh2024-07-152-2/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* ln: Improve link(1) variant of ln(1).Dag-Erling Smørgrav2024-04-042-14/+83
| | | | | | | | | | | | * Give link(1) its own usage message. * Use getprogname(3) instead of rolling our own. * Verify that the target file does not already exist. * Add tests specific to link(1). MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44635
* ln: Add a test case for ln -sfF.Dag-Erling Smørgrav2024-03-271-0/+17
| | | | | | | MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude, asomers Differential Revision: https://reviews.freebsd.org/D44513
* ln: Clean up and simplify tests.Dag-Erling Smørgrav2024-03-271-48/+20
| | | | | | | MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44512
* ln: Use stdbool, style nits.Dag-Erling Smørgrav2024-03-271-37/+39
| | | | | | | MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp, allanjude Differential Revision: https://reviews.freebsd.org/D44511
* Remove copyright strings ifdef'd outWarner Losh2023-11-271-9/+0
| | | | | | | | | | | We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
* bin: Remove ancient SCCS tags.Warner Losh2023-11-274-8/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-165-5/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* DIRDEPS_BUILD: Connect new directories.Bryan Drewery2017-10-311-0/+11
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325187
* Add HAS_TESTS to all Makefiles that are currently using theEnji Cooper2017-08-021-0/+1
| | | | | | | | | `SUBDIR.${MK_TESTS}+= tests` idiom. This is a follow up to r321912. Notes: svn path=/projects/make-check-sandbox/; revision=321914
* Convert traditional ${MK_TESTS} conditional idiom for including testEnji Cooper2017-08-021-3/+1
| | | | | | | | | | | | | | directories to SUBDIR.${MK_TESTS} idiom This is being done to pave the way for future work (and homogenity) in ^/projects/make-check-sandbox . No functional change intended. MFC after: 1 weeks Notes: svn path=/head/; revision=321912
* Don't expect :sF_flag to fail anymoreEnji Cooper2017-06-201-1/+1
| | | | | | | | | | | | | | | While here, also add a check to verify that the link target is updated in the testcase MFC after: 1 month MFC with: r320172 PR: 219943 Differential Revision: D11167 Submitted by: shivansh Sponsored by: Google (GSoC 2017) Notes: svn path=/head/; revision=320173
* ln(1): fix -F behaviorEnji Cooper2017-06-201-3/+3
| | | | | | | | | | | | | | | | | | | | | When '-F' option is used, the target directory needs to be unlinked. Currently, the modified target ("target/source") is being unlinked, and since it doesn't yet exist, the original target isn't removed. This is fixed by skipping the block where target is modified to "target/source" when '-F' option is set. Hence, a symbolic link (with the same name as of the original target) to the source_file is produced. Update the test for ln(1) to reflect fix for option '-F' MFC after: 1 month PR: 219943 Differential Revision: D11167 Submitted by: shivansh Sponsored by: Google (GSoC 2017) Notes: svn path=/head/; revision=320172
* Style fixes: clean up leading whitespace (8 single column spaces -> \t)Enji Cooper2017-06-121-101/+101
| | | | | | | | MFC after: 1 month MFC with: r319714, r319854, r319855, r319856 Notes: svn path=/head/; revision=319858
* ln(1): wordsmith -F option descriptionEnji Cooper2017-06-121-3/+7
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=319857
* Add a testcase for `ln -sF`Enji Cooper2017-06-121-0/+17
| | | | | | | | | | | | | | | | | | The testcase fails today, so mark it with atf_expect_fail: in particular, the target (B) isn't being unlinked and the documentation doesn't suggest special handling for directories. Thus, there's either a doc or an implementation bug in ln(1) that needs to be resolved. MFC after: 1 month MFC with: r319714, r319854, r319855 PR: 219943 Reviewed by: ngie Submitted by: shivansh Differential Revision: D11159 (part of a larger diff) Sponsored by: Google, Inc (GSoC 2017) Notes: svn path=/head/; revision=319856
* Use readlink(1)/stat(1) to query symlinks instead of file(1)Enji Cooper2017-06-121-7/+14
| | | | | | | | | | | | | | | | file(1) can be compiled out of the system via MK_FILE == no, and the output isn't guaranteed to be stable. It's better to use stat(1)/readlink(1) instead to query symlink/file paths. MFC after: 1 month MFC with: r319714, r319854 Reported by: ngie Submitted by: shivansh Differential Revision: D11159 (part of a larger diff) Sponsored by: Google, Inc (GSoC 2017) Notes: svn path=/head/; revision=319855
* bin/ln: Set umask appropriately before creating files for testingAlan Somers2017-06-121-0/+3
| | | | | | | | | | | | | | These changes were missed in D11084 Submitted by: shivansh Reviewed by: asomers MFC after: 1 month X-MFC-With: 319714 Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11158 Notes: svn path=/head/; revision=319854
* Add tests for ln(1)Alan Somers2017-06-083-0/+228
| | | | | | | | | | | | | | | | | | | | | | | | | * Verify that when creating a hard link to a symbolic link, '-L' option creates a hard link to the target of the symbolic link * Verify that when creating a hard link to a symbolic link, '-P' option creates a hard link to the symbolic link itself * Verify that if the target file already exists, '-f' option unlinks it so that link may occur * Verify that if the target file or directory is a symbolic link, '-shf' option prevents following the link * Verify that if the target file or directory is a symbolic link, '-snf' option prevents following the link * Verify that '-s' option creates a symbolic link * Verify that '-w' option produces a warning if the source of a symbolic link does not currently exist Submitted by: shivansh Reviewed by: asomers, ngie MFC after: 1 month Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11084 Notes: svn path=/head/; revision=319714
* Renumber copyright clause 4Warner Losh2017-02-283-3/+3
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Explicitly add unmarked bin/ binaries to the runtime package.Glen Barber2016-02-091-0/+1
| | | | | | | | | | | Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate package, which requires pre-install/post-install scripts, to be added later. Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295439
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-11/+12
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Merge from headSimon J. Gerraty2013-09-051-4/+4
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | Sync with HEAD.David E. O'Brien2013-02-081-1/+1
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246555
| * \ \ Sync from headSimon J. Gerraty2012-11-041-1/+65
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | symlink(7): Mention chflagsat() (can take AT_SYMLINK_NOFOLLOW).Jilles Tjoelker2015-02-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=278848
* | | | | Add futimens and utimensat system calls.Jilles Tjoelker2015-01-231-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The core kernel part is patch file utimes.2008.4.diff from pluknet@FreeBSD.org. I updated the code for API changes, added the manual page and added compatibility code for old kernels. There is also audit and Capsicum support. A new UTIME_* constant might allow setting birthtimes in future. Differential Revision: https://reviews.freebsd.org/D1426 Submitted by: pluknet (partially) Reviewed by: delphij, pluknet, rwatson Relnotes: yes Notes: svn path=/head/; revision=277610
* | | | | symlink(7): Note that stat(1) does not follow symlinks by default.Jilles Tjoelker2014-12-291-9/+8
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=276359
* | | | Add 'static' where able.Eitan Adler2013-06-021-4/+4
| |_|/ |/| | | | | | | | Notes: svn path=/head/; revision=251261
* | | Fix wording nit.Glen Barber2012-12-281-1/+1
| |/ |/| | | | | | | | | | | | | | | PR: 174787 Submitted by: Cody Rank MFC after: 3 days Notes: svn path=/head/; revision=244791
* | Add a couple of examples.Joel Dahl2012-11-021-1/+65
|/ | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=242499
* Put some static keywords in the source code.Ed Schouten2011-10-311-9/+9
| | | | | | | | | For these simple utilities, it doesn't harm to make all global variables static. In fact, this allows the compiler to perform better forms of optimisation and analysis. Notes: svn path=/head/; revision=226961
* bin: Prefer strrchr() to rindex().Jilles Tjoelker2011-03-151-1/+1
| | | | | | | This removes the last index/rindex usage from /bin. Notes: svn path=/head/; revision=219680
* Spelling fixes.Joel Dahl2010-07-311-1/+1
| | | | Notes: svn path=/head/; revision=210702