[Evolvis-commits] r308: This program is suid to root, please check Roland↵

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Feb 25 14:15:29 CET 2010


Author: mirabilos
Date: 2010-02-25 13:15:28 +0000 (Thu, 25 Feb 2010)
New Revision: 308

Modified:
   trunk/gforge_base/evolvisforge/
   trunk/gforge_base/evolvisforge/gforge/utils/fileforge.c
Log:
This program is suid to root, please check Roland



Property changes on: trunk/gforge_base/evolvisforge
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2001-09-15 21:05:29.000000000 +0000
committer: cbayle

   + timestamp: 2001-09-16 19:05:05.000000000 +0000
committer: cbayle

Name: bzr:file-ids
   - gforge/deb-specific/dns.head.template	7 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Fdeb-specific%2Fdns.head.template

   + gforge/utils/fileforge.c	2 at 9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk%2Fgforge%2Futils%2Ffileforge.c

Name: bzr:revision-id:v4
   - 1 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:1
2 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:2
3 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:7
4 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:9
5 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:10
6 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:11
7 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:12
8 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:13
9 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:14
10 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:15
11 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:16
12 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:17
13 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:18
14 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:19
15 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:20
16 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:21
17 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:22
18 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:23
19 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:24
20 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:25
21 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:26
22 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:27
23 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:28
24 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:29
25 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:30
26 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:31
27 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:32
28 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:33
29 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:34
30 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:35
31 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:36
32 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:37
33 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:38
34 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:39
35 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:40
36 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:41
37 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:42
38 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:43
39 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:44
40 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:45
41 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:46
42 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:47
43 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:48
44 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:49
45 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:50
46 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:51
47 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:52
48 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:53
49 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:54
50 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:55
51 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:56
52 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:57
53 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:58
54 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:59
55 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:60
56 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:61
57 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:62
58 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:63
59 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:64
60 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:65
61 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:66
62 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:67
63 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:68
64 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:69
65 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:70
66 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:71
67 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:72
68 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:73
69 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:74
70 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:75
71 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:76
72 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:77
73 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:78

   + 1 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:1
2 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:2
3 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:7
4 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:9
5 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:10
6 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:11
7 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:12
8 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:13
9 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:14
10 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:15
11 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:16
12 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:17
13 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:18
14 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:19
15 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:20
16 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:21
17 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:22
18 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:23
19 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:24
20 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:25
21 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:26
22 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:27
23 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:28
24 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:29
25 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:30
26 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:31
27 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:32
28 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:33
29 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:34
30 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:35
31 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:36
32 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:37
33 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:38
34 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:39
35 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:40
36 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:41
37 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:42
38 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:43
39 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:44
40 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:45
41 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:46
42 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:47
43 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:48
44 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:49
45 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:50
46 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:51
47 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:52
48 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:53
49 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:54
50 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:55
51 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:56
52 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:57
53 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:58
54 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:59
55 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:60
56 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:61
57 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:62
58 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:63
59 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:64
60 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:65
61 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:66
62 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:67
63 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:68
64 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:69
65 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:70
66 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:71
67 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:72
68 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:73
69 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:74
70 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:75
71 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:76
72 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:77
73 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:78
74 svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:79

Name: bzr:text-parents
   - gforge/deb-specific/dns.head.template	svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:42

   + gforge/utils/fileforge.c	svn-v4:9d84d37e-dcb1-4aad-b103-6f3d92f53bf6:trunk:7


Modified: trunk/gforge_base/evolvisforge/gforge/utils/fileforge.c
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/utils/fileforge.c	2010-02-25 13:15:26 UTC (rev 307)
+++ trunk/gforge_base/evolvisforge/gforge/utils/fileforge.c	2010-02-25 13:15:28 UTC (rev 308)
@@ -45,8 +45,10 @@
 int main (int argc, char** argv) {
 
   /* edit me */
-  char* src_dir   = "/usr/lib/sourceforge/ftp/incoming/";
-  char* dest_dir  = "/usr/lib/sourceforge/download/";
+  char* src_dir_root   = "/var/lib/sourceforge/chroot/home/users/";
+  char* src_dir_incoming = "/incoming/";
+  char* dest_dir_root  = "/var/lib/sourceforge/download/";
+  char* dest_dir_download = "/";
 
   /* don't edit me (unless mv isn't in /bin) */
   char* move_path = "/bin/mv";
@@ -54,46 +56,53 @@
   char* dest_file;
   char* src_file;
 
-  if (argc != 3) {
-    fprintf(stderr, "FAILURE: usage: fileforge file group");
+  if (argc != 4) {
+    fprintf(stderr, "FAILURE: usage: fileforge file user group\n");
     exit(1);
   } /* if */
   else {
     /* set source */
-    src_file = (char *) malloc(strlen(src_dir) + strlen(argv[1]) + 1);
-    strcpy(src_file, src_dir);
+    src_file = (char *) malloc(strlen(src_dir_root) + strlen(src_dir_incoming) + strlen(argv[1]) + 1 );
+    strcpy(src_file, src_dir_root);
+    strcat(src_file, argv[2]);
+    strcat(src_file, src_dir_incoming);
     strcat(src_file, argv[1]);
 
     /* set destination */
-    dest_file = (char *) malloc(strlen(dest_dir) + strlen(argv[2]) + 1);
-    strcpy(dest_file, dest_dir);
-    strcat(dest_file, argv[2]);
+    dest_file = (char *) malloc(strlen(dest_dir_root) + strlen(dest_dir_download) + strlen(argv[2]) + 1);
+    strcpy(dest_file, dest_dir_root);
+    strcat(dest_file, argv[3]);
+    strcat(dest_file, dest_dir_download);
 
     /* test for legal characters: [a-zA-Z0-9_-.]  */
     /* test for illegal combinations of legal characters: ".." */
     if (!legal_string(src_file)) {
+      fprintf(stderr,"SRC=%s\nDEST=%s\n",src_file,dest_file);
       fprintf(stderr, "FAILURE: illegal characters in source file\n");
       exit(1);
     } /* if */
 
     if (!legal_string(dest_file)) {
+      fprintf(stderr,"SRC=%s\nDEST=%s\n",src_file,dest_file);
       fprintf(stderr, "FAILURE: illegal characters in destination file\n");
       exit(1);
     } /* if */
 
     if ((mkdir(dest_file, 0775) != 0) && errno != EEXIST) {
+      fprintf(stderr,"SRC=%s\nDEST=%s\n",src_file,dest_file);
       fprintf(stderr, "FAILURE: destination directory could not be created\n");
       exit(1);
     } /* if */
 
     /* exec it */
     if (execl(move_path, move_file, src_file, dest_file, (char *)0) == -1) {
+      fprintf(stderr,"SRC=%s\nDEST=%s\n",src_file,dest_file);
       perror("FAILURE");
       exit(1);
     } /* if */
   } /* else */
 
-  printf("OK\n");
+  /* printf("OK\n"); */
   free(dest_file);
   free(src_file);
   exit(0);




More information about the evolvis-commits mailing list