All of lore.kernel.org
 help / color / mirror / Atom feed
From: TaurusHarry <harrytaurus2002@hotmail.com>
To: refpolicy-mailing-list <refpolicy@oss1.tresys.com>,
	selinux-mailing-list <selinux@tycho.nsa.gov>
Subject: How to implement the "if-then-else" logic in refpolicy interface?
Date: Wed, 3 Mar 2010 06:37:24 +0000	[thread overview]
Message-ID: <BAY111-W68D4C9E39582E71A1BA31AB3A0@phx.gbl> (raw)

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]


Hi SELinux experts,

Thanks a lot for taking a look at my question, how could I implement the bash "if-then-else" and "test" grammar in current refpolicy interface? For example, if I don't want the user_t to have the privilege to execute any kind of shell, what proper grammar should I use to implement something with the same logic as 'if ! test "X$1" = "Xuser_t"' in the corecomd_exec_shell interface:

interface(`corecmd_exec_shell',`
        gen_require(`
                type bin_t, shell_exec_t;
        ')

if ! test "X$1" = "Xuser_t"; then
        list_dirs_pattern($1, bin_t, bin_t)
        read_lnk_files_pattern($1, bin_t, bin_t)
        can_exec($1, shell_exec_t)
fi
')

Thank you very much!

Best regards,
Harry
 		 	   		  
_________________________________________________________________
想知道明天天气如何?必应告诉你!
http://cn.bing.com/search?q=%E5%A4%A9%E6%B0%94%E9%A2%84%E6%8A%A5&form=MICHJ2

[-- Attachment #2: Type: text/html, Size: 1379 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: harrytaurus2002@hotmail.com (TaurusHarry)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] How to implement the "if-then-else" logic in refpolicy interface?
Date: Wed, 3 Mar 2010 06:37:24 +0000	[thread overview]
Message-ID: <BAY111-W68D4C9E39582E71A1BA31AB3A0@phx.gbl> (raw)


Hi SELinux experts,

Thanks a lot for taking a look at my question, how could I implement the bash "if-then-else" and "test" grammar in current refpolicy interface? For example, if I don't want the user_t to have the privilege to execute any kind of shell, what proper grammar should I use to implement something with the same logic as 'if ! test "X$1" = "Xuser_t"' in the corecomd_exec_shell interface:

interface(`corecmd_exec_shell',`
        gen_require(`
                type bin_t, shell_exec_t;
        ')

if ! test "X$1" = "Xuser_t"; then
        list_dirs_pattern($1, bin_t, bin_t)
        read_lnk_files_pattern($1, bin_t, bin_t)
        can_exec($1, shell_exec_t)
fi
')

Thank you very much!

Best regards,
Harry
 		 	   		  
_________________________________________________________________
????????????????
http://cn.bing.com/search?q=%E5%A4%A9%E6%B0%94%E9%A2%84%E6%8A%A5&form=MICHJ2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.tresys.com/pipermail/refpolicy/attachments/20100303/bae4e34e/attachment.html 

             reply	other threads:[~2010-03-03  6:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03  6:37 TaurusHarry [this message]
2010-03-03  6:37 ` [refpolicy] How to implement the "if-then-else" logic in refpolicy interface? TaurusHarry
2010-03-03 15:14 ` Daniel J Walsh
2010-03-03 15:14   ` Daniel J Walsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY111-W68D4C9E39582E71A1BA31AB3A0@phx.gbl \
    --to=harrytaurus2002@hotmail.com \
    --cc=refpolicy@oss1.tresys.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.