summaryrefslogtreecommitdiff
blob: e522828e286c1c60b3dff91e7b84747584526c8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
commit 762cca3fd4aa754b266f928ec3fa2ad2261a831e
Author: Alexander Zubkov <green@qrator.net>
Date:   Mon Oct 22 20:31:04 2018 +0200

    honor standalone '.' in path, split jail dir on "/./" pattern

diff --git a/src/jail.c b/src/jail.c
index 74f3eb1..3d649c4 100644
--- a/src/jail.c
+++ b/src/jail.c
@@ -121,8 +121,9 @@ void make_jail_dir( char*  dir )
 {
     for( ; *dir != '\0'; ++dir )
     {
-        if( *dir == '.' )
+        if( dir[0] == '/' && dir[1] == '.' && dir[2] == '/' )
         {
+            ++dir;
             *dir = '\0';
             break;
 	}