Don't automatically prepend the "tty" prefix to `pkill -t' arguments.

Because we now enforce UNIX98-style PTY's, we now use a lot of TTY's
that don't have the traditional /dev/ttyXX naming scheme. pkill(1)'s -t
flag automatically prepended the word "tty" to each TTY that was passed
on the command line. This meant that `pkill -t pts/0' was actually
converted to /dev/ttypts/0. Disable this broken behaviour for now.

Reported by:	erwin
This commit is contained in:
Ed Schouten 2008-09-28 16:44:15 +00:00
parent be05c004e0
commit eb948eac0d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=183438
2 changed files with 5 additions and 9 deletions

View File

@ -179,10 +179,9 @@ command.
Restrict matches to processes associated with a terminal in the
comma-separated list
.Ar tty .
Terminal names may be of the form
.Pa tty Ns Ar xx
or the shortened form
.Ar xx .
The
.Pa /dev/
prefix of the terminal names must be omitted.
A single dash
.Pq Ql -
matches processes not associated with a terminal.

View File

@ -607,12 +607,11 @@ makelist(struct listhead *head, enum listtype type, char *src)
struct passwd *pw;
struct group *gr;
struct stat st;
const char *cp, *prefix;
const char *cp;
char *sp, *ep, buf[MAXPATHLEN];
int empty;
empty = 1;
prefix = _PATH_DEV;
while ((sp = strsep(&src, ",")) != NULL) {
if (*sp == '\0')
@ -673,11 +672,9 @@ makelist(struct listhead *head, enum listtype type, char *src)
cp = "console";
} else {
cp = sp;
if (strncmp(sp, "tty", 3) != 0)
prefix = _PATH_TTY;
}
snprintf(buf, sizeof(buf), "%s%s", prefix, cp);
snprintf(buf, sizeof(buf), _PATH_DEV "%s", cp);
if (stat(buf, &st) == -1) {
if (errno == ENOENT) {