genhomedircon is broken in libsemanage
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Adding
mythtv:x:1004:1004::/var/lib/mythtv:/bin/bash
To /etc/passwd causes the labeling to get all screwed up. This would report an error when we used the python version of genhomedircon and not foul up the labeling by checking if there was a label for /var/lib already in the file_context file. (Boy do I love python. :^))
https://bugzilla.redhat.com/show_bug.cgi?id=430195
Dan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAkefQFEACgkQrlYvE4MpobOQ+ACgochR6fDi53bJva3/g7+QaM9p DJwAoN4LZp7Z3+frZj+kekxbCEJblzbw
=0p5A
-----END PGP SIGNATURE-----
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Adding
mythtv:x:1004:1004::/var/lib/mythtv:/bin/bash
Quoted 8 lines
To
/etc/passwdcauses the labeling to get all screwed up. This would report an error when we used the python version of genhomedircon and not foul up the labeling by checking if there was a label for/var/libalready in thefile_contextfile. (Boy do I love python. :^))https://bugzilla.redhat.com/show_bug.cgi?id=430195
Dan
That shouldn't be hard to add to genhomedircon.c. I'll take a look.
- todd
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 14 lines · Todd Miller
Quoted 12 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Adding
mythtv:x:1004:1004::/var/lib/mythtv:/bin/bash
To
/etc/passwdcauses the labeling to get all screwed up. This would report an error when we used the python version of genhomedircon and not foul up the labeling by checking if there was a label for/var/libalready in thefile_contextfile. (Boy do I love python. :^))
Quoted 7 lines
Quoted 4 lines
https://bugzilla.redhat.com/show_bug.cgi?id=430195
Dan
That shouldn't be hard to add to
genhomedircon.c. I'll take a look.
So, Todd is about to send a patch to fix this but I want to point out that I'm adverse to this sort of thing. There is a minuid and a null shell for a reason, using something above minuid with a valid shell for a non-interactive user is a broken configuration and the fact that we have to work around it is pretty unfortunate.
That said the alternative of breaking the system labeling is pretty bad, its probably better to hack around the problem than leave clueless users with broken configurations stranded but I really wish we didn't have to do things like this.
*sigh*
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 29 lines · Joshua Brindle
Quoted 14 lines · Todd Miller
Quoted 12 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Adding
mythtv:x:1004:1004::/var/lib/mythtv:/bin/bash
To
/etc/passwdcauses the labeling to get all screwed up. This would report an error when we used the python version of genhomedircon and not foul up the labeling by checking if there was a label for/var/libalready in thefile_contextfile. (Boy do I love python. :^))Quoted 7 lines
Quoted 4 lines
https://bugzilla.redhat.com/show_bug.cgi?id=430195
Dan
That shouldn't be hard to add to
genhomedircon.c. I'll take a look.So, Todd is about to send a patch to fix this but I want to point out that I'm adverse to this sort of thing. There is a minuid and a null shell for a reason, using something above minuid with a valid shell for a non-interactive user is a broken configuration and the fact that we have to work around it is pretty unfortunate.
Quoted 7 lines
That said the alternative of breaking the system labeling is pretty bad, its probably better to hack around the problem than leave clueless users with broken configurations stranded but I really wish we didn't have to do things like this.
*sigh*
I think you need to scream in the semanage that this is bad behavior, and you can't fix the labels. The /var/lib situation is bad, but I more commonly see admins putting real users in /usr/local or under /var. We need to have a message that explains this is bad and SELinux can not handle it.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAkegiewACgkQrlYvE4MpobNWTwCfX2pMShRqXwpKfjRNwQ2pLRFr EF8AoMOUQhevXLkLEmKH3qX48RZRv0L4
=Mi3W
-----END PGP SIGNATURE-----
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 41 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 36 lines · Joshua Brindle
Quoted 15 lines · Todd Miller
Quoted 12 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Adding
mythtv:x:1004:1004::/var/lib/mythtv:/bin/bash
To
/etc/passwdcauses the labeling to get all screwed up. This would report an error when we used the python version of genhomedircon and not foul up the labeling by checking if there was a label for/var/libalready in thefile_contextfile. (Boy do I love python. :^))Quoted 8 lines
Quoted 5 lines
https://bugzilla.redhat.com/show_bug.cgi?id=430195
Dan
That shouldn't be hard to add to
genhomedircon.c. I'll take a look.So, Todd is about to send a patch to fix this but I want to point out that I'm adverse to this sort of thing. There is a minuid and a null shell for a reason, using something above minuid with a valid shell for a non-interactive user is a broken configuration and the fact that we have to work around it is pretty unfortunate.
That said the alternative of breaking the system labeling is pretty bad, its probably better to hack around the problem than leave clueless users with broken configurations stranded but I really wish we didn't have to do things like this.
Quoted 9 lines
Quoted 3 lines
*sigh*
I think you need to scream in the semanage that this is bad behavior, and you can't fix the labels. The
/var/libsituation is bad, but I more commonly see admins putting real users in/usr/localor under /var. We need to have a message that explains this is bad and SELinux can not handle it.
Well, this is part of the configurability of Linux and thats why people love it, right? One solution would be to effectively get rid of directory search denials on commodity policies (eg., give all domains search on all dirs for the RH policy) then we don't have to worry about the "top level home" directory label at all.
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 50 lines · Joshua Brindle
Quoted 39 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 34 lines · Joshua Brindle
Quoted 15 lines · Todd Miller
Quoted 12 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Adding
mythtv:x:1004:1004::/var/lib/mythtv:/bin/bash
To
/etc/passwdcauses the labeling to get all screwed up. This would report an error when we used the python version of genhomedircon and not foul up the labeling by checking if there was a label for/var/libalready in thefile_contextfile. (Boy do I love python. :^))Quoted 6 lines
Quoted 4 lines
https://bugzilla.redhat.com/show_bug.cgi?id=430195
Dan
That shouldn't be hard to add to
genhomedircon.c. I'll take a look.So, Todd is about to send a patch to fix this but I want to point out that I'm adverse to this sort of thing. There is a minuid and a null shell for a reason, using something above minuid with a valid shell for a non-interactive user is a broken configuration and the fact that we have to work around it is pretty unfortunate.
That said the alternative of breaking the system labeling is pretty bad, its probably better to hack around the problem than leave clueless users with broken configurations stranded but I really wish we didn't have to do things like this.
Quoted 9 lines
Quoted 3 lines
*sigh*
I think you need to scream in the semanage that this is bad behavior, and you can't fix the labels. The
/var/libsituation is bad, but I more commonly see admins putting real users in/usr/localor under /var. We need to have a message that explains this is bad and SELinux can not handle it.
Quoted 6 lines
Well, this is part of the configurability of Linux and thats why people love it, right? One solution would be to effectively get rid of directory search denials on commodity policies (eg., give all domains search on all dirs for the RH policy) then we don't have to worry about the "top level home" directory label at all.
It is not that simple. useradd relies on home_root_t to create directories labeled user_home_dir_t.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAkegkMIACgkQrlYvE4MpobOS5QCcDfZxBWa5jVJEgrx+80h68Fuw ev8An1vnlQ5CYlarth6aUnClkbxS8b/M
=sy3x
-----END PGP SIGNATURE-----
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 69 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 57 lines · Joshua Brindle
Quoted 48 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 33 lines · Joshua Brindle
Quoted 16 lines · Todd Miller
Quoted 12 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Adding
mythtv:x:1004:1004::/var/lib/mythtv:/bin/bash
To
/etc/passwdcauses the labeling to get all screwed up. This would report an error when we used the python version of genhomedircon and not foul up the labeling by checking if there was a label for/var/libalready in thefile_contextfile. (Boy do I love python. :^))Quoted 8 lines
Quoted 5 lines
https://bugzilla.redhat.com/show_bug.cgi?id=430195
Dan
That shouldn't be hard to add to
genhomedircon.c. I'll take a look.So, Todd is about to send a patch to fix this but I want to point out that I'm adverse to this sort of thing. There is a minuid and a null shell for a reason, using something above minuid with a valid shell for a non-interactive user is a broken configuration and the fact that we have to work around it is pretty unfortunate.
Quoted 9 lines
That said the alternative of breaking the system labeling is pretty bad, its probably better to hack around the problem than leave clueless users with broken configurations stranded but I really wish we didn't have to do things like this.
*sigh*
Quoted 7 lines
I think you need to scream in the semanage that this is bad behavior, and you can't fix the labels. The
/var/libsituation is bad, but I more commonly see admins putting real users in/usr/localor under /var. We need to have a message that explains this is bad and SELinux can not handle it.Quoted 7 lines
Well, this is part of the configurability of Linux and thats why people love it, right? One solution would be to effectively get rid of directory search denials on commodity policies (eg., give all domains search on all dirs for the RH policy) then we don't have to worry about the "top level home" directory label at all.
Quoted 4 lines
It is not that simple. useradd relies on
home_root_tto create directories labeleduser_home_dir_t.
So I think this behavior is bogus. First of all the user being added might not be a user_r user and thus his home directory will be mislabeled between the time useradd adds the directory and it gets relabeled. This is a race where an unprivileged user could contaminate a privileged users environment. Second if its true that user directories commonly get moved then we have to stop relying on default transitions to do labeling and make useradd label things properly.
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 76 lines · Joshua Brindle
Quoted 70 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 58 lines · Joshua Brindle
Quoted 49 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Quoted 40 lines · Joshua Brindle
Quoted 17 lines · Todd Miller
Quoted 14 lines · Daniel J Walsh
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1Adding
mythtv:x:1004:1004::/var/lib/mythtv:/bin/bash
To
/etc/passwdcauses the labeling to get all screwed up. This would
report an error when we used the python version of genhomedircon and not foul up the labeling by checking if there was a label for/var/lib
already in thefile_contextfile. (Boy do I love python. :^))Quoted 6 lines
Quoted 4 lines
https://bugzilla.redhat.com/show_bug.cgi?id=430195
Dan
That shouldn't be hard to add to
genhomedircon.c. I'll take a look.So, Todd is about to send a patch to fix this but I want to point out that I'm adverse to this sort of thing. There is a minuid and a null shell for a reason, using something above minuid with a valid shell for
a non-interactive user is a broken configuration and the fact that we have to work around it is pretty unfortunate.That said the alternative of breaking the system labeling is pretty bad,
its probably better to hack around the problem than leave clueless users
with broken configurations stranded but I really wish we didn't have to
do things like this.Quoted 3 lines
*sigh*
Quoted 7 lines
I think you need to scream in the semanage that this is bad behavior, and you can't fix the labels. The
/var/libsituation is bad, but I more
commonly see admins putting real users in/usr/localor under /var. We need to have a message that explains this is bad and SELinux can not handle it.Quoted 7 lines
Well, this is part of the configurability of Linux and thats why people love it, right? One solution would be to effectively get rid of directory search denials on commodity policies (eg., give all domains search on all dirs for the RH policy) then we don't have to worry about the "top level home" directory label at all.
Quoted 4 lines
It is not that simple. useradd relies on
home_root_tto create directories labeleduser_home_dir_t.
Quoted 9 lines
So I think this behavior is bogus. First of all the user being added might not be a
user_ruser and thus his home directory will be mislabeled between the time useradd adds the directory and it gets relabeled. This is a race where an unprivileged user could contaminate a privileged users environment. Second if its true that user directories commonly get moved then we have to stop relying on default transitions to do labeling and make useradd label things properly.
Well two things. First I lied a little useradd has matchpathcon built into it and can actually to semanage if you give the -Z qualifier. useradd -Z staff_u -dwalsh, will label dwalsh account as staff_u in RHEL5 and Fedora 8 and less. It will also label the directory correctly if you do not use -Z but have __default__ set to be staff_u. But this does not prevent other tools from creating the directory and getting the labeling somewhat correct (system-config-users for example.)
In Rawhide I have removed all differences in homedir labeling. Every user now has a homedir labeled user_home_dir_t/user_home_t/user_mozilla_home_t. I believe separation on the homedir is wrong, and I no longer support it. It is DAC responsibility to protect users Homedirs, and the complexity of doing this with Type Enforcement was way too complicated, for little real security value. Since invariably almost all users logon to a system at the same user type. As we move to shared home directories, with different login types, having a consistant labeling of the homedirs becomes critical.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAkegmMkACgkQrlYvE4MpobMwBgCeLbBzPWnrkQQbvOQpsiNSVUc7 F3IAn1+n7ZAYxdM4FsW5XEFODF6oXG6Z
=CDWW
-----END PGP SIGNATURE-----
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.