All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch matchpathcon to eliminate file "/"
@ 2009-03-04 20:39 Daniel J Walsh
  2009-04-16 21:39 ` Chad Sellers
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel J Walsh @ 2009-03-04 20:39 UTC (permalink / raw)
  To: SE Linux

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

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

So

matchpathcon /etc/
Will work the same as
matchpathcon /etc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkmu5wMACgkQrlYvE4MpobNK4gCgiVeXXEZcCMsJKXM7jqh6r1u3
OScAoLcmXBIR63gpvA8RS3g07pcPC6IF
=e+Re
-----END PGP SIGNATURE-----

[-- Attachment #2: libselinux-matchpathcon.patch --]
[-- Type: text/plain, Size: 422 bytes --]

--- nsalibselinux/utils/matchpathcon.c	2008-10-28 10:06:51.000000000 -0400
+++ libselinux-2.0.78/utils/matchpathcon.c	2009-03-04 15:23:52.000000000 -0500
@@ -101,6 +101,11 @@
 	for (i = optind; i < argc; i++) {
 		int mode = 0;
 		struct stat buf;
+		int len = strlen(argv[i]);
+		if (len > 1  && argv[i][len - 1 ] == '/') {
+			argv[i][len - 1 ] = '\0';
+		}
+
 		if (lstat(argv[i], &buf) == 0)
 			mode = buf.st_mode;
 

[-- Attachment #3: libselinux-matchpathcon.patch.sig --]
[-- Type: application/pgp-signature, Size: 72 bytes --]

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

* Re: Patch matchpathcon to eliminate file "/"
  2009-03-04 20:39 Patch matchpathcon to eliminate file "/" Daniel J Walsh
@ 2009-04-16 21:39 ` Chad Sellers
  2009-05-18 15:27   ` Joshua Brindle
  0 siblings, 1 reply; 3+ messages in thread
From: Chad Sellers @ 2009-04-16 21:39 UTC (permalink / raw)
  To: Daniel J Walsh, SE Linux

On 3/4/09 3:39 PM, "Daniel J Walsh" <dwalsh@redhat.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> So
> 
> matchpathcon /etc/
> Will work the same as
> matchpathcon /etc
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkmu5wMACgkQrlYvE4MpobNK4gCgiVeXXEZcCMsJKXM7jqh6r1u3
> OScAoLcmXBIR63gpvA8RS3g07pcPC6IF
> =e+Re
> -----END PGP SIGNATURE-----
> --- nsalibselinux/utils/matchpathcon.c 2008-10-28 10:06:51.000000000 -0400
> +++ libselinux-2.0.78/utils/matchpathcon.c 2009-03-04 15:23:52.000000000 -0500
> @@ -101,6 +101,11 @@
> for (i = optind; i < argc; i++) {
> int mode = 0;
> struct stat buf;
> +  int len = strlen(argv[i]);
> +  if (len > 1  && argv[i][len - 1 ] == '/') {
> +   argv[i][len - 1 ] = '\0';
> +  }
> +
> if (lstat(argv[i], &buf) == 0)
> mode = buf.st_mode;
>  

Looks fine to me.

Acked-by: Chad Sellers <csellers@tresys.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] 3+ messages in thread

* Re: Patch matchpathcon to eliminate file "/"
  2009-04-16 21:39 ` Chad Sellers
@ 2009-05-18 15:27   ` Joshua Brindle
  0 siblings, 0 replies; 3+ messages in thread
From: Joshua Brindle @ 2009-05-18 15:27 UTC (permalink / raw)
  To: Chad Sellers; +Cc: Daniel J Walsh, SE Linux

Chad Sellers wrote:
> On 3/4/09 3:39 PM, "Daniel J Walsh" <dwalsh@redhat.com> wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> So
>>
>> matchpathcon /etc/
>> Will work the same as
>> matchpathcon /etc
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.9 (GNU/Linux)
>> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
>>
>> iEYEARECAAYFAkmu5wMACgkQrlYvE4MpobNK4gCgiVeXXEZcCMsJKXM7jqh6r1u3
>> OScAoLcmXBIR63gpvA8RS3g07pcPC6IF
>> =e+Re
>> -----END PGP SIGNATURE-----
>> --- nsalibselinux/utils/matchpathcon.c 2008-10-28 10:06:51.000000000 -0400
>> +++ libselinux-2.0.78/utils/matchpathcon.c 2009-03-04 15:23:52.000000000 -0500
>> @@ -101,6 +101,11 @@
>> for (i = optind; i < argc; i++) {
>> int mode = 0;
>> struct stat buf;
>> +  int len = strlen(argv[i]);
>> +  if (len > 1  && argv[i][len - 1 ] == '/') {
>> +   argv[i][len - 1 ] = '\0';
>> +  }
>> +
>> if (lstat(argv[i], &buf) == 0)
>> mode = buf.st_mode;
>>  
> 
> Looks fine to me.
> 
> Acked-by: Chad Sellers <csellers@tresys.com>
> 

Merged in libselinux-2.0.81

--
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] 3+ messages in thread

end of thread, other threads:[~2009-05-18 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-04 20:39 Patch matchpathcon to eliminate file "/" Daniel J Walsh
2009-04-16 21:39 ` Chad Sellers
2009-05-18 15:27   ` Joshua Brindle

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.