mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-09 02:41:03 +01:00
41 lines
722 B
Bash
Executable file
41 lines
722 B
Bash
Executable file
#! /bin/bash
|
|
# $Id$
|
|
|
|
# Copyright (C) 2002-2005 Novell/SUSE
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License as
|
|
# published by the Free Software Foundation, version 2 of the
|
|
# License.
|
|
|
|
#=NAME symlink
|
|
#=DESCRIPTION creating a symlink should require write access to the new name
|
|
|
|
pwd=`dirname $0`
|
|
pwd=`cd $pwd ; /bin/pwd`
|
|
|
|
bin=$pwd
|
|
|
|
. $bin/prologue.inc
|
|
|
|
src=$tmpdir/src1
|
|
target=$tmpdir/target
|
|
|
|
okperm=w
|
|
badperm=rlixm
|
|
|
|
touch $target
|
|
|
|
# PASS TEST
|
|
|
|
genprofile ${src}:$okperm
|
|
|
|
runchecktest "SYMLINK/WRITE PERMS" pass $target ${src}
|
|
|
|
# FAILURE TEST
|
|
|
|
rm -f ${src}
|
|
|
|
genprofile ${src}:$badperm
|
|
|
|
runchecktest "SYMLINK/NO-WRITE PERMS" fail $target ${src}
|