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.
On May 5, 2018, at 12:04 AM, Gordon Messmer <gordon.messmer at gmail.com> wrote:> > 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.The formatting is from my mailer. The paste into the terminal wouldn?t have been affected. And again, the chcon command succeeded, with the same type name, copied from the same source by the same method.
On 05/04/2018 11:15 PM, Warren Young wrote:> On May 5, 2018, at 12:04 AM, Gordon Messmer <gordon.messmer at gmail.com> wrote: >> On 05/04/2018 04:05 PM, Warren Young wrote: >>> 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? >> You get the error because that isn't a hyphen, it's an en-dash. Someone probably copied and pasted from Word. > The formatting is from my mailer. The paste into the terminal wouldn?t have been affected. > And again, the chcon command succeeded, with the same type name, copied from the same source by the same method.The only way I can get semanage to output the error you reported is if that command is run with an en-dash instead of a hyphen.? I'm really pretty confident that it was an en-dash when you ran the command. The command works when it's run with a hyphen, and it will print a different error if there is any other type of usage error I've tested.