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:
parent
a07493d1a1
commit
93a680280f
|
@ -101,6 +101,11 @@ int main(int argc, char **argv)
|
||||||
for (i = optind; i < argc; i++) {
|
for (i = optind; i < argc; i++) {
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
struct stat buf;
|
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)
|
if (lstat(argv[i], &buf) == 0)
|
||||||
mode = buf.st_mode;
|
mode = buf.st_mode;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue