From 288d6cc169706607601f185505fca50f9950c30b Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 23 Sep 2013 09:51:45 -0400 Subject: Fix potential NPE in setting shared permissions --- src/main/java/com/gitblit/GitBlit.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/gitblit/GitBlit.java') diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java index 95da669e..2cebe82b 100644 --- a/src/main/java/com/gitblit/GitBlit.java +++ b/src/main/java/com/gitblit/GitBlit.java @@ -2534,16 +2534,16 @@ public class GitBlit implements ServletContextListener { } } + // Adjust permissions in case we updated the config files + JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "config"), + getString(Keys.git.createRepositoriesShared, "FALSE")); + JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "HEAD"), + getString(Keys.git.createRepositoriesShared, "FALSE")); + // close the repository object r.close(); } - // Adjust permissions in case we updated the config files - JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "config"), - getString(Keys.git.createRepositoriesShared, "FALSE")); - JGitUtils.adjustSharedPerm(new File(r.getDirectory().getAbsolutePath(), "HEAD"), - getString(Keys.git.createRepositoriesShared, "FALSE")); - // update repository cache removeFromCachedRepositoryList(repositoryName); // model will actually be replaced on next load because config is stale -- cgit v1.2.3