Author: Daniel J Walsh

Email: dwalsh@redhat.com
Subject: Patch matchpathcon to eliminate file "/"
Date: Wed, 04 Mar 2009 15:39:31 -0500

-----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-----

Signed-off-by: Chad Sellers <csellers@tresys.com>
This commit is contained in:
Daniel J Walsh 2009-04-10 11:33:23 -04:00 committed by Chad Sellers
parent a07493d1a1
commit 93a680280f
1 changed files with 5 additions and 0 deletions

View File

@ -101,6 +101,11 @@ int main(int argc, char **argv)
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;