summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/manager
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-03-19 08:51:17 -0400
committerJames Moger <james.moger@gitblit.com>2014-04-10 18:58:09 -0400
commit13331ae61c7f08b4a202a531e005915147467bd8 (patch)
tree615fb056d77ec2951b85a0dfccd45f2912ce6ef6 /src/main/java/com/gitblit/manager
parente1dbd00bf504d8ebadeb8f3f590f16d7750aaf85 (diff)
downloadgitblit-13331ae61c7f08b4a202a531e005915147467bd8.tar.gz
gitblit-13331ae61c7f08b4a202a531e005915147467bd8.zip
Exclude SSH repository urls from anonymous users
Diffstat (limited to 'src/main/java/com/gitblit/manager')
-rw-r--r--src/main/java/com/gitblit/manager/ServicesManager.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/manager/ServicesManager.java b/src/main/java/com/gitblit/manager/ServicesManager.java
index 17724f2b..93121cfb 100644
--- a/src/main/java/com/gitblit/manager/ServicesManager.java
+++ b/src/main/java/com/gitblit/manager/ServicesManager.java
@@ -228,6 +228,10 @@ public class ServicesManager implements IManager {
}
public String getSshDaemonUrl(HttpServletRequest request, UserModel user, RepositoryModel repository) {
+ if (user == null || UserModel.ANONYMOUS.equals(user)) {
+ // SSH always requires authentication - anonymous access prohibited
+ return null;
+ }
if (sshDaemon != null) {
String bindInterface = settings.getString(Keys.git.sshBindInterface, "localhost");
if (bindInterface.equals("localhost")