From nobody@FreeBSD.org  Sat Mar 30 12:32:03 2002
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (unknown [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 73E9C37B417
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 30 Mar 2002 12:32:03 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id g2UKW3M50705;
	Sat, 30 Mar 2002 12:32:03 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200203302032.g2UKW3M50705@freefall.freebsd.org>
Date: Sat, 30 Mar 2002 12:32:03 -0800 (PST)
From: eduardo viruena silva <eduardo.viruena@esfm.ipn.mx>
To: freebsd-gnats-submit@FreeBSD.org
Subject: absolute symbolic links in FreeBSD 4.5
X-Send-Pr-Version: www-1.0

>Number:         36546
>Category:       i386
>Synopsis:       absolute symbolic links in FreeBSD 4.5
>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:   Sat Mar 30 12:40:01 PST 2002
>Closed-Date:    Sun Mar 31 00:37:24 PST 2002
>Last-Modified:  Sun Mar 31 11:00:01 PST 2002
>Originator:     eduardo viruena silva
>Release:        4.5-RELEASE
>Organization:
esfm-ipn
>Environment:
FreeBSD Isabeau.esfm.ipn.mx 4.5-RELEASE FreeBSD 4.5-RELEASE #2: Thu Mar 28 23:37:37 CST 2002     root@Isabeau.esfm.ipn.mx:/usr/src/sys/compile/eviruena  i386

>Description:
There are several absolute symbolic links in FreeBSD 4.5-RELEASE.
Even though FreeBSD can work with them, they might be a problem
when an ISO image is made or when the OS is distributed to diskless
systems
>How-To-Repeat:
Install bin distribution.
>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: matusita 
State-Changed-When: Sat Mar 30 22:33:50 PST 2002 
State-Changed-Why:  
Awainting examples and lists from the original submitter. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36546 

From: Makoto Matsushita <matusita@jp.FreeBSD.org>
To: eduardo.viruena@esfm.ipn.mx
Cc: bug-followup@FreeBSD.org
Subject: Re: i386/36546: absolute symbolic links in FreeBSD 4.5
Date: Sun, 31 Mar 2002 15:32:32 +0900

 eduardo.viruena> There are several absolute symbolic links in FreeBSD
 eduardo.viruena> 4.5-RELEASE.
 
 How many symlinks did you find?  Is the list available for others?
 What's problem you encountered with such links?  Any examples?
 
 -- -
 Makoto `MAR' Matsushita

From: Eduardo Viruena Silva <mrspock@esfm.ipn.mx>
To: Makoto Matsushita <matusita@jp.FreeBSD.org>
Cc: <eduardo.viruena@esfm.ipn.mx>, <bug-followup@FreeBSD.org>
Subject: Re: i386/36546: absolute symbolic links in FreeBSD 4.5
Date: Sun, 31 Mar 2002 00:43:11 -0600 (CST)

 On Sun, 31 Mar 2002, Makoto Matsushita wrote:
 
 > Date: Sun, 31 Mar 2002 15:32:32 +0900
 > From: Makoto Matsushita <matusita@jp.FreeBSD.org>
 > To: eduardo.viruena@esfm.ipn.mx
 > Cc: bug-followup@FreeBSD.org
 > Subject: Re: i386/36546: absolute symbolic links in FreeBSD 4.5
 >
 >
 > eduardo.viruena> There are several absolute symbolic links in FreeBSD
 > eduardo.viruena> 4.5-RELEASE.
 >
 > How many symlinks did you find?  Is the list available for others?
 
 Hello,
 
 I found about five, try:
 
 	find / -type l -exec ls -l {}\;  | grep " /"
 
 > What's problem you encountered with such links?
 
 I think the real problem happened when I load a package [mtools],
 not with the bin distrubution itself.
 
 I was installing a diskless workstation.  In the server I do not have
 a floppy disk driver and I did not installed mtools.  In the client
 I had the need of using floppies.  I installed the client operating system
 in a disk slice and mounted it in the server [let us say in "/dl"
 directory].  I exported "/dl" with all its directories; installed mtools
 and it crossed the file systems.  dl/usr/local/bin/mwrite ->
 /usr/local/bin/mtools and I could not use mcopy in the client.
 
 
 > Any examples?
 
 read above.
 
 
 >
 > -- -
 > Makoto `MAR' Matsushita
 >
 
 -                         ______                     _
             *           /   /###\                   / \       __
  /\  /\             *  /  ./#### \         *     \__|_/      |  |
 /  \/  \               |   b#####|   *            _ |   __   |  |  __
 =    .. \____          \ \_\#####/               / \|  /  \  |  | /\_\/
 =          \_|    *     \___\###/       *        \_/\_/\__/\__\/_/\__/
  =   \______/           _
   | |
 
 

From: Makoto Matsushita <matusita@jp.FreeBSD.org>
To: bug-followup@FreeBSD.org
Cc: Eduardo Viruena Silva <mrspock@esfm.ipn.mx>
Subject: Re: i386/36546: absolute symbolic links in FreeBSD 4.5
Date: Sun, 31 Mar 2002 16:09:47 +0900

 mrspock>  I found about five, try:
 
 Ok, here it is the list:
 
 	/etc/termcap (-> /usr/share/misc/termcap)
 	/etc/rmt (-> /usr/sbin/rmt)
 	/usr/bin/newaliases (-> /usr/sbin/mailwrapper)
 	/usr/bin/mailq (-> /usr/sbin/mailwrapper)
 	/usr/sbin/sendmail (-> /usr/sbin/mailwrapper)
 
 mrspock>  I was installing a diskless workstation.  In the server I do
 mrspock>  not have a floppy disk driver and I did not installed
 mrspock>  mtools.  In the client I had the need of using floppies.  I
 mrspock>  installed the client operating system in a disk slice and
 mrspock>  mounted it in the server [let us say in "/dl" directory].  I
 mrspock>  exported "/dl" with all its directories; installed mtools
 mrspock>  and it crossed the file systems.  dl/usr/local/bin/mwrite ->
 mrspock>  /usr/local/bin/mtools and I could not use mcopy in the
 mrspock>  client.
 
 I assume that in this example, /dl is a "root" directory for this
 diskless workstation, right?  If yes, /dl/usr/local/bin should be
 treated as /usr/local/bin to this diskless workstation, so this
 symlink should work as it should be...
 
 -- -
 Makoto `MAR' Matsushita

From: Eduardo Viruena Silva <mrspock@esfm.ipn.mx>
To: Makoto Matsushita <matusita@jp.FreeBSD.org>
Cc: <bug-followup@FreeBSD.org>
Subject: Re: i386/36546: absolute symbolic links in FreeBSD 4.5
Date: Sun, 31 Mar 2002 01:29:00 -0600 (CST)

 On Sun, 31 Mar 2002, Makoto Matsushita wrote:
 
 > Date: Sun, 31 Mar 2002 16:09:47 +0900
 > From: Makoto Matsushita <matusita@jp.FreeBSD.org>
 > To: bug-followup@FreeBSD.org
 > Cc: Eduardo Viruena Silva <mrspock@esfm.ipn.mx>
 > Subject: Re: i386/36546: absolute symbolic links in FreeBSD 4.5
 >
 >
 > mrspock>  I found about five, try:
 >
 > Ok, here it is the list:
 >
 > 	/etc/termcap (-> /usr/share/misc/termcap)
 > 	/etc/rmt (-> /usr/sbin/rmt)
 > 	/usr/bin/newaliases (-> /usr/sbin/mailwrapper)
 > 	/usr/bin/mailq (-> /usr/sbin/mailwrapper)
 > 	/usr/sbin/sendmail (-> /usr/sbin/mailwrapper)
 >
 > mrspock>  I was installing a diskless workstation.  In the server I do
 > mrspock>  not have a floppy disk driver and I did not installed
 > mrspock>  mtools.  In the client I had the need of using floppies.  I
 > mrspock>  installed the client operating system in a disk slice and
 > mrspock>  mounted it in the server [let us say in "/dl" directory].  I
 > mrspock>  exported "/dl" with all its directories; installed mtools
 > mrspock>  and it crossed the file systems.  dl/usr/local/bin/mwrite ->
 > mrspock>  /usr/local/bin/mtools and I could not use mcopy in the
 > mrspock>  client.
 >
 > I assume that in this example, /dl is a "root" directory for this
 > diskless workstation, right?  If yes, /dl/usr/local/bin should be
 > treated as /usr/local/bin to this diskless workstation, so this
 > symlink should work as it should be...
 
 Sorry, I think I make something wrong.
 You are right it works.
 Nevertheless, wouldn't be better to have relative symbolic links?
 
 >
 > -- -
 > Makoto `MAR' Matsushita
 >
 
 -                         ______                     _
             *           /   /###\                   / \       __
  /\  /\             *  /  ./#### \         *     \__|_/      |  |
 /  \/  \               |   b#####|   *            _ |   __   |  |  __
 =    .. \____          \ \_\#####/               / \|  /  \  |  | /\_\/
 =          \_|    *     \___\###/       *        \_/\_/\__/\__\/_/\__/
  =   \______/           _
   | |
 
 

From: Makoto Matsushita <matusita@jp.FreeBSD.org>
To: Eduardo Viruena Silva <mrspock@esfm.ipn.mx>
Cc: bug-followup@FreeBSD.org
Subject: Re: i386/36546: absolute symbolic links in FreeBSD 4.5
Date: Sun, 31 Mar 2002 17:08:02 +0900

 mrspock>  Nevertheless, wouldn't be better to have relative symbolic links?
 
 Yes, but if relative symlink points the correct file/directory.
 
 Someone may want to setup as follows:
 
 	mkdir /disk1
 	mkdir /disk2
 	mount /dev/xxx0a /disk1
 	mount /dev/xxx0b /disk2
 	cd /usr
 	(cd bin; tar cf - ) | (cd /disk1; tar xpf -); rm -rf bin
 	(cd sbin; tar cf - ) | (cd /disk2; tar xpf -); rm -rf sbin
 	ln -s /disk1 /usr/bin
 	ln -s /disk2 /usr/sbin
 
 In this example, if you change /usr/bin/mailq is a symlink to
 ../sbin/mailwrapper, it is treated as /sbin/mailwrapper and it's wrong
 location.  Yes this is a radical case, but it shows the potential
 problem of using relative path symlink.
 
 -- -
 Makoto `MAR' Matsushita

From: Eduardo Viruena Silva <mrspock@esfm.ipn.mx>
To: Makoto Matsushita <matusita@jp.FreeBSD.org>
Cc: <bug-followup@FreeBSD.org>
Subject: Re: i386/36546: absolute symbolic links in FreeBSD 4.5
Date: Sun, 31 Mar 2002 02:18:23 -0600 (CST)

 On Sun, 31 Mar 2002, Makoto Matsushita wrote:
 
 > Date: Sun, 31 Mar 2002 17:08:02 +0900
 > From: Makoto Matsushita <matusita@jp.FreeBSD.org>
 > To: Eduardo Viruena Silva <mrspock@esfm.ipn.mx>
 > Cc: bug-followup@FreeBSD.org
 > Subject: Re: i386/36546: absolute symbolic links in FreeBSD 4.5
 >
 >
 > mrspock>  Nevertheless, wouldn't be better to have relative symbolic links?
 >
 > Yes, but if relative symlink points the correct file/directory.
 >
 > Someone may want to setup as follows:
 >
 > 	mkdir /disk1
 > 	mkdir /disk2
 > 	mount /dev/xxx0a /disk1
 > 	mount /dev/xxx0b /disk2
 > 	cd /usr
 > 	(cd bin; tar cf - ) | (cd /disk1; tar xpf -); rm -rf bin
 > 	(cd sbin; tar cf - ) | (cd /disk2; tar xpf -); rm -rf sbin
 > 	ln -s /disk1 /usr/bin
 > 	ln -s /disk2 /usr/sbin
 >
 > In this example, if you change /usr/bin/mailq is a symlink to
 > ../sbin/mailwrapper, it is treated as /sbin/mailwrapper and it's wrong
 > location.  Yes this is a radical case, but it shows the potential
 > problem of using relative path symlink.
 
 oops!  yes, you are right again.
 please close my report.
 
 [I made two reports, one for ports/mtools and this one, please, close this
 one].
 
 >
 > -- -
 > Makoto `MAR' Matsushita
 >
 
 
State-Changed-From-To: feedback->closed 
State-Changed-By: matusita 
State-Changed-When: Sun Mar 31 00:36:40 PST 2002 
State-Changed-Why:  
The original submitter requests to close this PR, thank you! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36546 

From: Giorgos Keramidas <keramida@freebsd.org>
To: Eduardo Viruena Silva <mrspock@esfm.ipn.mx>
Cc: bug-followup@freebsd.org
Subject: Re: i386/36546: absolute symbolic links in FreeBSD 4.5
Date: Sun, 31 Mar 2002 16:40:18 +0300

 Eduardo Viruena Silva wrote:
 > I was installing a diskless workstation.  In the server I do
 > not have a floppy disk driver and I did not installed
 > mtools.  In the client I had the need of using floppies.  I
 > installed the client operating system in a disk slice and
 > mounted it in the server [let us say in "/dl" directory].  I
 > exported "/dl" with all its directories; installed mtools
 > and it crossed the file systems.  dl/usr/local/bin/mwrite ->
 > /usr/local/bin/mtools and I could not use mcopy in the
 > client.
 
 If the server and diskless client run the same OS, you can always use
 chroot(8) in situations like these, to make sure all files end up where
 they're supposed to be, and packages install correctly for the diskless
 client machine:
 
 	server:/tmp# mkdir /diskless/foo/pkg
 	server:/tmp# cp *.tgz /diskless/foo/pkg
 	server:/tmp# chroot /diskless/foo
 	server:/# pkg_add /pkg/bar.tgz
 	server:/# rm -fr /pkg
 	server:/# exit
 	server:/tmp# _
 
 - Giorgos
>Unformatted:
