-.\" $OpenBSD: rpc.rusersd.8,v 1.8 2015/12/01 20:27:06 tim Exp $
+.\" $OpenBSD: rpc.rusersd.8,v 1.9 2022/02/21 19:49:46 mestre Exp $
.\"
.\" Copyright (c) 1985, 1991 The Regents of the University of California.
.\" All rights reserved.
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: rpc.rusersd.8,v 1.8 2015/12/01 20:27:06 tim Exp $
+.\" $Id: rpc.rusersd.8,v 1.9 2022/02/21 19:49:46 mestre Exp $
.\"
-.Dd $Mdocdate: December 1 2015 $
+.Dd $Mdocdate: February 21 2022 $
.Dt RPC.RUSERSD 8
.Os
.Sh NAME
.Nm rpc.rusersd
is a server which returns information about users
currently logged in to the system.
-At startup,
-.Nm
-opens
-.Pa /var/run/utmp
-and subsequently performs a
-.Xr chroot 2
-to
-.Pa /var/empty
-and switches to user
-.Va _rusersd .
.Pp
The currently logged in users are queried using the
.Xr rusers 1
-/* $OpenBSD: rusersd.c,v 1.21 2019/06/28 13:32:53 deraadt Exp $ */
+/* $OpenBSD: rusersd.c,v 1.22 2022/02/21 19:49:46 mestre Exp $ */
/*-
* Copyright (c) 1993 John Brezak
syslog(LOG_ERR, "no such user _rusersd");
exit(1);
}
- if (chroot("/var/empty") == -1) {
- syslog(LOG_ERR, "cannot chdir to /var/empty.");
+
+ if (unveil("/dev", "r") == -1) {
+ syslog(LOG_ERR, "unveil /dev");
exit(1);
}
- chdir("/");
setgroups(1, &pw->pw_gid);
setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid);