summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/su/su.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c
index 2be54c32e7a..17eade22247 100644
--- a/usr.bin/su/su.c
+++ b/usr.bin/su/su.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: su.c,v 1.69 2015/10/24 19:47:44 miod Exp $ */
+/* $OpenBSD: su.c,v 1.70 2015/10/30 19:45:03 miod Exp $ */
/*
* Copyright (c) 1988 The Regents of the University of California.
@@ -215,6 +215,9 @@ main(int argc, char **argv)
fprintf(stderr, "Login incorrect\n");
}
+ if (pledge("stdio rpath getpw exec id", NULL) == -1)
+ err(1, "pledge");
+
if (!altshell) {
if (asme) {
/* if asme and non-std target shell, must be root */
@@ -283,9 +286,6 @@ main(int argc, char **argv)
auth_err(as, 1, "unable to set environment");
}
- if (pledge("stdio rpath exec id", NULL) == -1)
- err(1, "pledge");
-
np = *argv ? argv : argv - 1;
if (iscsh == YES) {
if (fastlogin)