Diffstat (limited to 'core/launcher/transferserver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/transferserver.cpp | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp index 9519d11..9cb9d7a 100644 --- a/core/launcher/transferserver.cpp +++ b/core/launcher/transferserver.cpp | |||
@@ -16,26 +16,26 @@ | |||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | //#define _XOPEN_SOURCE | 20 | //#define _XOPEN_SOURCE |
21 | 21 | ||
22 | #include <qtopia/global.h> | 22 | #include <opie2/oglobal.h> |
23 | #include <qtopia/qpeapplication.h> | 23 | #include <qtopia/qpeapplication.h> |
24 | 24 | ||
25 | #ifndef Q_OS_WIN32 | 25 | #ifndef Q_OS_WIN32 |
26 | #include <pwd.h> | 26 | #include <pwd.h> |
27 | #include <sys/types.h> | 27 | #include <sys/types.h> |
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #include <stdlib.h> | 29 | #include <stdlib.h> |
30 | #include <time.h> | 30 | #include <time.h> |
31 | 31 | ||
32 | #ifndef Q_OS_MACX | 32 | #ifndef Q_OS_MACX |
33 | #include <shadow.h> | 33 | #include <shadow.h> |
34 | #include <crypt.h> | 34 | #include <crypt.h> |
35 | #endif /* Q_OS_MACX */ | 35 | #endif /* Q_OS_MACX */ |
36 | 36 | ||
37 | #else | 37 | #else |
38 | #include <stdlib.h> | 38 | #include <stdlib.h> |
39 | #include <time.h> | 39 | #include <time.h> |
40 | #endif | 40 | #endif |
41 | 41 | ||
@@ -60,13 +60,12 @@ | |||
60 | #include <qtopia/quuid.h> | 60 | #include <qtopia/quuid.h> |
61 | #include <qtopia/version.h> | 61 | #include <qtopia/version.h> |
62 | #ifdef Q_WS_QWS | 62 | #ifdef Q_WS_QWS |
63 | #include <qtopia/qcopenvelope_qws.h> | 63 | #include <qtopia/qcopenvelope_qws.h> |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | #include "launcherglobal.h" | ||
67 | 66 | ||
68 | #include "transferserver.h" | 67 | #include "transferserver.h" |
69 | #include <qtopia/qprocess.h> | 68 | #include <qtopia/qprocess.h> |
70 | 69 | ||
71 | const int block_size = 51200; | 70 | const int block_size = 51200; |
72 | 71 | ||
@@ -111,13 +110,13 @@ QString SyncAuthentication::serverId() | |||
111 | { | 110 | { |
112 | Config cfg("Security"); | 111 | Config cfg("Security"); |
113 | cfg.setGroup("Sync"); | 112 | cfg.setGroup("Sync"); |
114 | QString r = cfg.readEntry("serverid"); | 113 | QString r = cfg.readEntry("serverid"); |
115 | 114 | ||
116 | if ( r.isEmpty() ) { | 115 | if ( r.isEmpty() ) { |
117 | r = Opie::Global::uuid(); | 116 | r = OGlobal::generateUuid(); |
118 | cfg.writeEntry("serverid", r ); | 117 | cfg.writeEntry("serverid", r ); |
119 | } | 118 | } |
120 | return r; | 119 | return r; |
121 | } | 120 | } |
122 | 121 | ||
123 | QString SyncAuthentication::ownerName() | 122 | QString SyncAuthentication::ownerName() |
@@ -190,24 +189,24 @@ bool SyncAuthentication::checkPassword( const QString& password ) | |||
190 | return TRUE; | 189 | return TRUE; |
191 | #endif | 190 | #endif |
192 | 191 | ||
193 | static int lastdenial=0; | 192 | static int lastdenial=0; |
194 | static int denials=0; | 193 | static int denials=0; |
195 | int now = time(0); | 194 | int now = time(0); |
196 | 195 | ||
197 | Config cfg("Security"); | 196 | Config cfg("Security"); |
198 | cfg.setGroup("Sync"); | 197 | cfg.setGroup("Sync"); |
199 | QString syncapp = cfg.readEntry("syncapp","Qtopia"); | 198 | QString syncapp = cfg.readEntry("syncapp","Qtopia"); |
200 | 199 | ||
201 | //No password needed if the user really wants it | 200 | //No password needed if the user really wants it |
202 | if (syncapp == "IntelliSync") { | 201 | if (syncapp == "IntelliSync") { |
203 | return TRUE; | 202 | return TRUE; |
204 | } | 203 | } |
205 | 204 | ||
206 | // Detect old Qtopia Desktop (no password) | 205 | // Detect old Qtopia Desktop (no password) |
207 | if ( password.isEmpty() ) { | 206 | if ( password.isEmpty() ) { |
208 | if ( denials < 3 || now > lastdenial+600 ) { | 207 | if ( denials < 3 || now > lastdenial+600 ) { |
209 | QMessageBox unauth( | 208 | QMessageBox unauth( |
210 | tr("Sync Connection"), | 209 | tr("Sync Connection"), |
211 | tr("<p>An unauthorized system is requesting access to this device." | 210 | tr("<p>An unauthorized system is requesting access to this device." |
212 | "<p>If you are using a version of Qtopia Desktop older than 1.5.1, " | 211 | "<p>If you are using a version of Qtopia Desktop older than 1.5.1, " |
213 | "please upgrade or change the security setting to use IntelliSync." ), | 212 | "please upgrade or change the security setting to use IntelliSync." ), |
@@ -216,23 +215,23 @@ bool SyncAuthentication::checkPassword( const QString& password ) | |||
216 | 0, QString::null, TRUE, WStyle_StaysOnTop); | 215 | 0, QString::null, TRUE, WStyle_StaysOnTop); |
217 | unauth.setButtonText(QMessageBox::Cancel, tr("Deny")); | 216 | unauth.setButtonText(QMessageBox::Cancel, tr("Deny")); |
218 | unauth.exec(); | 217 | unauth.exec(); |
219 | 218 | ||
220 | denials++; | 219 | denials++; |
221 | lastdenial=now; | 220 | lastdenial=now; |
222 | } | 221 | } |
223 | return FALSE; | 222 | return FALSE; |
224 | 223 | ||
225 | } | 224 | } |
226 | 225 | ||
227 | // Second, check sync password... | 226 | // Second, check sync password... |
228 | 227 | ||
229 | static int lock=0; | 228 | static int lock=0; |
230 | if ( lock ) return FALSE; | 229 | if ( lock ) return FALSE; |
231 | 230 | ||
232 | ++lock; | 231 | ++lock; |
233 | 232 | ||
234 | /* | 233 | /* |
235 | * we need to support old Sync software and QtopiaDesktop | 234 | * we need to support old Sync software and QtopiaDesktop |
236 | */ | 235 | */ |
237 | if ( password.left(6) == "Qtopia" || password.left(6) == "rootme" ) { | 236 | if ( password.left(6) == "Qtopia" || password.left(6) == "rootme" ) { |
238 | Config cfg( "Security" ); | 237 | Config cfg( "Security" ); |