1*d2a70789SRichard Lowe#! /usr/bin/ksh
2*d2a70789SRichard Lowe#
3*d2a70789SRichard Lowe#
4*d2a70789SRichard Lowe# This file and its contents are supplied under the terms of the
5*d2a70789SRichard Lowe# Common Development and Distribution License ("CDDL"), version 1.0.
6*d2a70789SRichard Lowe# You may only use this file in accordance with the terms of version
7*d2a70789SRichard Lowe# 1.0 of the CDDL.
8*d2a70789SRichard Lowe#
9*d2a70789SRichard Lowe# A full copy of the text of the CDDL should have accompanied this
10*d2a70789SRichard Lowe# source.  A copy of the CDDL is also available via the Internet at
11*d2a70789SRichard Lowe# http://www.illumos.org/license/CDDL.
12*d2a70789SRichard Lowe#
13*d2a70789SRichard Lowe
14*d2a70789SRichard Lowe# Copyright 2015, Richard Lowe.
15*d2a70789SRichard Lowe
16*d2a70789SRichard Lowe/usr/bin/psecflags -s noexecstack $$
17*d2a70789SRichard Lowe
18*d2a70789SRichard Lowe/opt/os-tests/tests/secflags/stacky &
19*d2a70789SRichard Lowepid=$!
20*d2a70789SRichard Lowe
21*d2a70789SRichard Loweret=0
22*d2a70789SRichard Lowe(pmap $pid | grep -q 'rwx.*\[ stack \]$') && re=1
23*d2a70789SRichard Lowe
24*d2a70789SRichard Lowekill -9 $pid
25*d2a70789SRichard Loweexit $ret
26