-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This patch looks good to me. acked. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/I+vQACgkQrlYvE4MpobNV8ACg0ZzR9lyxO8X1k6ITxzTCXRHj A/IAoIMS1rDM4q9JNW6erPQn37t4wwrT =YVp6 -----END PGP SIGNATURE-----
>From c10dafb19cd5bd2bba7919821e10810adb841691 Mon Sep 17 00:00:00 2001 From: Dan Walsh <dwalsh@xxxxxxxxxx> Date: Sun, 20 May 2012 06:27:12 -0400 Subject: [PATCH 67/90] sepolgen should follow symlinks and get the real path to the executable to be confined --- policycoreutils/gui/polgen.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/policycoreutils/gui/polgen.py b/policycoreutils/gui/polgen.py index c0f818a..51fb8d7 100644 --- a/policycoreutils/gui/polgen.py +++ b/policycoreutils/gui/polgen.py @@ -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) -- 1.7.10.2