[Bug 268093] killall(1) allow sending signals to pts(4)

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 01 Dec 2022 02:18:12 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268093

            Bug ID: 268093
           Summary: killall(1) allow sending signals to pts(4)
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: freebsd-bugs@daemonbytes.net
 Attachment #238465 text/plain
         mime type:

Created attachment 238465
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=238465&action=edit
Patchfile

Hello,

the current version of killall(1) does not allow sending signals to processes
attached to a pts(4) e.g /dev/pts/4 and to do so results in an error messages
like the one below. 

#killall -t pts/4
killall: stat(/dev/ttypts/4): No such file or directory


The provided patch would enable the ability to do that.

Best regards

Daniel Dowse


--- killall.c.orig      2022-12-01 02:47:39.299477000 +0100
+++ killall.c   2022-12-01 02:47:21.503069000 +0100
@@ -257,6 +257,8 @@
                        snprintf(buf, sizeof(buf), "%s", tty);
                else if (strncmp(tty, "tty", 3) == 0)
                        snprintf(buf, sizeof(buf), "/dev/%s", tty);
+               else if (strncmp(tty, "pts", 3) == 0)
+                       snprintf(buf, sizeof(buf), "/dev/%s", tty);
                else
                        snprintf(buf, sizeof(buf), "/dev/tty%s", tty);
                if (stat(buf, &sb) < 0)

-- 
You are receiving this mail because:
You are the assignee for the bug.