summaryrefslogtreecommitdiffstats
path: root/bin/ln
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-05-24 20:36:16 +0000
committerpeter <peter@FreeBSD.org>1996-05-24 20:36:16 +0000
commitcc2ce1192f9a9eebc231703e998cbb54e7b0fc6e (patch)
treed1fa7974bd1eb3976392df03b988e3a400f7b23a /bin/ln
parent5451e1edfb7de7db47cc43e555bdefcce560f48b (diff)
downloadFreeBSD-src-cc2ce1192f9a9eebc231703e998cbb54e7b0fc6e.zip
FreeBSD-src-cc2ce1192f9a9eebc231703e998cbb54e7b0fc6e.tar.gz
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)
Diffstat (limited to 'bin/ln')
-rw-r--r--bin/ln/ln.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/bin/ln/ln.c b/bin/ln/ln.c
index 73fffa7..b9c4f3f 100644
--- a/bin/ln/ln.c
+++ b/bin/ln/ln.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ln.c,v 1.4 1994/09/24 02:55:48 davidg Exp $
+ * $Id: ln.c,v 1.5 1994/12/06 18:50:44 bde Exp $
*/
#ifndef lint
@@ -53,7 +53,6 @@ static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
#include <string.h>
#include <unistd.h>
-int dirflag; /* Undocumented directory flag. */
int fflag; /* Unlink existing files. */
int sflag; /* Symbolic, not hard, link. */
/* System link call. */
@@ -72,11 +71,8 @@ main(argc, argv)
int ch, exitval;
char *sourcedir;
- while ((ch = getopt(argc, argv, "Ffs")) != EOF)
+ while ((ch = getopt(argc, argv, "fs")) != EOF)
switch (ch) {
- case 'F':
- dirflag = 1; /* XXX: deliberately undocumented. */
- break;
case 'f':
fflag = 1;
break;
@@ -127,9 +123,10 @@ linkit(target, source, isdir)
warn("%s", target);
return (1);
}
- /* Only symbolic links to directories, unless -F option used. */
- if (!dirflag && (sb.st_mode & S_IFMT) == S_IFDIR) {
- warnx("%s: is a directory", target);
+ /* Only symbolic links to directories. */
+ if (S_ISDIR(sb.st_mode)) {
+ errno = EISDIR;
+ warn("%s", target);
return (1);
}
}
OpenPOWER on IntegriCloud