From shigio@wafu.netgate.net  Thu Jul 16 06:16:35 1998
Received: from wafu.netgate.net (wafu.netgate.net [204.145.147.80])
          by hub.freebsd.org (8.8.8/8.8.8) with SMTP id GAA08055
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Jul 1998 06:16:32 -0700 (PDT)
          (envelope-from shigio@wafu.netgate.net)
Received: (qmail 22561 invoked from network); 16 Jul 1998 05:16:17 -0000
Received: from ins15.tama-ap3.dti.ne.jp (HELO choota.signet.or.jp) (203.181.67.15)
  by wafu.netgate.net with SMTP; 16 Jul 1998 05:16:17 -0000
Received: (from shigio@localhost) by choota.signet.or.jp (8.8.7/) id WAA00734; Thu, 16 Jul 1998 22:18:05 +0900 (JST)
Message-Id: <199807161316.GAA08055@hub.freebsd.org>
Date: Thu, 16 Jul 1998 22:18:05 +0900 (JST)
From: shigio@wafu.netgate.net
Reply-To: shigio@wafu.netgate.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: Improvements to ln(1).
X-Send-Pr-Version: 3.2

>Number:         7298
>Category:       bin
>Synopsis:       Improvements to ln(1).
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 16 06:20:01 PDT 1998
>Closed-Date:    Sun Jun 10 07:29:16 PDT 2001
>Last-Modified:  Sun Jun 10 07:35:16 PDT 2001
>Originator:     Shigio Yamaguchi
>Release:        FreeBSD 2.2.5-RELEASE i386
>Organization:
Freelance programmer
>Environment:

	All environment.

>Description:

	I have hacked ln(1) and added -r and -a option.

	     -a    If the -s option is specified, make absolute symbolic link.
	     -r    If the -s option is specified, make relative symbolic link.
	     The -a and -r options override each other; the last one specified deter-
	     mines the method used.

	These options work like follows.

	% cd /usr/src/sys
	% ln -sfr kern/tty.c /usr/obj/usr/src/sys/kern
	% ls -l /usr/obj/usr/src/sys/kern/tty.c
	lrwxrwxrwx  1 shigio  bin  29 Jul 16 21:55 /usr/obj/usr/src/sys/kern/tty.c ->
					../../../../../src/kern/tty.c
					~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
					(right and relative symbolic link)

	% cd /usr/src/sys
	% ln -sfa kern/tty.c /usr/obj/usr/src/sys/kern
	% ls -l /usr/obj/usr/src/sys/kern/tty.c
	lrwxrwxrwx  1 shigio  bin  19 Jul 16 21:57 /usr/obj/usr/src/sys/kern/tty.c ->
					/usr/src/kern/tty.c
					~~~~~~~~~~~~~~~~~~~
					(right and absolute symbolic link)

	Note that both symbolic links are right.

>How-To-Repeat:

	It is not a bug but neither -r nor -a option specified, the result is

	% cd /usr/src/sys
	% ln -sf kern/tty.c /usr/obj/usr/src/sys/kern
	% ls -l /usr/obj/usr/src/sys/kern/tty.c
	lrwxrwxrwx  1 shigio  bin  10 Jul 16 21:59 /usr/obj/usr/src/sys/kern/tty.c ->
					kern/tty.c
					~~~~~~~~~~
					(wrong symbolic link)
	% cat /usr/obj/usr/src/sys/kern/tty.c
	cat: /usr/obj/usr/src/sys/kern/tty.c: No such file or directory

>Fix:
	
	Source code is here. It includes Makefile, related library source and
	online manuals too.

	ftp://ftp.freebsd.org/pub/FreeBSD/incoming/pathconvert4.tar.gz

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: schweikh 
State-Changed-When: Sun Jun 10 07:29:16 PDT 2001 
State-Changed-Why:  
Absolute symlinks are almost often evil (e.g. when accessed 
on a remote system via NFS), so -a is something we should not 
encourage. For relative symlinks ln(1) works when used with 
proper args and cwd so the need for -r IMHO isn't strong 
enough to add an option that would make us diverge from the 
other BSDs. But thanks anyway for the suggestion! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=7298 
>Unformatted:
