[PATCH 73/90] realpath_not_final was returning '//NAME' if /NAME was

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


   This patch looks good to me. acked.

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

iEYEARECAAYFAk/I+1QACgkQrlYvE4MpobMD3QCgwLCmz/YapJgHx0zdDfp8P8cF
BJ0An0gQ1hmmOfaPl9K+0915zgdgQrJt
=vSoK
-----END PGP SIGNATURE-----
>From 05a328ebd4403b9e0d754bfe2401c59130ffc256 Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@xxxxxxxxxx>
Date: Fri, 25 May 2012 07:13:48 -0400
Subject: [PATCH 73/90] realpath_not_final was returning '//NAME' if /NAME was
 a symbolic link

---
 libselinux/src/matchpathcon.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/libselinux/src/matchpathcon.c b/libselinux/src/matchpathcon.c
index c18ea47..6457e4a 100644
--- a/libselinux/src/matchpathcon.c
+++ b/libselinux/src/matchpathcon.c
@@ -399,10 +399,13 @@ int realpath_not_final(const char *name, char *resolved_path)
 		goto out;
 	}
 
-	resolved_path += len;
-	strcpy(resolved_path, "/");
-	resolved_path += 1;
-	strcpy(resolved_path, last_component);
+	p = resolved_path;
+	p += len;
+	if (strcmp(resolved_path, "/") != 0) {
+		strcpy(p, "/");
+		p += 1;
+	}
+	strcpy(p, last_component);
 out:
 	free(tmp_path);
 	return rc;
-- 
1.7.10.2


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux