/[gentoo-x86]/net-ftp/pftpfxp/files/0.11.4.6-correct_bookmark_path.patch
Gentoo

Contents of /net-ftp/pftpfxp/files/0.11.4.6-correct_bookmark_path.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Mar 16 16:48:38 2012 UTC (2 years, 4 months ago) by jer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Fix bug #408231. Set RDEPEND. Move preparation stuff to src_prepare(). Respect LDFLAGS. Remove old patches. Do not automagically compile against dev-libs/openssl.

(Portage version: 2.2.0_alpha90/cvs/Linux x86_64)

1 diff -Naur old/pftpfxp-mew/include/defines.h new/pftpfxp-mew/include/defines.h
2 --- old/pftpfxp-mew/include/defines.h 2006-07-28 08:55:08.000000000 +0200
3 +++ new/pftpfxp-mew/include/defines.h 2006-07-28 08:57:28.000000000 +0200
4 @@ -209,9 +209,6 @@
5
6 #define PASSWORD_SIZE 60
7
8 -#define BOOKMARK_RC ".pftp/bookmarks"
9 -#define BOOKMARK_RC_BAK ".pftp/bookmarks.bak"
10 -
11 #define DEFAULT_OKAY "[ okay ]"
12
13 #define PASS_MAGIC ",.,-.%$&%2.--,.-jio433-:52.-$:-.1hinui#+43+.5230.9401431.-54,.-fdioru892032"
14 diff -Naur old/pftpfxp-mew/src/bookmark.cc new/pftpfxp-mew/src/bookmark.cc
15 --- old/pftpfxp-mew/src/bookmark.cc 2006-07-28 08:55:08.000000000 +0200
16 +++ new/pftpfxp-mew/src/bookmark.cc 2006-07-28 17:16:32.000000000 +0200
17 @@ -23,15 +23,38 @@
18 char *line = new(char[2048]), *enc = new(char[4096]);
19 BOOKMARK *bm_temp = global_bookmark;
20 char tempcwd[SERVER_WORKINGDIR_SIZE];
21 + char *home_directory;
22 + char *bookmark_file;
23 + char *bookmark_file_bak;
24 + int n;
25 +
26 + home_directory = getenv("HOME");
27 + n = strlen(home_directory) + sizeof("/.pftp/bookmarks") + 1;
28 +
29 + if ((bookmark_file=(char*)malloc(n))==NULL) {
30 + fprintf(stderr,"error allocating memory\n");
31 + exit( -1);
32 + }
33 +
34 + sprintf(bookmark_file, "%s/.pftp/bookmarks", home_directory);
35 +
36 + n = strlen(home_directory) + sizeof("/.pftp/bookmarks.bak") + 1;
37 + if ((bookmark_file_bak=(char*)malloc(n))==NULL) {
38 + fprintf(stderr,"error allocating memory\n");
39 + exit( -1);
40 + }
41 +
42 + sprintf(bookmark_file_bak, "%s/.pftp/bookmarks.bak", home_directory);
43
44 getcwd(tempcwd, SERVER_WORKINGDIR_SIZE);
45 chdir(startcwd);
46
47 // backup old bookmark-file
48 - rename(BOOKMARK_RC, BOOKMARK_RC_BAK);
49 + rename(bookmark_file, bookmark_file_bak);
50 + free(bookmark_file_bak);
51
52 pass_pos = 0;
53 - if ((file_out = fopen(BOOKMARK_RC, "w"))) {
54 + if ((file_out = fopen(bookmark_file, "w"))) {
55 // put magic and version number
56 strcpy(line, PASS_MAGIC);
57 Encrypt(line, enc);
58 @@ -297,6 +320,7 @@
59 delete[](line);
60 delete[](enc);
61 chdir(tempcwd);
62 + free(bookmark_file);
63 }
64
65 void CDisplayHandler::Decrypt(char *in, char *out) {
66 @@ -383,12 +407,25 @@
67 char *line = new(char[4096]), *out = new(char[2048]);
68 BOOKMARK *bm_new, *bm_temp = NULL;
69 char tempcwd[SERVER_WORKINGDIR_SIZE];
70 + char *home_directory;
71 + char *bookmark_file;
72 + int n;
73
74 + pass_pos = 0;
75 + home_directory = getenv("HOME");
76 + n = strlen(home_directory) + sizeof("/.pftp/bookmarks") + 1;
77 +
78 + if ((bookmark_file=(char*)malloc(n))==NULL) {
79 + fprintf(stderr,"error allocating memory\n");
80 + exit( -1);
81 + }
82 + sprintf(bookmark_file, "%s/.pftp/bookmarks", home_directory);
83 +
84 getcwd(tempcwd, SERVER_WORKINGDIR_SIZE);
85 chdir(startcwd);
86 -
87 - pass_pos = 0;
88 - if ((file_in = fopen(BOOKMARK_RC, "r"))) {
89 +
90 + if ((file_in = fopen(bookmark_file, "r"))) {
91 + free(bookmark_file);
92 // check bookmark-id
93 fgets(line, 4095, file_in);
94
95 @@ -2303,6 +2340,7 @@
96 chdir(tempcwd);
97 return (TRUE);
98 }
99 + free(bookmark_file);
100 delete[](line);
101 delete[](out);
102 chdir(tempcwd);
103 @@ -2313,11 +2351,24 @@
104 FILE *file_probe;
105 char tempcwd[SERVER_WORKINGDIR_SIZE];
106 char *line;
107 + char *home_directory;
108 + char *bookmark_file;
109 + int n;
110 +
111 + home_directory = getenv("HOME");
112 + n = strlen(home_directory) + sizeof("/.pftp/bookmarks") + 1;
113 +
114 + if ((bookmark_file=(char*)malloc(n))==NULL) {
115 + fprintf(stderr,"error allocating memory\n");
116 + exit( -1);
117 + }
118 + sprintf(bookmark_file, "%s/.pftp/bookmarks", home_directory);
119
120 getcwd(tempcwd, SERVER_WORKINGDIR_SIZE);
121 chdir(startcwd);
122
123 - if ((file_probe = fopen(BOOKMARK_RC, "r"))) {
124 + if ((file_probe = fopen(bookmark_file, "r"))) {
125 + free(bookmark_file);
126 // check bookmark-id
127 line = new(char[4096]);
128 fgets(line, 4095, file_probe);
129 @@ -2358,6 +2409,7 @@
130 delete[](line);
131 return (1);
132 } else {
133 + free(bookmark_file);
134 chdir(tempcwd);
135 return (2);
136 }

  ViewVC Help
Powered by ViewVC 1.1.20