mirror of
https://github.com/SELinuxProject/selinux
synced 2025-02-28 07:20:30 +00:00
policycoreutils: gui: polgen: follow symlinks and get the real path to the executable to be confined
Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
f627d9a8ce
commit
ff78e21ef8
@ -1354,9 +1354,11 @@ if __name__ == '__main__':
|
||||
usage(_("Executable or Name required"))
|
||||
|
||||
try:
|
||||
cmd = os.path.realpath(cmds[0])
|
||||
if not name:
|
||||
name = os.path.basename(cmds[0]).replace("-","_")
|
||||
cmd = cmds[0]
|
||||
name = os.path.basename(cmd).replace("-","_")
|
||||
|
||||
print("Generating Policy for %s named %s" % (cmd, name))
|
||||
mypolicy = policy(name, setype)
|
||||
if setype not in USERS + [ SANDBOX ]:
|
||||
mypolicy.set_program(cmd)
|
||||
|
Loading…
Reference in New Issue
Block a user