GitInfo: Fix shell restrictions for submodules
authorKunal Mehta <legoktm@member.fsf.org>
Sun, 3 Dec 2017 07:19:24 +0000 (23:19 -0800)
committerKunal Mehta <legoktm@member.fsf.org>
Sun, 3 Dec 2017 07:19:24 +0000 (23:19 -0800)
commit0d1a6a4d1fa18ee1048f9794fb497eda1c2b28df
treef88389c57bd5f908e9a958e9b2e0f230c122f3a8
parent808e45d13d400256d36cfcd95e79a567197d9a8b
GitInfo: Fix shell restrictions for submodules

Submodules have their git directory in the master repository's directory
(../.git/modules/<name>). firejail does not allow whitelisted paths to
have ".." in them, so use realpath() to get rid of that.

`git show` still wants to be able to access the main repository
directory though, so we also need to whitelist the $repoDir itself.

Bug: T181919
Change-Id: I928df92b47733bc7fbb9c796bcfc1504d4a4598c
includes/GitInfo.php