enami
b579228888
Fix whitespace usage.
2002-10-21 10:18:23 +00:00
enami
f594d61275
If utmpx support is enabled, use sockaddr field to get numeric address.
2002-10-21 10:10:26 +00:00
christos
b3ac19283d
Make uptime show the correct number of users.
2002-09-16 04:02:21 +00:00
mycroft
2f85ba247c
uptime(1) is NOT supposed to always say `1 user'.
2002-09-16 01:49:06 +00:00
christos
52f955bcfd
fixed user miscounting. reported by kim.
2002-08-22 14:52:55 +00:00
christos
156b33bc4e
skip blank entries.
2002-07-28 20:47:57 +00:00
christos
1e703dc185
add utmpx support.
2002-07-27 23:58:40 +00:00
enami
f7a77f5cca
Fix whitespace usage.
2001-11-05 03:35:49 +00:00
cgd
a8ec668ddf
convert to use getprogname()
2001-02-19 23:03:42 +00:00
mjl
3d418a4a73
ANSIfy.
2001-01-05 04:59:21 +00:00
mjl
96015e4766
(From FreeBSD)
...
Get things right for tty names of length UT_LINESIZE. (FreeBSD PR 3638)
If the utmp login time is greater than the tty atime, use it to calculate
the idle time instead of the atime.
Fix -n with 16-chars hostnames (FreeBSD PR 11286).
Domain names are case insensitive.
2001-01-05 04:54:53 +00:00
cgd
2af1e46eab
__CONCAT does token pasting, not string concatnation. if something like:
...
__CONCAT("foo","bar");
actually works to concantate strings, it's because the preprocessor expands
it into "foo""bar" as separate strings, and then ANSI string concatenation
is performed on that. It's more straightforward to just use ANSI string
concatenation directly, and newer GCCs complain (rightly) about misuse
of token pasting.
2000-12-20 01:17:49 +00:00
jdolecek
f8031c2d6d
add code to recognize special ftpd utmp entries and match corresponding
...
process accordingly, so that w parses entries made by "ftpd -U" correctly
the new code is conditionalized upon define SUPPORT_FTPD_UTMP, turned
on by default in w(1)'s Makefile
This addresses bin/11095 by Daniel Hagerty.
2000-09-28 18:20:29 +00:00
christos
2120a34cd6
- Don't core dump when we have stale utmp entries; warn the user instead.
...
- Make this work again in single user when invoked as uptime and utmp is
not present.
2000-08-21 00:19:06 +00:00
simonb
0afebfffdf
Redo previous slightly differently - restore the behaviour of two
...
characters for the tty name and the first 'T' of 'TTY' hanging over
the blank column at the end of the username field.
2000-07-22 03:14:06 +00:00
enami
ce5e5c761e
- Set the minimum width for login name to 4, the width of "USER".
...
- Fix the number of colmuns left for proc. args. Previously, an effect of
NUL was canceled implicitly, but now we must handle it explicitly.
- Fix the width for tty name.
2000-07-15 22:45:14 +00:00
simonb
34d4c12031
Use KERN_CONSDEV for determining the console device instead of CPU_CONSDEV
...
which is not available on all ports.
2000-07-13 14:28:07 +00:00
simonb
b00d9cf6cc
Use p_login from struct proc instead of ut_name from struct utmp so
...
that a truncated name isn't used if the login name is over 8 characters
long. Size USER field to suit.
Fixes PR bin/2459 from Neil McRae.
2000-06-25 13:41:12 +00:00
enami
4dc07f088a
Pass the size of struct kinfo_proc2 instead of kinfo_proc to kvm_getproc2
...
so that w(1) displays what commands are running as before.
2000-06-08 02:37:28 +00:00
simonb
ea74487218
Use new sysctl/kvm interfaces and remove sgid bit.
2000-05-26 03:10:31 +00:00
pk
9c865e3e82
No need for <machine/cpu.h> here.
1999-11-29 11:15:13 +00:00
drochner
85cbf55d16
Since our gcc doesn't warn about NULL format strings anymore, we can
...
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
1999-11-09 15:06:30 +00:00
mrg
45cd15f3ed
recognise "dty" the same as we do "tty"
1999-10-11 11:55:27 +00:00
pk
e7a15783a6
Use correct buffer in kvm_openfiles().
1999-01-29 14:17:21 +00:00
mrg
80efe80bc9
- change setgid kmem programs (that lend themselves to this) so setegid(getgid())
...
and the top, and then set the effective gid back to kmem around the call to
kvm_openfiles(). this reduces the time group kmem is available.
- for those above that also allow this, setgid(getgid()) after the call to
kvm_openfiles() to fully revoke priviledges.
- some KNF
- use err(3) over fprintf(3) in some places
1998-07-06 07:50:18 +00:00
mrg
32f519716b
- use an array MAXHOSTNAMELEN+1 size to hold hostnames
...
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:56:06 +00:00
kleink
9406f10815
Need <time.h> for strftime() and related definitions. Also, no need to
...
include <sys/tty.h>.
1998-04-02 11:39:40 +00:00
lukem
831bc1ae96
minor WARNS for i386
1997-10-20 03:08:44 +00:00
mrg
615373621d
WARNSify; deprecate register; clean up .Nm
1997-10-20 02:49:14 +00:00
phil
133748a721
Don't print "up" if uptime is less than 30 seconds. (uptime rounds
...
to the nearest minute.) Closes PR 2082.
1997-07-07 20:30:08 +00:00
mycroft
79bc5bb41f
Use inet_aton(3) rather than inet_addr(3).
1997-05-19 03:44:43 +00:00
mrg
8d51c2f90d
properly terminal buffer after calling strftime.
1997-04-13 13:44:13 +00:00
christos
85d90bc463
PR/3416: enami tsugutomo: fix bug introduced in previous change to handle
...
long hostnames.
1997-03-31 04:13:15 +00:00
christos
3c24c46e1c
PR/3399: Tatoku Ogaito: Careful with not null terminated utmp strings.
1997-03-29 23:21:37 +00:00
explorer
a030e0a1ae
Message buffer passed to kvm_openfiles() should _POSIX2_LINE_MAX long; PR#3266
1997-03-03 22:12:19 +00:00
tls
60a059d296
Sync to 4.4BSD-Lite2
1997-01-09 11:55:19 +00:00
thorpej
2a295146f3
Discard setgid privileges if not reading the running kernel as suggested
...
by Mike Grupenhoff <ashmir@umiacs.umd.edu> in PR #2485 .
1996-06-07 01:36:39 +00:00
jtc
68a63eb204
Use errx() instead of err() to report failure of kvm_getprocs() call,
...
as errno doesn't have a meaningful value in this case. Reported by
Mike Grupenhoff <kashmir@umiacs.umd.edu> in PR #2289 .
1996-04-08 21:32:05 +00:00
mycroft
753e31a4fe
Don't core dump when tty has no associated process.
1995-05-25 04:02:19 +00:00
mycroft
09984612d7
Gather the argument list only as necessary. Avoid an extra strvisx(3).
...
Make this compile again with the changes in ps(1).
1995-05-21 13:42:48 +00:00
cgd
81cef407d8
fix annoying number consistency bug.
1995-03-28 12:48:45 +00:00
cgd
cc3bb2da02
Fix from John Brezak for the following bug:
...
If there is a non-tty entry in utmp, w(1) will exit with an error.
However there are legitimate non-tty entries, for instance an xlogin via
xdm can be identified with the xlogin program. In this case there is an
entry with the display name as the ut_tty.
1994-06-30 08:08:08 +00:00
cgd
6a3b73440c
fix from Jarle Greipsland <jarle@idt.unit.no> to deal with ut_line misprinting.
1994-06-30 07:18:44 +00:00
cgd
5a9cb8543e
clean up import
1994-05-09 03:35:55 +00:00
cgd
25718695be
update for changed flags
1994-05-05 02:04:10 +00:00
mycroft
6be6fca207
Print `-' rather than ` ' for 0 idle time.
1993-10-26 20:52:51 +00:00
mycroft
e9d867ef50
Add RCS identifiers.
1993-08-01 17:54:45 +00:00
cgd
eed6472f7c
don't print process args, print the vis(3)'d process args...
1993-07-15 17:55:48 +00:00
deraadt
b1d2d04ee4
chris found a case where cn_tty was being used. Doesn't look like the
...
right thing to do, so it goes away.
1993-07-07 18:58:23 +00:00
mycroft
da84bb1ffa
Fix definition of rcsid.
1993-06-08 14:47:33 +00:00