summaryrefslogtreecommitdiff
path: root/miscutils/wall.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/wall.c')
-rw-r--r--miscutils/wall.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/miscutils/wall.c b/miscutils/wall.c
index c74f4f2..bb709ee 100644
--- a/miscutils/wall.c
+++ b/miscutils/wall.c
@@ -41,11 +41,7 @@ int wall_main(int argc UNUSED_PARAM, char **argv)
/* The applet is setuid.
* Access to the file must be under user's uid/gid.
*/
- setfsuid(getuid());
- setfsgid(getgid());
- fd = xopen(argv[1], O_RDONLY);
- setfsuid(geteuid());
- setfsgid(getegid());
+ fd = xopen_as_uid_gid(argv[1], O_RDONLY, getuid(), getgid());
}
msg = xmalloc_read(fd, NULL);
if (ENABLE_FEATURE_CLEAN_UP && argv[1])