On Fri, 2018-05-04 at 14:55 -0700, Akemi Yagi wrote:> On Fri, May 4, 2018 at 2:26 PM, Warren Young <warren at etr-usa.com> > wrote: > > On May 4, 2018, at 3:03 PM, Akemi Yagi <amyagi at gmail.com> wrote: > > > > > > On Fri, May 4, 2018 at 12:03 PM, Warren Young <warren at etr-usa.com > > > > wrote: > > > > > > > > $ sudo chcon -R -t samba_share_t /path/to/share > > > > > > Updated the page as suggested. Thanks. > > > > Thanks! > > > > I now see another instance of this in section 3. Instead of > > copying the text verbatim, it should probably be: > > > > chcon -R -t samba_share_t /mnt/data > > > > ?in order to match the text above it. > > Warren, > > I was just informed that the chcon command your suggested was > originally there, but it was replaced with the 2 line version > sometime > ago. The reason given was "Replace chcon by semanage/restorecon pair > to survive filesystem relabel".The comment is correct: chcon will not survive a relabel. You need to update the database first (semanage fcontext) and then let a relabel apply the new context. Louis
On Fri, May 4, 2018 at 3:11 PM, Louis Lagendijk <louis at fazant.net> wrote:> On Fri, 2018-05-04 at 14:55 -0700, Akemi Yagi wrote: >> On Fri, May 4, 2018 at 2:26 PM, Warren Young <warren at etr-usa.com> >> wrote: >> > On May 4, 2018, at 3:03 PM, Akemi Yagi <amyagi at gmail.com> wrote: >> > > >> > > On Fri, May 4, 2018 at 12:03 PM, Warren Young <warren at etr-usa.com >> > > > wrote: >> > > > >> > > > $ sudo chcon -R -t samba_share_t /path/to/share >> > > >> > > Updated the page as suggested. Thanks. >> > >> > Thanks! >> > >> > I now see another instance of this in section 3. Instead of >> > copying the text verbatim, it should probably be: >> > >> > chcon -R -t samba_share_t /mnt/data >> > >> > ?in order to match the text above it. >> >> Warren, >> >> I was just informed that the chcon command your suggested was >> originally there, but it was replaced with the 2 line version >> sometime >> ago. The reason given was "Replace chcon by semanage/restorecon pair >> to survive filesystem relabel". > > The comment is correct: chcon will not survive a relabel. You need to > update the database first (semanage fcontext) and then let a relabel > apply the new context. > > LouisThanks for the input. Reverted the change. Akemi
On May 4, 2018, at 4:11 PM, Louis Lagendijk <louis at fazant.net> wrote:> > The comment is correct: chcon will not survive a relabel. You need to > update the database first (semanage fcontext) and then let a relabel > apply the new context.Alright, then why do I get that error when I give the command from this morning?s wiki text, and how do I avoid it?
On 05/04/2018 04:05 PM, Warren Young wrote:> On May 4, 2018, at 4:11 PM, Louis Lagendijk <louis at fazant.net> wrote: >> The comment is correct: chcon will not survive a relabel. You need to >> update the database first (semanage fcontext) and then let a relabel >> apply the new context. > Alright, then why do I get that error when I give the command from this morning?s wiki text, and how do I avoid it?# od -c sudo semanage fcontext ?at samba_share_t /path/to/share 0000000?? s?? u?? d?? o?????? s?? e?? m?? a?? n?? a?? g?? e f?? c 0000020?? o?? n?? t?? e?? x?? t???? 342 200 223?? a?? t?????? s a?? m 0000040?? b?? a?? _?? s?? h?? a?? r?? e?? _?? t?????? /?? p?? a t?? h 0000060?? /?? t?? o?? /?? s?? h?? a?? r?? e? \n You get the error because that isn't a hyphen, it's an en-dash. Someone probably copied and pasted from Word.