=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/su/su.c,v retrieving revision 1.69 retrieving revision 1.70 diff -c -r1.69 -r1.70 *** src/usr.bin/su/su.c 2015/10/24 19:47:44 1.69 --- src/usr.bin/su/su.c 2015/10/30 19:45:03 1.70 *************** *** 1,4 **** ! /* $OpenBSD: su.c,v 1.69 2015/10/24 19:47:44 miod Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. --- 1,4 ---- ! /* $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,220 **** --- 215,223 ---- 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 */ *************** *** 282,290 **** if (setenv("SHELL", shell, 1) == -1) 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) { --- 285,290 ----