All of lore.kernel.org
 help / color / mirror / Atom feed
* restorecon / matchpathcon
@ 2008-11-06 16:04 LC Bruzenak
  2008-11-06 16:35 ` Daniel J Walsh
  0 siblings, 1 reply; 5+ messages in thread
From: LC Bruzenak @ 2008-11-06 16:04 UTC (permalink / raw)
  To: SE Linux

I see no way to recursively/silently check path context.

The matchpathcon command has a silent but no recursive option. It does
return non-zero if something doesn't match.

The restorecon command has both recursive and don't change options but
no silent. It does not return non-zero if there is a change to be made,
so a redirect of stdout to /dev/null wouldn't suffice.

Is there another way/command?

Thx,
LCB.

-- 
LC (Lenny) Bruzenak
lenny@magitekltd.com


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: restorecon / matchpathcon
  2008-11-06 16:04 restorecon / matchpathcon LC Bruzenak
@ 2008-11-06 16:35 ` Daniel J Walsh
  2008-11-06 16:45   ` LC Bruzenak
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel J Walsh @ 2008-11-06 16:35 UTC (permalink / raw)
  To: LC Bruzenak; +Cc: SE Linux

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

LC Bruzenak wrote:
> I see no way to recursively/silently check path context.
> 
> The matchpathcon command has a silent but no recursive option. It does
> return non-zero if something doesn't match.
> 
> The restorecon command has both recursive and don't change options but
> no silent. It does not return non-zero if there is a change to be made,
> so a redirect of stdout to /dev/null wouldn't suffice.
> 
> Is there another way/command?
> 
> Thx,
> LCB.
> 
find | xargs matchpathcon?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkkTHNcACgkQrlYvE4MpobNdUACguPKVCvd8tG7bF8YIROetLbpT
GVcAoIEWXVxZW4yAdSWj4eEgsOzL4PpR
=jnXd
-----END PGP SIGNATURE-----

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: restorecon / matchpathcon
  2008-11-06 16:35 ` Daniel J Walsh
@ 2008-11-06 16:45   ` LC Bruzenak
  2008-11-06 16:59     ` Daniel J Walsh
  0 siblings, 1 reply; 5+ messages in thread
From: LC Bruzenak @ 2008-11-06 16:45 UTC (permalink / raw)
  To: Daniel J Walsh; +Cc: SE Linux


On Thu, 2008-11-06 at 11:35 -0500, Daniel J Walsh wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> LC Bruzenak wrote:
> > I see no way to recursively/silently check path context.
> > 
> > The matchpathcon command has a silent but no recursive option. It does
> > return non-zero if something doesn't match.
> > 
> > The restorecon command has both recursive and don't change options but
> > no silent. It does not return non-zero if there is a change to be made,
> > so a redirect of stdout to /dev/null wouldn't suffice.
> > 
> > Is there another way/command?
> > 
> > Thx,
> > LCB.
> > 
> find | xargs matchpathcon?

I think in this case the $? return value would refer to the find not
matchpathcon right?

LCB.

-- 
LC (Lenny) Bruzenak
lenny@magitekltd.com


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: restorecon / matchpathcon
  2008-11-06 16:45   ` LC Bruzenak
@ 2008-11-06 16:59     ` Daniel J Walsh
  2008-11-06 17:19       ` LC Bruzenak
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel J Walsh @ 2008-11-06 16:59 UTC (permalink / raw)
  To: LC Bruzenak; +Cc: SE Linux

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

LC Bruzenak wrote:
> On Thu, 2008-11-06 at 11:35 -0500, Daniel J Walsh wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> LC Bruzenak wrote:
>>> I see no way to recursively/silently check path context.
>>>
>>> The matchpathcon command has a silent but no recursive option. It does
>>> return non-zero if something doesn't match.
>>>
>>> The restorecon command has both recursive and don't change options but
>>> no silent. It does not return non-zero if there is a change to be made,
>>> so a redirect of stdout to /dev/null wouldn't suffice.
>>>
>>> Is there another way/command?
>>>
>>> Thx,
>>> LCB.
>>>
>> find | xargs matchpathcon?
> 
> I think in this case the $? return value would refer to the find not
> matchpathcon right?
> 
> LCB.
> 
matchpathcon -V PATH

Checks the context on disk versus the default, and sets the exit status
I believe.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkkTIlQACgkQrlYvE4MpobMqgQCfRK/l0bIFWcmCENRN5EAamm7K
TnoAoOvhSz4nTk6fLso9rGJypGs9g6mT
=4hGy
-----END PGP SIGNATURE-----

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: restorecon / matchpathcon
  2008-11-06 16:59     ` Daniel J Walsh
@ 2008-11-06 17:19       ` LC Bruzenak
  0 siblings, 0 replies; 5+ messages in thread
From: LC Bruzenak @ 2008-11-06 17:19 UTC (permalink / raw)
  To: Daniel J Walsh; +Cc: SE Linux

Thanks Dan, I think that works:

[root@hugo ICM]# find `pwd`  | xargs  matchpathcon -Vq
[root@hugo ICM]#  echo $?
123
[root@hugo ICM]# restorecon -rv `pwd`
restorecon reset /var/opt/jcdx/ICM/Labeled context
system_u:object_r:jcdx_icm_var_t:s0->system_u:object_r:jcdx_icm_var_t:s15:c0.c1023
[root@hugo ICM]# find `pwd`  | xargs  matchpathcon -Vq
[root@hugo ICM]#  echo $?
0

-- 
LC (Lenny) Bruzenak
lenny@magitekltd.com


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-11-06 17:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-06 16:04 restorecon / matchpathcon LC Bruzenak
2008-11-06 16:35 ` Daniel J Walsh
2008-11-06 16:45   ` LC Bruzenak
2008-11-06 16:59     ` Daniel J Walsh
2008-11-06 17:19       ` LC Bruzenak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.