bug#70219: Bug/Issue with timeout and signals

2024-04-05 Thread Chris Elvidge




On 05/04/2024 at 16:19, Branden R. Williams via GNU coreutils Bug 
Reports wrote:

I was integrating the timeout command into a shell script and realized the manpage 
& the --help docs do not accurately describe how the tool works. In addition, 
there appears to be a bug related to arguments passed. I am running version 9.1.

According to the help screen, this command should work:

timeout -k 10s ping example.com 

It fails, however, because the next argument after invoking -k is the kill 
signal you want to send. The command (to send a SIGKILL) must be:



As I understand it, the argument after -k (or --kill-after=) is the time 
to wait and send the kill signal if the timeout fails.

So this line:


timeout -k 9 10s ping example.com 



sends a kill signal 9 seconds after the timeout, if the timeout hasn't 
worked.


The -s option is to change the signal sent (as below).


I believe the kill after functionality and docs should be modified to send a 
default signal of SIGTERM without an additional argument so the first iteration 
above would work. Then you could explain that if you wanted to send a DIFFERENT 
signal, use the -s flag that is there to pass one. But according to the docs, 
the first command SHOULD work. Even using the --kill-after= syntax passes in 
the kill signal into that argument, not the actual time.

Thank you for your consideration and for maintaining such a critical set of 
tools!

Regards,

B





--

Chris Elvidge






bug#70219: Bug/Issue with timeout and signals

2024-04-05 Thread Branden R. Williams
I was integrating the timeout command into a shell script and realized the 
manpage & the --help docs do not accurately describe how the tool works. In 
addition, there appears to be a bug related to arguments passed. I am running 
version 9.1.

According to the help screen, this command should work:

timeout -k 10s ping example.com 

It fails, however, because the next argument after invoking -k is the kill 
signal you want to send. The command (to send a SIGKILL) must be:

timeout -k 9 10s ping example.com 

I believe the kill after functionality and docs should be modified to send a 
default signal of SIGTERM without an additional argument so the first iteration 
above would work. Then you could explain that if you wanted to send a DIFFERENT 
signal, use the -s flag that is there to pass one. But according to the docs, 
the first command SHOULD work. Even using the --kill-after= syntax passes in 
the kill signal into that argument, not the actual time.

Thank you for your consideration and for maintaining such a critical set of 
tools! 

Regards,

B



bug#70214: 'install' fails to copy regular file to autofs/cifs, due to ACL or xattr handling

2024-04-05 Thread Bruno Haible
Hi,

The 'install' program from coreutils-9.5 fails to copy a regular file
from an ext4 mount to an autofs/cifs mount.

The same operation, with 'cp -a', works fine.

Also, it works fine when coreutils was built with the configure options
"--disable-acl --disable-xattr".

How to reproduce


1) On the machine sparcdev.matoro.tk (Linux 6.8.2), I built coreutils-9.5
from source,
  - once with default options, in build-sparc64/,
  - once with "--disable-acl --disable-xattr", in build-sparc64-no-acl/.

2) Create a regular file on an ext4 mount:

$ echo hi > /var/tmp/foo3941
$ ls -lZ /var/tmp/foo3941
-rw-r- 1 g-haible g-haible ? 3 Apr  4 13:29 /var/tmp/foo3941
$ getfacl /var/tmp/foo3941
getfacl: Removing leading '/' from absolute path names
# file: var/tmp/foo3941
# owner: g-haible
# group: g-haible
user::rw-
group::r--
other::---
$ df -m /var/tmp/
Filesystem 1M-blocks   Used Available Use% Mounted on
/dev/root 560245 123140408574  24% /
$ mount | grep ' / '
/dev/sda2 on / type ext4 (rw,noatime)

3) Details about the destination directory:

$ echo $HOME
/media/guest-homedirs/haible
$ mount | grep /media/guest-homedirs/haible
/etc/autofs/auto.guest-homedirs on /media/guest-homedirs/haible type autofs 
(rw,relatime,fd=7,pgrp=2325,timeout=60,minproto=5,maxproto=5,direct,pipe_ino=46092)
//syslog.matoro.tk/guest-haible on /media/guest-homedirs/haible type cifs 
(rw,nosuid,relatime,vers=1.0,cache=strict,username=nobody,uid=30014,forceuid,gid=30014,forcegid,addr=fd05:::::::0001,soft,unix,posixpaths,serverino,mapposix,acl,rsize=1048576,wsize=65536,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1)

4) The operation that fails:

$ build-sparc64/src/ginstall -c /var/tmp/foo3941 $HOME/foo3941; echo $?
build-sparc64/src/ginstall: setting permissions for 
'/media/guest-homedirs/haible/foo3941': Permission denied
1
$ build-sparc64-no-acl/src/ginstall -c /var/tmp/foo3941 $HOME/foo3941; echo $?
0

5) The same thing with 'cp -a' succeeds:

$ build-sparc64/src/cp -a /var/tmp/foo3941 $HOME/foo3941; echo $?
0
$ build-sparc64-no-acl/src/cp -a /var/tmp/foo3941 $HOME/foo3941; echo $?
0

6) 'strace' shows a failing call to fsetxattr:

$ strace build-sparc64/src/ginstall -c /var/tmp/foo3941 $HOME/foo3941
execve("build-sparc64/src/ginstall", ["build-sparc64/src/ginstall", "-c", 
"/var/tmp/foo3941", "/media/guest-homedirs/haible/foo"...], 0x7fece28 /* 43 
vars */) = 0
brk(NULL)   = 0x1204000
access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=41866, ...}) = 0
mmap(NULL, 41866, PROT_READ, MAP_PRIVATE, 3, 0) = 0xfff8000100028000
close(3)= 0
openat(AT_FDCWD, "/usr/lib64/libacl.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\2\1\0\0\0\0\0\0\0\0\0\0\3\0+\0\0\0\1\0\0\0\0\0\0\0\0"..., 
832) = 832
fstat64(3, {st_mode=S_IFREG|0755, st_size=1052312, ...}) = 0
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xfff8000100034000
mmap(NULL, 3147696, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_DENYWRITE, -1, 0) 
= 0xfff8000100206000
mmap(0xfff800010030, 2099120, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0xfff800010030
munmap(0xfff8000100206000, 1024000) = 0
munmap(0xfff8000100502000, 18352)   = 0
mprotect(0xfff8000100308000, 2056192, PROT_NONE) = 0
mmap(0xfff80001004fe000, 16384, PROT_READ|PROT_WRITE|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xfe000) = 0xfff80001004fe000
close(3)= 0
openat(AT_FDCWD, "/usr/lib64/libattr.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\2\1\0\0\0\0\0\0\0\0\0\0\3\0+\0\0\0\1\0\0\0\0\0\0\0\0"..., 
832) = 832
fstat64(3, {st_mode=S_IFREG|0755, st_size=1051928, ...}) = 0
mmap(NULL, 3147288, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_DENYWRITE, -1, 0) 
= 0xfff8000100502000
mmap(0xfff800010060, 2098712, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0xfff800010060
munmap(0xfff8000100502000, 1040384) = 0
munmap(0xfff8000100802000, 1560)= 0
mprotect(0xfff8000100604000, 2072576, PROT_NONE) = 0
mmap(0xfff80001007fe000, 16384, PROT_READ|PROT_WRITE|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xfe000) = 0xfff80001007fe000
close(3)= 0
openat(AT_FDCWD, "/usr/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, 
"\177ELF\2\2\1\3\0\0\0\0\0\0\0\0\0\3\0+\0\0\0\1\0\0\0\0\0\2\305\240"..., 832) = 
832
fstat64(3, {st_mode=S_IFREG|0755, st_size=2110256, ...}) = 0
mmap(NULL, 4233760, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_DENYWRITE, -1, 0) 
= 0xfff8000100802000
mmap(0xfff800010090, 3185184, PROT_READ|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0xfff800010090
munmap(0xfff8000100802000, 1040384) = 0
munmap(0xfff8000100c0a000, 6688)= 0
mprotect(0xfff8000100a8e000,