Subject: Re: bug#15173: [cp] --link overrides dereference settings

From: Pádraig Brady <[email-masked]>
Date: Mon, 09 Dec 2013 02:24:44 +0000

Sorry if you get multiple copies of this.

The test for this is failing on solaris 10 (NFS)
It does seem that hardlinks to symlinks are supported:

$ touch tfile
$ ln -s tfile tlink
$ src/ln -L tlink tlink-ln-L
$ src/ln -P tlink tlink-ln-P
$ src/ln tlink tlink-ln
$ ls -li tfile tlink*
      8550 -rw-r--r--   3 padraig  csw            0 Dec  9 01:18 tfile
      8551 lrwxrwxrwx   2 padraig  csw            5 Dec  9 01:19 tlink -> tfile
      8550 -rw-r--r--   3 padraig  csw            0 Dec  9 01:18 tlink-ln
      8550 -rw-r--r--   3 padraig  csw            0 Dec  9 01:18 tlink-ln-L
      8551 lrwxrwxrwx   2 padraig  csw            5 Dec  9 01:19 tlink-ln-P -> tfile

But we have linkat() emulation in place I think:

$ grep LINK lib/config.h
/* #undef CHOWN_MODIFIES_SYMLINK */
#define GNULIB_AREADLINKAT 1
#define GNULIB_TEST_LINK 1
#define GNULIB_TEST_LINKAT 1
#define GNULIB_TEST_READLINK 1
#define GNULIB_TEST_READLINKAT 1
#define GNULIB_TEST_SYMLINK 1
#define GNULIB_TEST_SYMLINKAT 1
#define GNULIB_TEST_UNLINK 1
#define GNULIB_TEST_UNLINKAT 1
#define HAVE_LINK 1
/* #undef HAVE_LINKAT */
#define HAVE_READLINK 1
/* #undef HAVE_READLINKAT */
#define HAVE_SYMLINK 1
/* #undef HAVE_SYMLINKAT */
#define HAVE_UNLINKAT 1
/* #undef LINKAT_TRAILING_SLASH_BUG */
#define LINK_FOLLOWS_SYMLINKS -1
#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
#define PIPE_LINK_COUNT_MAX (0)
/* #undef READLINK_TRAILING_SLASH_BUG */
/* #undef RENAME_HARD_LINK_BUG */
/* #undef UNLINK_CANNOT_UNLINK_DIR */
/* #undef UNLINK_PARENT_BUG */

I've attached the verbose log for the test,
as I've not time to look into it at present.

thanks,
Pádraig.