~ubuntu-branches/ubuntu/feisty/firefox/feisty-updates

« back to all changes in this revision

Viewing changes to toolkit/xre/nsAppRunner.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2007-10-19 01:09:21 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20071019010921-8sglgxbi6kj1pemg
Tags: 2.0.0.8+1nobinonly-0ubuntu1
* New security/stability upstream release (v2.0.0.8)
* MFSA 2007-29 aka CVE-2007-5339 (browser), CVE-2007-5340 (javascript)
* MFSA 2007-30 aka CVE-2007-1095
* MFSA 2007-31 aka CVE-2007-2292
* MFSA 2007-32 aka CVE-2007-3511, CVE-2006-2894
* MFSA 2007-33 aka CVE-2007-5334
* MFSA 2007-34 aka CVE-2007-5337
* MFSA 2007-35 aka CVE-2007-5338
* MFSA 2007-36 aka CVE-2007-4841 (windows only)

Show diffs side-by-side

added added

removed removed

Lines of Context:
306
306
  return PR_TRUE;
307
307
}
308
308
 
 
309
enum RemoteResult {
 
310
  REMOTE_NOT_FOUND  = 0,
 
311
  REMOTE_FOUND      = 1,
 
312
  REMOTE_ARG_BAD    = 2
 
313
};
 
314
 
309
315
enum ArgResult {
310
316
  ARG_NONE  = 0,
311
317
  ARG_FOUND = 1,
1175
1181
  return 0;
1176
1182
}
1177
1183
 
1178
 
static PRBool
 
1184
static RemoteResult
1179
1185
RemoteCommandLine()
1180
1186
{
1181
1187
  nsresult rv;
1189
1195
  ar = CheckArg("a", PR_TRUE, &temp);
1190
1196
  if (ar == ARG_BAD) {
1191
1197
    PR_fprintf(PR_STDERR, "Error: argument -a requires an application name\n");
1192
 
    return PR_FALSE;
 
1198
    return REMOTE_ARG_BAD;
1193
1199
  } else if (ar == ARG_FOUND) {
1194
1200
    program.Assign(temp);
1195
1201
  }
1197
1203
  ar = CheckArg("u", PR_TRUE, &username);
1198
1204
  if (ar == ARG_BAD) {
1199
1205
    PR_fprintf(PR_STDERR, "Error: argument -u requires a username\n");
1200
 
    return PR_FALSE;
 
1206
    return REMOTE_ARG_BAD;
1201
1207
  }
1202
1208
 
1203
1209
  XRemoteClient client;
1204
1210
  rv = client.Init();
1205
1211
  if (NS_FAILED(rv))
1206
 
    return PR_FALSE;
 
1212
    return REMOTE_NOT_FOUND;
1207
1213
 
1208
1214
  nsXPIDLCString response;
1209
1215
  PRBool success = PR_FALSE;
1212
1218
                              getter_Copies(response), &success);
1213
1219
  // did the command fail?
1214
1220
  if (NS_FAILED(rv) || !success)
1215
 
    return PR_FALSE;
 
1221
    return REMOTE_NOT_FOUND;
1216
1222
 
1217
 
  return PR_TRUE;
 
1223
  return REMOTE_FOUND;
1218
1224
}
1219
1225
#endif // MOZ_ENABLE_XREMOTE
1220
1226
 
2287
2293
  // in nsAppShell::Create, but we need to get in before gtk
2288
2294
  // has been initialized to make sure everything is running
2289
2295
  // consistently.
 
2296
#if defined(MOZ_WIDGET_GTK2)
 
2297
  g_thread_init(NULL);
 
2298
#endif
2290
2299
  if (CheckArg("install"))
2291
2300
    gdk_rgb_set_install(TRUE);
2292
2301
 
2376
2385
 
2377
2386
  if (!PR_GetEnv("MOZ_NO_REMOTE")) {
2378
2387
    // Try to remote the entire command line. If this fails, start up normally.
2379
 
    if (RemoteCommandLine())
 
2388
    RemoteResult rr = RemoteCommandLine();
 
2389
    if (rr == REMOTE_FOUND)
2380
2390
      return 0;
 
2391
    else if (rr == REMOTE_ARG_BAD)
 
2392
      return 1;
2381
2393
  }
2382
2394
#endif
2383
2395