-3

This is an practice RHCE question. I need to change the mail files from /var/spool/mail/user to /var/spool/user. Note that SELinux must remain enabled at all times. Will I need to change any folder context or enable any Boolean values?

Edit:

I know this is not good practice and I wouldn't normally do this.

I know the context of /var/spool has to change to mail_spool_t but that would break other services using it and it was confusing.

Jacob
  • 9,204
  • 4
  • 45
  • 56
kamelion
  • 1
  • 1
  • 1
    `/var/spool` is used by many different services. Don't just go throwing mail in it, or Bad Things will happen sooner or later. This is why it's in `/var/spool/mail` to begin with. – Michael Hampton Jun 25 '13 at 18:28
  • i wouldn't normally do that .. but as i said this is an actual RHCE exam question – kamelion Jun 25 '13 at 18:30
  • 2
    I rather doubt that the _real_ RHCE exam will ask you to do something that is not only impossible but violates best practices so egregiously. I don't know what exam you're looking at, but I suspect you wasted your money on it. – Michael Hampton Jun 25 '13 at 18:51
  • lol thanks for confirming my doubts ... and i didn't pay money for it thank god :D – kamelion Jun 25 '13 at 18:52

1 Answers1

2

The file context for mail spool files is mail_spool_t. You will need to use semanage and chcon to set it on the new location.

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
  • thanks for the answer ... but isnt /var/spool itself already have var_spool_t won't changing it break something else – kamelion Jun 25 '13 at 18:08
  • @kamelion If the question is a simple "How would you go about..." (i.e. purely theoretical), the answer above is how you'd do it. If the question is practical, the answer is "You shouldn't do that. It's ***Bad And Wrong***, violates [the Principle of Least Astonishment](http://en.wikipedia.org/wiki/Principle_of_least_astonishment), and will make the next sysadmin want to cause you serious bodily harm". – voretaq7 Jun 25 '13 at 18:55
  • that's what i thought .. i had to make sure ... thanks – kamelion Jun 25 '13 at 18:58