Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/usr.bin/xinstall Pull up revision 1.90 (requested by luke...



details:   https://anonhg.NetBSD.org/src/rev/b04c61c6116b
branches:  netbsd-3
changeset: 575809:b04c61c6116b
user:      tron <tron%NetBSD.org@localhost>
date:      Wed May 11 17:57:49 2005 +0000

description:
Pull up revision 1.90 (requested by lukem in ticket #287):
When creating a relative symlink (-lr), use the originally provided `to_name'
to create and metalog, rather than using the realpath(3) modified version.
Fixes a problem with -lr when -ddestdir contains a symlink.
Add some XXX comments reminding us that the `from_name' in a symlink may
point outside of destdir in the metalog, even though our build process
doesn't trigger this.

diffstat:

 usr.bin/xinstall/xinstall.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (46 lines):

diff -r 86dc0f047129 -r b04c61c6116b usr.bin/xinstall/xinstall.c
--- a/usr.bin/xinstall/xinstall.c       Wed May 11 17:56:08 2005 +0000
+++ b/usr.bin/xinstall/xinstall.c       Wed May 11 17:57:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xinstall.c,v 1.87.2.2 2005/05/10 12:43:53 tron Exp $   */
+/*     $NetBSD: xinstall.c,v 1.87.2.3 2005/05/11 17:57:49 tron Exp $   */
 
 /*
  * Copyright (c) 1987, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93";
 #else
-__RCSID("$NetBSD: xinstall.c,v 1.87.2.2 2005/05/10 12:43:53 tron Exp $");
+__RCSID("$NetBSD: xinstall.c,v 1.87.2.3 2005/05/11 17:57:49 tron Exp $");
 #endif
 #endif /* not lint */
 
@@ -506,6 +506,7 @@
                if (realpath(from_name, src) == NULL)
                        err(1, "%s: realpath", from_name);
                do_symlink(src, to_name);
+                       /* XXX: src may point outside of destdir */
                metadata_log(to_name, "link", NULL, src, NULL);
                return;
        }
@@ -546,8 +547,9 @@
 
                (void)strlcat(lnk, ++s, sizeof(lnk));
 
-               do_symlink(lnk, dst);
-               metadata_log(dst, "link", NULL, lnk, NULL);
+               do_symlink(lnk, to_name);
+                       /* XXX: lnk may point outside of destdir */
+               metadata_log(to_name, "link", NULL, lnk, NULL);
                return;
        }
 
@@ -556,6 +558,7 @@
         * try the names the user provided
         */
        do_symlink(from_name, to_name);
+               /* XXX: from_name may point outside of destdir */
        metadata_log(to_name, "link", NULL, from_name, NULL);
 }
 



Home | Main Index | Thread Index | Old Index