~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to tests/regression/subdomain/named_pipe.sh

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/bash
2
 
# $Id: named_pipe.sh 61 2006-05-19 18:32:14Z steve-beattie $
3
 
 
4
 
#       Copyright (C) 2002-2005 Novell/SUSE
5
 
#
6
 
#       This program is free software; you can redistribute it and/or
7
 
#       modify it under the terms of the GNU General Public License as
8
 
#       published by the Free Software Foundation, version 2 of the
9
 
#       License.
10
 
 
11
 
#=NAME named_pipe
12
 
#=DESCRIPTION 
13
 
# This test verifies that subdomain file access checks function correctly 
14
 
# for named piped (nodes in the filesystem created with mknod).  The test 
15
 
# creates a parent/child process relationship which attempt to rendevous via 
16
 
# the named pipe.   The tests are attempted for unconfined and confined 
17
 
# processes and also for subhats.
18
 
#=END
19
 
 
20
 
pwd=`dirname $0`
21
 
pwd=`cd $pwd ; /bin/pwd`
22
 
 
23
 
bin=$pwd
24
 
 
25
 
. $bin/prologue.inc
26
 
 
27
 
subtest=sub
28
 
fifo=${tmpdir}/pipe
29
 
okperm=rw
30
 
 
31
 
mknod ${fifo} p
32
 
 
33
 
# NAMED PIPE - no confinement 
34
 
 
35
 
runchecktest "NAMED PIPE (no confinement)" pass nochange ${fifo}
36
 
 
37
 
# PIPE - confined.
38
 
 
39
 
#rm -f ${fifo} && mknod ${fifo} p
40
 
genprofile $fifo:${okperm}
41
 
runchecktest "NAMED PIPE RW (confinement)" pass nochange ${fifo}
42
 
 
43
 
# PIPE - confined - no access.
44
 
 
45
 
#rm -f ${fifo} && mknod ${fifo} p
46
 
genprofile 
47
 
runchecktest "NAMED PIPE (confinement)" fail nochange ${fifo}
48
 
 
49
 
# PIPE - in a subprofile.
50
 
 
51
 
#rm -f ${fifo} && mknod ${fifo} p
52
 
genprofile ${fifo}:${okperm} hat:$subtest ${fifo}:${okperm}
53
 
 
54
 
runchecktest "NAMED PIPE RW (subprofile)" pass ${subtest} ${fifo}
55
 
 
56
 
# PIPE - in a subprofile - no access
57
 
 
58
 
#rm -f ${fifo} && mknod ${fifo} p
59
 
genprofile ${fifo}:${okperm} hat:$subtest
60
 
 
61
 
runchecktest "NAMED PIPE (subprofile)" fail ${subtest} ${fifo}