summaryrefslogtreecommitdiff
blob: e0aad4f65c72f1f56db4b31e64190865a2c644eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- a/src/jail.c	2004-09-19 23:48:14.000000000 -0500
+++ b/src/jail.c	2004-09-20 00:07:48.000000000 -0500
@@ -115,6 +115,20 @@
 #include "helpers.h"
 #include "types.h"
 
+
+
+void make_jail_dir( char*  dir )
+{
+    for( ; *dir != '\0'; ++dir )
+    {
+        if( *dir == '.' )
+        {
+            *dir = '\0';
+            break;
+	}
+    }
+}
+
 //////////////////////////////////////////////////////////////////////////////
 //
 // main()
@@ -211,6 +225,7 @@
 	fprintf(stderr,"jail: can't get passwd info for uid %d\n",uid);
 	exit(-1);
     }
+    make_jail_dir(pwdent->dir);
 
     //
     // create the terminal devices here
@@ -289,7 +304,6 @@
     free(pwdent->dir);
     pwdent->dir = tmp_str;
 
-
     #if DEBUG != 0
      fprintf(stderr,"jail: doing chdir(%s)\n",pwdent->dir);
     #endif 
@@ -494,4 +508,3 @@
     return(-4); 
 }
 
-