On 01/07/2026 12:43, Bruno Haible via GNU coreutils General Discussion wrote:
cannot create special file '/tmp/tmp15142/mv-sock-dest': Not owner

I think this would have failed on Solaris 11 and FreeBSD also.

Our python probe to check compat does a different (supported) thing
to create unix domain sockets than what cp/mv does with mknode().

So I adjusted the python probe to be similar
to what cp/mv does with the attached, and pushed.

thanks,
Padraig
From e45a3f6a19b444feebe91dea116b709643f153b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Thu, 2 Jul 2026 00:52:01 +0100
Subject: [PATCH] tests: avoid false failure where mknod() can't create sockets

* tests/mv/mv-special-1.sh: Adjust the python probe to more
closely match how copy.c creates sockets, as otherwise we
get a false failure on systems where mknod() fails with S_IFSOCK,
which was seen on Solaris and FreeBSD at least.
* tests/mv/mv-special-2.sh: Adjust similarly as this
was a latent issue on this root only test.
Reported by Bruno Haible.
---
 tests/mv/mv-special-1.sh | 7 ++++---
 tests/mv/mv-special-2.sh | 5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/tests/mv/mv-special-1.sh b/tests/mv/mv-special-1.sh
index 44f78fe59..465e670e3 100755
--- a/tests/mv/mv-special-1.sh
+++ b/tests/mv/mv-special-1.sh
@@ -84,9 +84,10 @@ compare exp out2 || fail=1
 # must replace that destination, not unlink it first and then fail,
 # leaving the user with neither file.
 source=mv-sock
-if python -c "import socket as s; \
-              s.socket(s.AF_UNIX).bind('$source'); \
-              s.socket(s.AF_UNIX).bind('$other_partition_tmpdir/test.sock') \
+if python -c "import os, stat; \
+              os.mknod('$source', stat.S_IFSOCK | 0o600); \
+              os.mknod('$other_partition_tmpdir/test.sock', \
+                       stat.S_IFSOCK | 0o600) \
               " &&
  test -S "$source" && test -S "$other_partition_tmpdir/test.sock"; then
 
diff --git a/tests/mv/mv-special-2.sh b/tests/mv/mv-special-2.sh
index 9ecea4e97..b588d2880 100755
--- a/tests/mv/mv-special-2.sh
+++ b/tests/mv/mv-special-2.sh
@@ -65,8 +65,9 @@ mv --verbose broken_symlink xdev &&
 returns_ 1 test -L broken_symlink &&
 test -L xdev/broken_symlink || fail=1
 
-if python -c "import socket as s; s.socket(s.AF_UNIX).bind('test.sock')" &&
-   test -S 'test.sock'; then
+if python -c "import os, stat; \
+              os.mknod('test.sock', stat.S_IFSOCK | 0o600); \
+              " && test -S 'test.sock'; then
   mv --verbose test.sock xdev &&
   returns_ 1 test -S test.sock &&
   test -S xdev/test.sock || fail=1
-- 
2.54.0

Reply via email to