[Libreoffice-commits] core.git: Branch 'feature/mar-updater' - 362 commits - accessibility/inc accessibility/Library_acc.mk accessibility/source android/source animations/Library_animcore.mk avmedia/Library_avmediagst_0_10.mk avmedia/Library_avmediagst.mk avmedia/Library_avmediaMacAVF.mk avmedia/Library_avmedia.mk avmedia/Library_avmediaogl.mk avmedia/Library_avmediaQuickTime.mk avmedia/Library_avmediavlc.mk avmedia/Library_avmediawin.mk avmedia/source basctl/CppunitTest_basctl_dialogs_test.mk basctl/inc basctl/Library_basctl.mk basctl/source basegfx/CppunitTest_basegfx.mk basegfx/Library_basegfx.mk basegfx/source basic/CppunitTest_basic_macros.mk basic/CppunitTest_basic_scanner.mk basic/Library_sb.mk basic/source bean/com bean/Library_officebean.mk binaryurp/CppunitTest_binaryurp_test-cache.mk binaryurp/CppunitTest_binaryurp_test-unmarshal.mk binaryurp/Library_binaryurp.mk bin/oss-fuzz-build.sh bin/update bridges/Library_java_uno.mk canvas/Library_cairocanvas.mk canvas/Library_canvasfactory.mk c anvas/Library_canvastools.mk canvas/Library_directx9canvas.mk canvas/Library_gdipluscanvas.mk canvas/Library_oglcanvas.mk canvas/Library_simplecanvas.mk canvas/Library_vclcanvas.mk chart2/CppunitTest_chart2_common_functors.mk chart2/CppunitTest_chart2_dialogs_test.mk chart2/CppunitTest_chart2_dump.mk chart2/CppunitTest_chart2_export.mk chart2/CppunitTest_chart2_import.mk chart2/CppunitTest_chart2_pivot_chart_test.mk chart2/CppunitTest_chart2_trendcalculators.mk chart2/CppunitTest_chart2_xshape.mk chart2/inc chart2/Library_chartcontroller.mk chart2/Library_chartcore.mk chart2/Library_chartopengl.mk chart2/qa chart2/source cli_ure/Executable_climaker.mk comphelper/CppunitTest_comphelper_ifcontainer.mk comphelper/CppunitTest_comphelper_syntaxhighlight_test.mk comphelper/CppunitTest_comphelper_test.mk comphelper/CppunitTest_comphelper_threadpool_test.mk comphelper/CppunitTest_comphelper_variadictemplates_test.mk comphelper/Library_comphelper.mk comphelper/qa comphelper/source compilerpl ugins/clang config_host/config_features.h.in config_host.mk.in configmgr/CppunitTest_configmgr_unit.mk configmgr/Library_configmgr.mk configure.ac connectivity/com connectivity/CppunitTest_connectivity_ado.mk connectivity/CppunitTest_connectivity_commontools.mk connectivity/CppunitTest_connectivity_mork.mk connectivity/Library_ado.mk connectivity/Library_calc.mk connectivity/Library_dbase.mk connectivity/Library_dbpool2.mk connectivity/Library_dbtools.mk connectivity/Library_evoab.mk connectivity/Library_file.mk connectivity/Library_firebird_sdbc.mk connectivity/Library_flat.mk connectivity/Library_hsqldb.mk connectivity/Library_jdbc.mk connectivity/Library_mork.mk connectivity/Library_mozbootstrap.mk connectivity/Library_mysql.mk connectivity/Library_odbc.mk connectivity/Library_postgresql-sdbc-impl.mk connectivity/Library_postgresql-sdbc.mk connectivity/Library_sdbc2.mk connectivity/source cppcanvas/CppunitTest_cppcanvas_test.mk cppcanvas/inc cppcanvas/Library_cppcanvas.mk cppcanv as/Library_mtfrenderer.mk cppcanvas/source cppu/CppunitTest_cppu_any-external.mk cppu/CppunitTest_cppu_qa_any.mk cppu/CppunitTest_cppu_qa_recursion.mk cppu/CppunitTest_cppu_qa_reference.mk cppu/CppunitTest_cppu_qa_unotype.mk cppu/CppunitTest_cppu_test_cppumaker.mk cppuhelper/CppunitTest_cppuhelper_cppu_ifcontainer.mk cppuhelper/CppunitTest_cppuhelper_cppu_unourl.mk cppuhelper/CppunitTest_cppuhelper_qa_weak.mk cppuhelper/Library_cppuhelper.mk cppu/Library_affine_uno_uno.mk cppu/Library_cppu.mk cppu/Library_log_uno_uno.mk cppu/Library_purpenvhelper.mk cppu/Library_unsafe_uno_uno.mk cppu/source cpputools/Executable_uno.mk cui/CppunitTest_cui_dialogs_test_2.mk cui/CppunitTest_cui_dialogs_test_3.mk cui/CppunitTest_cui_dialogs_test_4.mk cui/CppunitTest_cui_dialogs_test.mk cui/inc cui/Library_cui.mk cui/source dbaccess/CppunitTest_dbaccess_dialog_save.mk dbaccess/CppunitTest_dbaccess_dialogs_test.mk dbaccess/CppunitTest_dbaccess_embeddeddb_performancetest.mk dbaccess/CppunitTest_dbaccess_e mpty_stdlib_save.mk dbaccess/CppunitTest_dbaccess_firebird_test.mk dbaccess/CppunitTest_dbaccess_hsqldb_test.mk dbaccess/CppunitTest_dbaccess_macros_test.mk dbaccess/CppunitTest_dbaccess_nolib_save.mk dbaccess/CppunitTest_dbaccess_RowSetClones.mk dbaccess/Executable_odbcconfig.mk dbaccess/inc dbaccess/Library_dba.mk dbaccess/Library_dbaxml.mk dbaccess/Library_dbmm.mk dbaccess/Library_dbu.mk dbaccess/Library_sdbt.mk dbaccess/source dbaccess/uiconfig dbaccess/UIConfig_dbaccess.mk desktop/CppunitTest_desktop_app.mk desktop/CppunitTest_desktop_dialogs_test.mk desktop/CppunitTest_desktop_lib.mk desktop/Executable_quickstart.mk desktop/Executable_sbase.mk desktop/Executable_scalc.mk desktop/Executable_sdraw.mk desktop/Executable_simpress.mk desktop/Executable_smath.mk desktop/Executable_soffice_bin.mk desktop/Executable_soffice.mk desktop/Executable_sweb.mk desktop/Executable_swriter.mk desktop/Executable_unopkg_bin.mk desktop/inc desktop/Library_crashreport.mk desktop/Library_deploymentg ui.mk desktop/Library_deploymentmisc.mk desktop/Library_deployment.mk desktop/Library_migrationoo2.mk desktop/Library_migrationoo3.mk desktop/Library_offacc.mk desktop/Library_sofficeapp.mk desktop/Library_spl.mk desktop/Library_unopkgapp.mk desktop/source download.lst drawinglayer/CppunitTest_drawinglayer_border.mk drawinglayer/Library_drawinglayer.mk dtrans/Library_dnd.mk dtrans/Library_dtrans.mk dtrans/Library_ftransl.mk dtrans/Library_mcnttype.mk dtrans/Library_sysdtrans.mk dtrans/source editeng/CppunitTest_editeng_borderline.mk editeng/CppunitTest_editeng_core.mk editeng/CppunitTest_editeng_lookuptree.mk editeng/inc editeng/Library_editeng.mk editeng/source embeddedobj/Library_embobj.mk embeddedobj/Library_emboleobj.mk embeddedobj/source embedserv/Library_emser.mk embedserv/Library_inprocserv.mk embedserv/source eventattacher/Library_evtatt.mk extensions/CppunitTest_extensions_test_update.mk extensions/Library_abp.mk extensions/Library_bib.mk extensions/Library_dbp.mk extension s/Library_log.mk extensions/Library_pcr.mk extensions/Library_res.mk extensions/Library_scn.mk extensions/source extensions/test external/coinmp external/epoxy external/icu external/nss external/poppler external/redland extras/source filter/CppunitTest_filter_dialogs_test.mk filter/CppunitTest_filter_dxf_test.mk filter/CppunitTest_filter_eps_test.mk filter/CppunitTest_filter_met_test.mk filter/CppunitTest_filter_msfilter.mk filter/CppunitTest_filter_pcd_test.mk filter/CppunitTest_filter_pcx_test.mk filter/CppunitTest_filter_pict_test.mk filter/CppunitTest_filter_ppm_test.mk filter/CppunitTest_filter_priority.mk filter/CppunitTest_filter_psd_test.mk filter/CppunitTest_filter_ras_test.mk filter/CppunitTest_filter_tga_test.mk filter/CppunitTest_filter_tiff_test.mk filter/CppunitTest_filter_xslt.mk filter/Executable_svg2odf.mk filter/Library_filterconfig.mk filter/Library_flash.mk filter/Library_gie.mk filter/Library_graphicfilter.mk filter/Library_icg.mk filter/Library_msfilter.mk filt er/Library_odfflatxml.mk filter/Library_pdffilter.mk filter/Library_storagefd.mk filter/Library_svgfilter.mk filter/Library_t602filter.mk filter/Library_textfd.mk filter/Library_xmlfa.mk filter/Library_xmlfd.mk filter/Library_xsltdlg.mk filter/Library_xsltfilter.mk filter/source forms/Library_frm.mk forms/source formula/CppunitTest_formula_dialogs_test.mk formula/Library_for.mk formula/Library_forui.mk formula/source fpicker/CppunitTest_fpicker_dialogs_test.mk fpicker/Library_fps.mk fpicker/Library_fps_office.mk fpicker/source framework/CppunitTest_framework_dispatch.mk framework/inc framework/Library_fwe.mk framework/Library_fwi.mk framework/Library_fwk.mk framework/Library_fwl.mk framework/Library_fwm.mk framework/qa framework/source helpcontent2 hwpfilter/CppunitTest_hwpfilter_test_hwpfilter.mk hwpfilter/Library_hwp.mk hwpfilter/source i18nlangtag/CppunitTest_i18nlangtag_test_languagetag.mk i18nlangtag/Library_i18nlangtag.mk i18npool/CppunitTest_i18npool_test_breakiterator.mk i18 npool/CppunitTest_i18npool_test_characterclassification.mk i18npool/CppunitTest_i18npool_test_ordinalsuffix.mk i18npool/CppunitTest_i18npool_test_textsearch.mk i18npool/Executable_gencoll_rule.mk i18npool/Executable_genconv_dict.mk i18npool/Executable_gendict.mk i18npool/Executable_genindex_data.mk i18npool/Executable_saxparser.mk i18npool/inc i18npool/Library_collator_data.mk i18npool/Library_dict_ja.mk i18npool/Library_dict_zh.mk i18npool/Library_i18npool.mk i18npool/Library_i18nsearch.mk i18npool/Library_index_data.mk i18npool/Library_localedata_en.mk i18npool/Library_localedata_es.mk i18npool/Library_localedata_euro.mk i18npool/Library_localedata_others.mk i18npool/Library_textconv_dict.mk i18npool/source i18nutil/Library_i18nutil.mk i18nutil/source icon-themes/breeze icon-themes/breeze_dark icon-themes/breeze_svg idl/Executable_svidl.mk include/comphelper include/editeng include/LibreOfficeKit include/onlineupdate include/sal include/sfx2 include/svl include/svtools include/svx include/systools include/tools include/unotools include/vcl io/Library_io.mk javaunohelper/Library_juh.mk javaunohelper/Library_juhx.mk jurt/Library_jpipe.mk jurt/Library_jpipx.mk jvmaccess/Library_jvmaccess.mk jvmfwk/Executable_javaldx.mk jvmfwk/Library_jvmfwk.mk jvmfwk/plugins l10ntools/source Library_merged.mk libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk lingucomponent/Library_guesslang.mk lingucomponent/Library_hyphen.mk lingucomponent/Library_lnth.mk lingucomponent/Library_spell.mk linguistic/Library_lng.mk lotuswordpro/CppunitTest_lotuswordpro_test_lotuswordpro.mk lotuswordpro/Library_lwpft.mk lotuswordpro/source Makefile.gbuild Makefile.in o3tl/CppunitTest_o3tl_tests.mk odk/CppunitTest_odk_checkapi.mk odk/CustomTarget_doxygen.mk odk/examples odk/Package_odk_headers.mk offapi/com officecfg/CppunitTest_officecfg_cppheader_test.mk officecfg/files.mk officecfg/registry onlineupdate/astyle.options onlineupdate/Executable_mar.mk onlineupdate/Executable_updater.mk on lineupdate/Executable_update_service.mk onlineupdate/inc onlineupdate/Module_onlineupdate.mk onlineupdate/README onlineupdate/source onlineupdate/StaticLibrary_libmar.mk onlineupdate/StaticLibrary_updatehelper.mk onlineupdate/StaticLibrary_winhelper.mk onlineupdate/WinResTarget_updater.mk oox/CppunitTest_oox_tokenmap.mk oox/CppunitTest_oox_vba_compression.mk oox/CppunitTest_oox_vba_encryption.mk oox/Library_oox.mk oox/source package/CppunitTest_package2_test.mk package/Library_package2.mk package/Library_xstor.mk package/source postprocess/CppunitTest_services.mk postprocess/CustomTarget_registry.mk registry/Library_reg.mk remotebridges/Library_uuresolver.mk reportdesign/CppunitTest_reportdesign_dialogs_test.mk reportdesign/inc reportdesign/Library_rpt.mk reportdesign/Library_rptui.mk reportdesign/Library_rptxml.mk reportdesign/source reportdesign/uiconfig reportdesign/UIConfig_dbreport.mk RepositoryExternal.mk Repository.mk rsc/Executable_rsc.mk rsc/inc rsc/source sal/CppunitTest_M odule_DLL.mk sal/CppunitTest_sal_osl.mk sal/CppunitTest_sal_osl_security.mk sal/CppunitTest_sal_rtl.mk sal/CppunitTest_sal_types.mk sal/Executable_cppunittester.mk sal/Executable_osl_process_child.mk salhelper/CppunitTest_salhelper_testapi.mk salhelper/Library_salhelper.mk sal/Library_sal.mk sal/Library_sal_textenc.mk sal/Library_uwinapi.mk sal/Module_sal.mk sal/osl sal/systools sax/CppunitTest_sax_attributes.mk sax/CppunitTest_sax.mk sax/CppunitTest_sax_parser.mk sax/CppunitTest_sax_xmlimport.mk sax/Library_expwrap.mk sax/Library_sax.mk scaddins/Library_analysis.mk scaddins/Library_date.mk scaddins/Library_pricing.mk scaddins/source sccomp/CppunitTest_sccomp_lpsolver.mk sccomp/Library_solver.mk sc/CppunitTest_sc_addin_functions_test.mk sc/CppunitTest_sc_anchor_test.mk sc/CppunitTest_sc_annotationobj.mk sc/CppunitTest_sc_annotationshapeobj.mk sc/CppunitTest_sc_annotationsobj.mk sc/CppunitTest_sc_array_functions_test.mk sc/CppunitTest_sc_bugfix_test.mk sc/CppunitTest_sc_cellrangeobj. mk sc/CppunitTest_sc_chart_regression_test.mk sc/CppunitTest_sc_check_data_pilot_field.mk sc/CppunitTest_sc_check_data_pilot_table.mk sc/CppunitTest_sc_check_xcell_ranges_query.mk sc/CppunitTest_sc_condformats.mk sc/CppunitTest_sc_copypaste.mk sc/CppunitTest_sc_database_functions_test.mk sc/CppunitTest_sc_databaserangeobj.mk sc/CppunitTest_sc_datapilotfieldobj.mk sc/CppunitTest_sc_datapilottableobj.mk sc/CppunitTest_sc_datetime_functions_test.mk sc/CppunitTest_sc_editfieldobj_cell.mk sc/CppunitTest_sc_editfieldobj_header.mk sc/CppunitTest_sc_filters_test.mk sc/CppunitTest_sc_financial_functions_test.mk sc/CppunitTest_sc_functions_test_old.mk sc/CppunitTest_sc_html_export_test.mk sc/CppunitTest_sc_information_functions_test.mk sc/CppunitTest_sc_logical_functions_test.mk sc/CppunitTest_sc_macros_test.mk sc/CppunitTest_sc_mark_test.mk sc/CppunitTest_sc_mathematical_functions_test.mk sc/CppunitTest_sc_modelobj.mk sc/CppunitTest_sc_namedrangeobj.mk sc/CppunitTest_sc_namedrangesobj.mk sc/ CppunitTest_sc_new_cond_format_api.mk sc/CppunitTest_sc_opencl_test.mk sc/CppunitTest_sc_outlineobj.mk sc/CppunitTest_sc_perfobj.mk sc/CppunitTest_sc_rangelst_test.mk sc/CppunitTest_sc_range_test.mk sc/CppunitTest_sc_recordchanges.mk sc/CppunitTest_sc_screenshots.mk sc/CppunitTest_sc_spreadsheet_functions_test.mk sc/CppunitTest_sc_statistical_functions_test.mk sc/CppunitTest_sc_styleloaderobj.mk sc/CppunitTest_sc_subsequent_export_test.mk sc/CppunitTest_sc_subsequent_filters_test.mk sc/CppunitTest_sc_tablesheetobj.mk sc/CppunitTest_sc_tablesheetsobj.mk sc/CppunitTest_sc_text_functions_test.mk sc/CppunitTest_sc_tiledrendering.mk sc/CppunitTest_sc_ucalc.mk sc/CppunitTest_sc_viewpaneobj.mk sc/inc sc/Library_scd.mk sc/Library_scfilt.mk sc/Library_sc.mk sc/Library_scqahelper.mk sc/Library_scui.mk sc/Library_vbaobj.mk scp2/source sc/qa scripting/Library_basprov.mk scripting/Library_dlgprov.mk scripting/Library_protocolhandler.mk scripting/Library_scriptframe.mk scripting/Library_stringres ource.mk scripting/Library_vbaevents.mk scripting/source sc/sdi sc/source sc/uiconfig sd/CppunitTest_sd_dialogs_test.mk sd/CppunitTest_sd_export_ooxml1.mk sd/CppunitTest_sd_export_ooxml2.mk sd/CppunitTest_sd_export_tests.mk sd/CppunitTest_sd_filters_test.mk sd/CppunitTest_sd_html_export_tests.mk sd/CppunitTest_sd_import_tests.mk sd/CppunitTest_sd_misc_tests.mk sd/CppunitTest_sd_svg_export_tests.mk sd/CppunitTest_sd_tiledrendering.mk sd/CppunitTest_sd_uimpress.mk sdext/CppunitTest_sdext_pdfimport.mk sdext/Executable_xpdfimport.mk sdext/source sd/inc sd/Library_sdd.mk sd/Library_sdfilt.mk sd/Library_sd.mk sd/Library_sdui.mk sd/source sd/uiconfig setup_native/Library_instooofiltmsi.mk setup_native/Library_qslnkmsi.mk setup_native/Library_reg4allmsdoc.mk setup_native/Library_regactivex.mk setup_native/Library_sdqsmsi.mk setup_native/Library_sellangmsi.mk setup_native/Library_shlxtmsi.mk setup_native/Library_sn_tools.mk sfx2/CppunitTest_sfx2_classification.mk sfx2/CppunitTest_sfx2_contro lleritem.mk sfx2/CppunitTest_sfx2_dialogs_test.mk sfx2/CppunitTest_sfx2_metadatable.mk sfx2/doc sfx2/inc sfx2/Library_qstart_gtk.mk sfx2/Library_sfx.mk sfx2/source shell/Executable_lngconvex.mk shell/Library_cmdmail.mk shell/Library_desktopbe.mk shell/Library_localebe.mk shell/Library_recentfile.mk shell/Library_syssh.mk shell/Library_wininetbe.mk slideshow/CppunitTest_slideshow.mk slideshow/Executable_demoshow.mk slideshow/inc slideshow/Library_OGLTrans.mk slideshow/Library_slideshow.mk smoketest/Executable_libtest.mk solenv/gbuild sot/CppunitTest_sot_test_sot.mk sot/Library_sot.mk sot/source starmath/CppunitTest_starmath_dialogs_test.mk starmath/CppunitTest_starmath_export.mk starmath/CppunitTest_starmath_import.mk starmath/CppunitTest_starmath_qa_cppunit.mk starmath/inc starmath/Library_smd.mk starmath/Library_sm.mk starmath/qa starmath/source starmath/uiconfig starmath/UIConfig_smath.mk stoc/Library_bootstrap.mk stoc/Library_introspection.mk stoc/Library_invocadapt.mk stoc/Libra ry_invocation.mk stoc/Library_javaloader.mk stoc/Library_javavm.mk stoc/Library_namingservice.mk stoc/Library_proxyfac.mk stoc/Library_reflection.mk stoc/Library_stocservices.mk store/Library_store.mk svgio/CppunitTest_svgio.mk svl/CppunitTest_svl_lngmisc.mk svl/CppunitTest_svl_urihelper.mk svl/Library_fsstorage.mk svl/Library_passwordcontainer.mk svl/Library_svl.mk svl/source svtools/CppunitTest_svtools_dialogs_test.mk svtools/CppunitTest_svtools_graphic.mk svtools/CppunitTest_svtools_html.mk svtools/Executable_langsupport.mk svtools/inc svtools/Library_svt.mk svtools/source svx/AllLangResTarget_svx.mk svx/CppunitTest_svx_dialogs_test.mk svx/Executable_gengal.mk svx/inc svx/Library_svxcore.mk svx/Library_svx.mk svx/Library_textconversiondlgs.mk svx/source svx/uiconfig svx/UIConfig_svx.mk sw/CppunitTest_sw_dialogs_test_2.mk sw/CppunitTest_sw_dialogs_test.mk sw/CppunitTest_sw_docbookexport.mk sw/CppunitTest_sw_filters_test.mk sw/CppunitTest_sw_globalfilter.mk sw/CppunitTest_sw_htmlex port.mk sw/CppunitTest_sw_htmlimport.mk sw/CppunitTest_sw_layout_test.mk sw/CppunitTest_sw_macros_test.mk sw/CppunitTest_sw_odfexport.mk sw/CppunitTest_sw_odfimport.mk sw/CppunitTest_sw_ooxmlexport8.mk sw/CppunitTest_sw_ooxmlimport.mk sw/CppunitTest_sw_rtfexport.mk sw/CppunitTest_sw_rtfimport.mk sw/CppunitTest_sw_tiledrendering.mk sw/CppunitTest_sw_uiwriter.mk sw/CppunitTest_sw_uwriter.mk sw/CppunitTest_sw_ww8export2.mk sw/CppunitTest_sw_ww8export.mk sw/CppunitTest_sw_ww8import.mk sw/inc sw/Library_msword.mk sw/Library_swd.mk sw/Library_sw.mk sw/Library_swui.mk sw/Library_vbaswobj.mk sw/ooxmlexport_setup.mk sw/qa sw/source sw/uiconfig sw/UIConfig_swriter.mk test/Library_subsequenttest.mk test/Library_test.mk test/Library_test_setupvcl.mk test/Library_vclbootstrapprotector.mk toolkit/Library_tk.mk toolkit/source tools/CppunitTest_tools_test.mk tools/Executable_bestreversemap.mk tools/Library_tl.mk tools/source ucbhelper/Library_ucbhelper.mk ucbhelper/source ucb/Library_cached1.mk ucb /Library_srtrs1.mk ucb/Library_ucb1.mk ucb/Library_ucpcmis1.mk ucb/Library_ucpdav1.mk ucb/Library_ucpexpand1.mk ucb/Library_ucpext.mk ucb/Library_ucpfile1.mk ucb/Library_ucpftp1.mk ucb/Library_ucphier1.mk ucb/Library_ucpimage.mk ucb/Library_ucppkg1.mk ucb/Library_ucptdoc1.mk ucb/source UnoControls/Library_ctl.mk unotest/Library_unobootstrapprotector.mk unotest/Library_unoexceptionprotector.mk unotest/Library_unotest.mk unotools/CppunitTest_unotools_fontdefs.mk unotools/Library_utl.mk unotools/source unoxml/Library_unordf.mk unoxml/Library_unoxml.mk uui/CppunitTest_uui_dialogs_test.mk uui/Library_uui.mk uui/source vbahelper/inc vbahelper/Library_msforms.mk vbahelper/Library_vbahelper.mk vcl/CppunitTest_vcl_bitmapprocessor_test.mk vcl/CppunitTest_vcl_bitmap_test.mk vcl/CppunitTest_vcl_blocklistparser_test.mk vcl/CppunitTest_vcl_complextext.mk vcl/CppunitTest_vcl_dialogs_test.mk vcl/CppunitTest_vcl_filters_test.mk vcl/CppunitTest_vcl_fontcharmap.mk vcl/CppunitTest_vcl_fontmetric.mk vcl /CppunitTest_vcl_font.mk vcl/CppunitTest_vcl_jpeg_read_write_test.mk vcl/CppunitTest_vcl_lifecycle.mk vcl/CppunitTest_vcl_mapmode.mk vcl/CppunitTest_vcl_outdev.mk vcl/CppunitTest_vcl_pdfexport.mk vcl/CppunitTest_vcl_svm_test.mk vcl/CppunitTest_vcl_timer.mk vcl/CppunitTest_vcl_wmf_test.mk vcl/inc vcl/Library_vcl.mk vcl/opengl vcl/quartz vcl/source vcl/unx vcl/win vcl/workben winaccessibility/Library_winaccessibility.mk writerfilter/CppunitTest_writerfilter_misc.mk writerfilter/CppunitTest_writerfilter_rtftok.mk writerfilter/Library_writerfilter.mk writerfilter/source writerperfect/CppunitTest_writerperfect_calc.mk writerperfect/CppunitTest_writerperfect_draw.mk writerperfect/CppunitTest_writerperfect_import.mk writerperfect/CppunitTest_writerperfect_impress.mk writerperfect/CppunitTest_writerperfect_wpftimport.mk writerperfect/CppunitTest_writerperfect_writer.mk writerperfect/Library_wpftcalc.mk writerperfect/Library_wpftdraw.mk writerperfect/Library_wpftimpress.mk writerperfect/Libr ary_wpftwriter.mk writerperfect/Library_writerperfect.mk xmloff/CppunitTest_xmloff_uxmloff.mk xmloff/Library_xof.mk xmloff/Library_xo.mk xmloff/source xmlreader/Library_xmlreader.mk xmlscript/Library_xmlscript.mk xmlscript/test xmlsecurity/CppunitTest_qa_certext.mk xmlsecurity/CppunitTest_xmlsecurity_dialogs_test.mk xmlsecurity/CppunitTest_xmlsecurity_pdfsigning.mk xmlsecurity/CppunitTest_xmlsecurity_signing.mk xmlsecurity/inc xmlsecurity/Library_xmlsecurity.mk xmlsecurity/Library_xsec_fw.mk xmlsecurity/Library_xsec_gpg.mk xmlsecurity/Library_xsec_xmlsec.mk xmlsecurity/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Mon Apr 24 17:53:15 UTC 2017
Rebased ref, commits from common ancestor:
commit e265d0065473bae50d8b62a1b42790946961e628
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 24 19:51:40 2017 +0200
if the update_dir does not exist continue with the update check
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 1148490e7b7c..6e6026cd33cc 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1477,17 +1477,13 @@ int Desktop::Main()
{
osl::DirectoryItem aPatchInfo;
osl::DirectoryItem::get(Updater::getUpdateInfoURL(), aPatchInfo);
+ osl::DirectoryItem aDirectoryItem;
+ osl::DirectoryItem::get(Updater::getUpdateDirURL(), aDirectoryItem);
- if (aPatchInfo.is())
+ if (aPatchInfo.is() && aDirectoryItem.is())
{
- osl::DirectoryItem aDirectoryItem;
- osl::DirectoryItem::get(Updater::getUpdateDirURL(), aDirectoryItem);
- bool bValidUpdateDirExists = aDirectoryItem.is();
- if (bValidUpdateDirExists)
- {
- SAL_DEBUG("update");
- update();
- }
+ SAL_DEBUG("update");
+ update();
}
else if (isTimeForUpdateCheck())
{
commit 3d6098c5f18925884a6b77ce39d001163a3e7398
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 24 18:54:59 2017 +0200
better reporting for normal response from updater
Change-Id: I26cbd69c46afadc21eeab73cbccddc6873c43655
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index c38f916c7189..e1b29d1402ec 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -194,6 +194,7 @@ struct update_info
{
OUString aFromBuildID;
OUString aSeeAlsoURL;
+ OUString aMessage;
update_file aUpdateFile;
std::vector<language_file> aLanguageFiles;
@@ -356,6 +357,13 @@ update_info parse_response(const std::string& rResponse)
{
throw invalid_update_info();
}
+ else if (std::find(aRootKeys.begin(), aRootKeys.end(), "response") != aRootKeys.end())
+ {
+ update_info aUpdateInfo;
+ auto aMsgNode = aDocumentRoot.child("response");
+ aUpdateInfo.aMessage = toOUString(aMsgNode.string_value().str());
+ return aUpdateInfo;
+ }
orcus::json::detail::node aFromNode = aDocumentRoot.child("from");
if (aFromNode.type() != orcus::json_node_t::string)
@@ -546,8 +554,17 @@ void update_checker()
if (!response_body.empty())
{
update_info aUpdateInfo = parse_response(response_body);
- download_file(aUpdateInfo.aUpdateFile.aURL, aUpdateInfo.aUpdateFile.nSize, aUpdateInfo.aUpdateFile.aHash, "update.mar");
- CreateValidUpdateDir(aUpdateInfo);
+ if (aUpdateInfo.aUpdateFile.aURL.isEmpty())
+ {
+ // No update currently available
+ // add entry to updating.log with the message
+ SAL_WARN("desktop.updater", "Message received from the updater: " << aUpdateInfo.aMessage);
+ }
+ else
+ {
+ download_file(aUpdateInfo.aUpdateFile.aURL, aUpdateInfo.aUpdateFile.nSize, aUpdateInfo.aUpdateFile.aHash, "update.mar");
+ CreateValidUpdateDir(aUpdateInfo);
+ }
}
}
catch (const invalid_update_info&)
commit 19fbb82400863ca8b078c99ad6a5fbf18f91a52f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 24 02:02:37 2017 +0200
temp9
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index f1f2296a6c87..1148490e7b7c 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1491,6 +1491,7 @@ int Desktop::Main()
}
else if (isTimeForUpdateCheck())
{
+ SAL_DEBUG("update check");
sal_uInt64 nNow = tools::Time::GetSystemTicks();
std::shared_ptr< comphelper::ConfigurationChanges > batch(
comphelper::ConfigurationChanges::create());
commit 725e9c561934dd6934466c0da108de2ee5cdf430
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Apr 24 01:14:53 2017 +0200
extract the common updater path info into methods
Change-Id: I8d25fc3c6a6a0a7e05bac6679f2312a904e75bbd
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 91fb06fbe923..f1f2296a6c87 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1475,19 +1475,13 @@ int Desktop::Main()
#if HAVE_FEATURE_UPDATE_MAR
if (officecfg::Office::Update::Update::Enabled::get())
{
- OUString aPatchDirURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/patch/");
- rtl::Bootstrap::expandMacros(aPatchDirURL);
-
osl::DirectoryItem aPatchInfo;
- osl::DirectoryItem::get(aPatchDirURL + "/update.info", aPatchInfo);
+ osl::DirectoryItem::get(Updater::getUpdateInfoURL(), aPatchInfo);
if (aPatchInfo.is())
{
- OUString aInstallationDir( "$BRAND_BASE_DIR/");
- rtl::Bootstrap::expandMacros(aInstallationDir);
-
osl::DirectoryItem aDirectoryItem;
- osl::DirectoryItem::get(aInstallationDir + "/updated", aDirectoryItem);
+ osl::DirectoryItem::get(Updater::getUpdateDirURL(), aDirectoryItem);
bool bValidUpdateDirExists = aDirectoryItem.is();
if (bValidUpdateDirExists)
{
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index c56f589fbdec..c38f916c7189 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -140,7 +140,7 @@ char** createCommandLine()
}
{
// directory with the patch log
- OUString aPatchDir("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/patch/");
+ OUString aPatchDir = Updater::getPatchDirURL();
rtl::Bootstrap::expandMacros(aPatchDir);
OUString aTempDirPath = getPathFromURL(aPatchDir);
createStr(aTempDirPath, pArgs, 1);
@@ -152,9 +152,8 @@ char** createCommandLine()
}
{
// the temporary updated build
- OUString aPatchDir("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/update_dir/");
- rtl::Bootstrap::expandMacros(aPatchDir);
- OUString aWorkingDir = getPathFromURL(aPatchDir);
+ OUString aUpdateDirURL = Updater::getUpdateDirURL();
+ OUString aWorkingDir = getPathFromURL(aUpdateDirURL);
createStr(aWorkingDir, pArgs, 3);
}
{
@@ -162,15 +161,14 @@ char** createCommandLine()
createStr(pPID, pArgs, 4);
}
{
- OUString aExeDir( "$BRAND_BASE_DIR/" LIBO_BIN_FOLDER "/" );
+ OUString aExeDir = Updater::getExecutableDirURL();
OUString aSofficePath = getPathFromURL(aExeDir);
createStr(aSofficePath, pArgs, 5);
}
{
// the executable to start after the successful update
- OUString aSofficeDir( "$BRAND_BASE_DIR/" LIBO_BIN_FOLDER "/" );
- rtl::Bootstrap::expandMacros(aSofficeDir);
- OUString aSofficePathURL = aSofficeDir + OUString::fromUtf8(pSofficeExeName);
+ OUString aExeDir = Updater::getExecutableDirURL();
+ OUString aSofficePathURL = aExeDir + OUString::fromUtf8(pSofficeExeName);
OUString aSofficePath = getPathFromURL(aSofficePathURL);
createStr(aSofficePath, pArgs, 6);
}
@@ -566,5 +564,36 @@ void update_checker()
}
}
+OUString Updater::getUpdateInfoURL()
+{
+ OUString aUpdateInfoURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/patch/update.info");
+ rtl::Bootstrap::expandMacros(aUpdateInfoURL);
+
+ return aUpdateInfoURL;
+}
+
+OUString Updater::getPatchDirURL()
+{
+ OUString aPatchDirURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/patch/");
+ rtl::Bootstrap::expandMacros(aPatchDirURL);
+
+ return aPatchDirURL;
+}
+
+OUString Updater::getUpdateDirURL()
+{
+ OUString aUpdateDirURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/update_dir/");
+ rtl::Bootstrap::expandMacros(aUpdateDirURL);
+
+ return aUpdateDirURL;
+}
+
+OUString Updater::getExecutableDirURL()
+{
+ OUString aExeDir( "$BRAND_BASE_DIR/" LIBO_BIN_FOLDER "/" );
+ rtl::Bootstrap::expandMacros(aExeDir);
+
+ return aExeDir;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/app/updater.hxx b/desktop/source/app/updater.hxx
index fa5349afbe11..b36c1f91b306 100644
--- a/desktop/source/app/updater.hxx
+++ b/desktop/source/app/updater.hxx
@@ -16,6 +16,19 @@ void update();
void update_checker();
+class Updater
+{
+private:
+
+public:
+
+ static OUString getUpdateInfoURL();
+ static OUString getPatchDirURL();
+ static OUString getUpdateDirURL();
+ static OUString getExecutableDirURL();
+
+};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 36bac289e0ae222db380d42c26de5f8ddca7cf1f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Apr 21 22:57:59 2017 +0200
either try to install an update or check for update
Change-Id: Id1e879598ef34715786e10e163ed1e4689f3137a
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 34fe770ddb96..91fb06fbe923 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1495,8 +1495,7 @@ int Desktop::Main()
update();
}
}
-
- if (isTimeForUpdateCheck())
+ else if (isTimeForUpdateCheck())
{
sal_uInt64 nNow = tools::Time::GetSystemTicks();
std::shared_ptr< comphelper::ConfigurationChanges > batch(
commit 9f9777d3dfbca45f6eef04fb5f4a83f15311e27d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Apr 21 22:43:02 2017 +0200
fix path calculation
Change-Id: Ia45951126835c4218c19dd1b58f533ce9a219308
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 0d2bc0ac7bf9..c56f589fbdec 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -75,7 +75,7 @@ OUString normalizePath(const OUString& rPath)
}
OUString aTempPath = aPath;
- aPath = aTempPath.copy(0, i - 1) + aPath.copy(nIndex + 3);
+ aPath = aTempPath.copy(0, i) + aPath.copy(nIndex + 3);
}
SAL_DEBUG(aPath);
commit 4dc9f66544570c4624934a9663896eca84558e90
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Apr 21 22:25:16 2017 +0200
temp 12
Change-Id: I0ec1f53666af3683b5cc2e35d4dec1ef39a98527
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index f3b9a3a8302e..0d2bc0ac7bf9 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -566,4 +566,5 @@ void update_checker()
}
}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 77a0f1ffa4092fee6fd68c1896766c33f00d9a61
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Apr 21 22:16:39 2017 +0200
normalize path for updater
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 4931bf8d8535..f3b9a3a8302e 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -56,7 +56,31 @@ const char* pSofficeExeName = "soffice.exe";
OUString normalizePath(const OUString& rPath)
{
- return rPath.replaceAll("//", "/");
+ OUString aPath = rPath.replaceAll("//", "/");
+
+ // remove final /
+ if (aPath.endsWith("/"))
+ {
+ aPath = aPath.copy(0, aPath.getLength() - 1);
+ }
+
+ while (aPath.indexOf("/..") != -1)
+ {
+ sal_Int32 nIndex = aPath.indexOf("/..");
+ sal_Int32 i = nIndex - 1;
+ for (; i > 0; --i)
+ {
+ if (aPath[i] == '/')
+ break;
+ }
+
+ OUString aTempPath = aPath;
+ aPath = aTempPath.copy(0, i - 1) + aPath.copy(nIndex + 3);
+ }
+
+ SAL_DEBUG(aPath);
+
+ return aPath;
}
void CopyFileToDir(const OUString& rTempDirURL, const OUString rFileName, const OUString& rOldDir)
commit fa0dcfb9779a1af3d927b5c98534254781f4fe7c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Apr 21 22:04:09 2017 +0200
better flexibility through configurable updated build directory
Change-Id: Icaa814cdcd27171fbafc2407d55161cdc13e750e
diff --git a/onlineupdate/source/update/updater/updater.cxx b/onlineupdate/source/update/updater/updater.cxx
index 18cf8b2cc966..57ac77507a8b 100644
--- a/onlineupdate/source/update/updater/updater.cxx
+++ b/onlineupdate/source/update/updater/updater.cxx
@@ -2357,8 +2357,8 @@ ProcessReplaceRequest()
NS_T("%s/Contents"),
gWorkingDirPath);
#else
- NS_T("%s.bak/updated"),
- gInstallDirPath);
+ NS_T("%s"),
+ gWorkingDirPath);
#endif
// First try to remove the possibly existing temp directory, because if this
commit 91643ab5f8f6f8cc7576921ae578a98fb96dd40c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Apr 21 21:14:50 2017 +0200
first stab at normalizing updater path
Change-Id: I5ef2253068595c41577330395810b0797eff8cbb
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 5ef06d15064c..4931bf8d8535 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -54,6 +54,10 @@ const char* pSofficeExeName = "soffice.exe";
#error "Need implementation"
#endif
+OUString normalizePath(const OUString& rPath)
+{
+ return rPath.replaceAll("//", "/");
+}
void CopyFileToDir(const OUString& rTempDirURL, const OUString rFileName, const OUString& rOldDir)
{
@@ -73,7 +77,7 @@ OUString getPathFromURL(const OUString& rURL)
OUString aPath;
osl::FileBase::getSystemPathFromFileURL(rURL, aPath);
- return aPath;
+ return normalizePath(aPath);
}
void CopyUpdaterToTempDir(const OUString& rInstallDirURL, const OUString& rTempDirURL)
commit f3eeb506fc6c29a59fafe986c680033371659378
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Apr 21 20:50:21 2017 +0200
temp5
Change-Id: I45f7e05e128d62a5930e6db9793b8cf4e7751046
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 77f2be7502e5..5ef06d15064c 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -111,17 +111,22 @@ char** createCommandLine()
createStr(pUpdaterName, pArgs, 0);
}
{
+ // directory with the patch log
OUString aPatchDir("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/patch/");
rtl::Bootstrap::expandMacros(aPatchDir);
OUString aTempDirPath = getPathFromURL(aPatchDir);
createStr(aTempDirPath, pArgs, 1);
}
{
+ // the actual update directory
OUString aInstallPath = getPathFromURL(aLibExecDirURL);
createStr(aInstallPath, pArgs, 2);
}
{
- OUString aWorkingDir = getPathFromURL(aLibExecDirURL + "/updated");
+ // the temporary updated build
+ OUString aPatchDir("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/update_dir/");
+ rtl::Bootstrap::expandMacros(aPatchDir);
+ OUString aWorkingDir = getPathFromURL(aPatchDir);
createStr(aWorkingDir, pArgs, 3);
}
{
@@ -134,6 +139,7 @@ char** createCommandLine()
createStr(aSofficePath, pArgs, 5);
}
{
+ // the executable to start after the successful update
OUString aSofficeDir( "$BRAND_BASE_DIR/" LIBO_BIN_FOLDER "/" );
rtl::Bootstrap::expandMacros(aSofficeDir);
OUString aSofficePathURL = aSofficeDir + OUString::fromUtf8(pSofficeExeName);
@@ -202,7 +208,9 @@ void CreateValidUpdateDir(const update_info& update_info)
OUString aInstallDir("$BRAND_BASE_DIR");
rtl::Bootstrap::expandMacros(aInstallDir);
OUString aInstallPath = getPathFromURL(aInstallDir);
- OUString aWorkdirPath = getPathFromURL(aInstallDir + "/updated");
+ OUString aUpdatedBuildDir("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/update_dir/");
+ rtl::Bootstrap::expandMacros(aUpdatedBuildDir);
+ OUString aWorkdirPath = getPathFromURL(aUpdatedBuildDir);
OUString aPatchDirURL("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/patch/");
rtl::Bootstrap::expandMacros(aPatchDirURL);
commit 30ce7ea813151c67f8ad6c88461a9ee8e2da2fce
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Apr 19 14:56:52 2017 +0200
temp
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index dfa609459001..34fe770ddb96 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1491,6 +1491,7 @@ int Desktop::Main()
bool bValidUpdateDirExists = aDirectoryItem.is();
if (bValidUpdateDirExists)
{
+ SAL_DEBUG("update");
update();
}
}
commit f5498749e0fb53ec97f79ace2f2f42fce5fd4dc2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Apr 19 13:28:02 2017 +0200
don't crash when we get bad response
Change-Id: I4bc68e9f9604a8a39f36f10434571cd9fbb48ae1
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index d27c6fa4deb4..77f2be7502e5 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -524,6 +524,10 @@ void update_checker()
{
SAL_WARN("desktop.updater", "error during the update check");
}
+ catch (...)
+ {
+ SAL_WARN("desktop.updater", "unknown error during the update check");
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 04949b943ba29ee7b8f7f748276ca0e9bdadf086
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Apr 19 13:20:47 2017 +0200
ignore SIGPIPE in glx test process
Change-Id: I31977f86290b4fd7e0869af85f5132ae7cd9d5fd
diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx
index efe55910d164..383be628dfa9 100644
--- a/vcl/unx/glxtest.cxx
+++ b/vcl/unx/glxtest.cxx
@@ -25,6 +25,7 @@
#include <fcntl.h>
#include "stdint.h"
#include <string.h>
+#include <signal.h>
#include "opengl/x11/glxtest.hxx"
@@ -98,6 +99,7 @@ x_error_handler(Display *, XErrorEvent *ev)
void glxtest()
{
+ signal(SIGPIPE, SIG_IGN);
// we want to redirect to /dev/null stdout, stderr, and while we're at it,
// any PR logging file descriptors. To that effect, we redirect all positive
// file descriptors up to what open() returns here. In particular, 1 is stdout and 2 is stderr.
commit 1a994a5827c3af1a7841872bad14d1af5631f74b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Apr 18 19:42:53 2017 +0200
hard coding the number of entries just leads to problems
Change-Id: I527c2c881bf46b1724b8da9223b2614ff30fbec7
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 45ba9b7430d0..d27c6fa4deb4 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -323,12 +323,6 @@ update_info parse_response(const std::string& rResponse)
throw invalid_update_info();
}
- if (aRootKeys.size() != 5)
- {
- SAL_WARN("desktop.Update", "invalid root entries: " << rResponse);
- throw invalid_update_info();
- }
-
orcus::json::detail::node aFromNode = aDocumentRoot.child("from");
if (aFromNode.type() != orcus::json_node_t::string)
{
commit 112c19e469d088d3514023b3ab28f37e6dd5b044
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Apr 18 19:16:02 2017 +0200
version entry is no more
Change-Id: I5011deec4a3b00b22d68d5dff594586d74d717ba
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 15e79012b5b2..45ba9b7430d0 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -162,7 +162,6 @@ struct update_info
{
OUString aFromBuildID;
OUString aSeeAlsoURL;
- OUString aNewVersion;
update_file aUpdateFile;
std::vector<language_file> aLanguageFiles;
@@ -342,12 +341,6 @@ update_info parse_response(const std::string& rResponse)
throw invalid_update_info();
}
- orcus::json::detail::node aVersionNode = aDocumentRoot.child("version");
- if (aVersionNode.type() != orcus::json_node_t::string)
- {
- throw invalid_update_info();
- }
-
orcus::json::detail::node aUpdateNode = aDocumentRoot.child("update");
if (aUpdateNode.type() != orcus::json_node_t::object)
{
@@ -362,7 +355,6 @@ update_info parse_response(const std::string& rResponse)
update_info aUpdateInfo;
aUpdateInfo.aFromBuildID = toOUString(aFromNode.string_value().str());
- aUpdateInfo.aNewVersion = toOUString(aVersionNode.string_value().str());
aUpdateInfo.aSeeAlsoURL = toOUString(aSeeAlsoNode.string_value().str());
aUpdateInfo.aUpdateFile = parse_update_file(aUpdateNode);
commit 6a804274e598ad13cf877a52a1effe8ed96df049
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Apr 18 13:30:46 2017 +0200
temp
Change-Id: Ie3f2687670b02d8af85016c25b49cb42517701b9
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index a6dc19124d2e..15e79012b5b2 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -519,10 +519,10 @@ void update_checker()
"/" + aBuildID + "/" + aBuildTarget + "/" + "/" + aChannel;
OString aURL = OUStringToOString(aDownloadCheckURL, RTL_TEXTENCODING_UTF8);
- std::string response_body = download_content(aURL, false);
try
{
+ std::string response_body = download_content(aURL, false);
if (!response_body.empty())
{
update_info aUpdateInfo = parse_response(response_body);
commit cf3e43c7da70111587d54f5e0e2f9da0d0e5d58f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Apr 18 13:21:27 2017 +0200
temp
Change-Id: Idc0bc581a505b7ed7719ccd22eccf1e10aca6795
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 5f38e87dba11..a6dc19124d2e 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -513,7 +513,7 @@ void update_checker()
rtl::Bootstrap::expandMacros(aBuildID);
OUString aBuildTarget = "${_OS}_${_ARCH}";
rtl::Bootstrap::expandMacros(aBuildTarget);
- OUString aChannel = officecfg::Office::Update::Update::UpdateChannel::get();
+ OUString aChannel = "daily-master";//officecfg::Office::Update::Update::UpdateChannel::get();
OUString aDownloadCheckURL = aDownloadCheckBaseURL + "update/check/1/" + aProductName +
"/" + aBuildID + "/" + aBuildTarget + "/" + "/" + aChannel;
commit 96ef391c5a8cbebd4af179510380dcfad667b99b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Apr 18 13:08:40 2017 +0200
temp
Change-Id: I6ece7924e6e0980c2bb4fffa9d733e6352382084
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 003261f615b0..5f38e87dba11 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -511,15 +511,12 @@ void update_checker()
OUString aProductName = utl::ConfigManager::getProductName();
OUString aBuildID("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("version") ":buildid}");
rtl::Bootstrap::expandMacros(aBuildID);
- OUString aVersion = "5.3.0.0.alpha0+";
OUString aBuildTarget = "${_OS}_${_ARCH}";
rtl::Bootstrap::expandMacros(aBuildTarget);
- OUString aLocale = "en-US";
OUString aChannel = officecfg::Office::Update::Update::UpdateChannel::get();
- OUString aDownloadCheckURL = aDownloadCheckBaseURL + "update/1/" + aProductName +
- "/" + aVersion + "/" + aBuildID + "/" + aBuildTarget + "/" + aLocale +
- "/" + aChannel;
+ OUString aDownloadCheckURL = aDownloadCheckBaseURL + "update/check/1/" + aProductName +
+ "/" + aBuildID + "/" + aBuildTarget + "/" + "/" + aChannel;
OString aURL = OUStringToOString(aDownloadCheckURL, RTL_TEXTENCODING_UTF8);
std::string response_body = download_content(aURL, false);
commit 42f11ec0e6f8ea984c3ffae58b6beb4537e81180
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Apr 18 12:33:58 2017 +0200
temp3
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 0c233bc0e99c..dfa609459001 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1491,7 +1491,7 @@ int Desktop::Main()
bool bValidUpdateDirExists = aDirectoryItem.is();
if (bValidUpdateDirExists)
{
- Update();
+ update();
}
}
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 2b9c68a0d969..003261f615b0 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -435,6 +435,8 @@ std::string download_content(const OString& rURL, bool bFile)
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
if (http_code != 200)
{
+ SAL_DEBUG(rURL);
+ SAL_DEBUG(response_body);
SAL_WARN("desktop.updater", "download did not succeed. Error code: " << http_code);
throw error_updater();
}
commit 34704b30379b73bda26f3d5f93767e8b7cd51b41
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Apr 18 12:06:58 2017 +0200
temp2
Change-Id: I7b003167e9dc6276daa67b927cc18c3d20ac1767
diff --git a/bin/update/upload_build_config.py b/bin/update/upload_build_config.py
index 0380cc1c323b..8172819c5050 100755
--- a/bin/update/upload_build_config.py
+++ b/bin/update/upload_build_config.py
@@ -27,11 +27,14 @@ def main(argv):
login_data = { 'username': user,'password': password,
'csrfmiddlewaretoken': csrftoken }
r1 = session.post(login_url, data=login_data, headers={"Referer": login_url})
+ print(r1.content)
url = base_address + "update/upload/release"
+ data = {}
+ data['csrfmiddlewaretoken'] = csrftoken
build_config = os.path.join(sys.argv[1], "build_config.json")
- r = session.post(url, files={'release_config': open(build_config, "r")})
+ r = session.post(url, files={'release_config': open(build_config, "r")}, data=data)
print(r.content)
if r.status_code != 200:
sys.exit(1)
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 2f5cb9660dfd..0c233bc0e99c 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1251,14 +1251,7 @@ void restartOnMac(bool passArguments) {
bool isTimeForUpdateCheck()
{
- sal_uInt64 nLastUpdate = officecfg::Office::Update::Update::LastUpdateTime::get();
- sal_uInt64 nNow = tools::Time::GetSystemTicks();
-
- sal_uInt64 n7DayInMS = 1000 * 60 * 60 * 24 * 7; // 7 days in ms
- if (nNow - n7DayInMS >= nLastUpdate)
- return true;
-
- return false;
+ return true;
}
}
diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 0ca03bc9de9e..2b9c68a0d969 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -38,17 +38,22 @@ class error_updater : public std::exception
{
};
-static const char kUserAgent[] = "UpdateChecker/1.0 (Linux)";
+#ifdef UNX
+static const char kUserAgent[] = "LibreOffice UpdateChecker/1.0 (Linux)";
+#else
+static const char kUserAgent[] = "LibreOffice UpdateChecker/1.0 (unknown platform)";
+#endif
#ifdef UNX
const char* pUpdaterName = "updater";
+const char* pSofficeExeName = "soffice";
#elif defined(WNT)
const char* pUpdaterName = "updater.exe";
+const char* pSofficeExeName = "soffice.exe";
#else
#error "Need implementation"
#endif
-const char* pSofficeExeName = "soffice";
void CopyFileToDir(const OUString& rTempDirURL, const OUString rFileName, const OUString& rOldDir)
{
@@ -109,7 +114,7 @@ char** createCommandLine()
OUString aPatchDir("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("bootstrap") ":UserInstallation}/patch/");
rtl::Bootstrap::expandMacros(aPatchDir);
OUString aTempDirPath = getPathFromURL(aPatchDir);
- createStr(aPatchDir, pArgs, 1);
+ createStr(aTempDirPath, pArgs, 1);
}
{
OUString aInstallPath = getPathFromURL(aLibExecDirURL);
@@ -165,7 +170,7 @@ struct update_info
}
-void Update()
+void update()
{
OUString aLibExecDirURL( "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER );
rtl::Bootstrap::expandMacros(aLibExecDirURL);
@@ -397,6 +402,7 @@ std::string download_content(const OString& rURL, bool bFile)
curl_slist* headerlist = nullptr;
headerlist = curl_slist_append(headerlist, buf);
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
+ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); // follow redirects
std::string response_body;
utl::TempFile aTempFile;
diff --git a/desktop/source/app/updater.hxx b/desktop/source/app/updater.hxx
index fab760516952..fa5349afbe11 100644
--- a/desktop/source/app/updater.hxx
+++ b/desktop/source/app/updater.hxx
@@ -12,7 +12,7 @@
#include <rtl/ustring.hxx>
-void Update();
+void update();
void update_checker();
commit 23400de2ad733104b9c17ab8ef1a6ac338f35b69
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Jan 8 21:16:45 2017 +0100
add more TODO comments
diff --git a/onlineupdate/source/update/updater/loaddlls.cxx b/onlineupdate/source/update/updater/loaddlls.cxx
index 246d9f86bf79..6a0c8a61ee91 100644
--- a/onlineupdate/source/update/updater/loaddlls.cxx
+++ b/onlineupdate/source/update/updater/loaddlls.cxx
@@ -36,6 +36,7 @@ struct AutoLoadSystemDependencies
}
}
+ // TODO: moggi: do we need all that code?
// When SetDefaultDllDirectories is not available, fallback to preloading
// dlls. The order that these are loaded does not matter since they are
// loaded using the LOAD_WITH_ALTERED_SEARCH_PATH flag.
commit 21f79331b833c9c32290a30ebdf4f8098a4efccb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Jan 6 05:45:49 2017 +0100
add the astyle script used to format the files
diff --git a/onlineupdate/astyle.options b/onlineupdate/astyle.options
new file mode 100644
index 000000000000..fc8d9f69faff
--- /dev/null
+++ b/onlineupdate/astyle.options
@@ -0,0 +1,7 @@
+--style=allman
+-s4
+--indent=spaces=4
+--attach-namespaces
+--indent-switches
+--indent-col1-comments
+--pad-header
commit 3ae019963cf294ff451cf1d79558a6046c9ea64f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Fri Jan 6 05:42:34 2017 +0100
use a more libreoffice like formatting
This formatting has been done by an astyle script. The idea is that with
a consistent formatting it is much easier to bring in changes from
Mozilla. Updating the code with the new version, running the astyle
script and then looking through the diff seems like the most sensible
option.
diff --git a/onlineupdate/source/libmar/sign/nss_secutil.h b/onlineupdate/source/libmar/sign/nss_secutil.h
index 363c64918068..f599fcce573d 100644
--- a/onlineupdate/source/libmar/sign/nss_secutil.h
+++ b/onlineupdate/source/libmar/sign/nss_secutil.h
@@ -16,14 +16,16 @@
#include "key.h"
#include <stdint.h>
-typedef struct {
- enum {
- PW_NONE = 0,
- PW_FROMFILE = 1,
- PW_PLAINTEXT = 2,
- PW_EXTERNAL = 3
- } source;
- char *data;
+typedef struct
+{
+ enum
+ {
+ PW_NONE = 0,
+ PW_FROMFILE = 1,
+ PW_PLAINTEXT = 2,
+ PW_EXTERNAL = 3
+ } source;
+ char *data;
} secuPWData;
#if( defined(_WINDOWS) && !defined(_WIN32_WCE))
diff --git a/onlineupdate/source/libmar/verify/cryptox.h b/onlineupdate/source/libmar/verify/cryptox.h
index d08ef159a83c..eb8548fa7a4f 100644
--- a/onlineupdate/source/libmar/verify/cryptox.h
+++ b/onlineupdate/source/libmar/verify/cryptox.h
@@ -77,9 +77,9 @@ CryptoX_Result CryptoMac_LoadPublicKey(const unsigned char* aCertData,
unsigned int aDataSize,
CryptoX_PublicKey* aPublicKey);
CryptoX_Result CryptoMac_VerifySignature(CryptoX_SignatureHandle* aInputData,
- CryptoX_PublicKey* aPublicKey,
- const unsigned char* aSignature,
- unsigned int aSignatureLen);
+ CryptoX_PublicKey* aPublicKey,
+ const unsigned char* aSignature,
+ unsigned int aSignatureLen);
void CryptoMac_FreeSignatureHandle(CryptoX_SignatureHandle* aInputData);
void CryptoMac_FreePublicKey(CryptoX_PublicKey* aPublicKey);
#ifdef __cplusplus
@@ -118,9 +118,9 @@ CryptoX_Result CryptoAPI_VerifyBegin(HCRYPTPROV provider, HCRYPTHASH* hash);
CryptoX_Result CryptoAPI_VerifyUpdate(HCRYPTHASH* hash,
BYTE *buf, DWORD len);
CryptoX_Result CyprtoAPI_VerifySignature(HCRYPTHASH *hash,
- HCRYPTKEY *pubKey,
- const BYTE *signature,
- DWORD signatureLen);
+ HCRYPTKEY *pubKey,
+ const BYTE *signature,
+ DWORD signatureLen);
#define CryptoX_InvalidHandleValue ((ULONG_PTR)NULL)
#define CryptoX_ProviderHandle HCRYPTPROV
diff --git a/onlineupdate/source/service/certificatecheck.cxx b/onlineupdate/source/service/certificatecheck.cxx
index 3a9eba020ccb..58d70162f40c 100644
--- a/onlineupdate/source/service/certificatecheck.cxx
+++ b/onlineupdate/source/service/certificatecheck.cxx
@@ -28,87 +28,97 @@ DWORD
CheckCertificateForPEFile(LPCWSTR filePath,
CertificateCheckInfo &infoToMatch)
{
- HCERTSTORE certStore = nullptr;
- HCRYPTMSG cryptMsg = nullptr;
- PCCERT_CONTEXT certContext = nullptr;
- PCMSG_SIGNER_INFO signerInfo = nullptr;
- DWORD lastError = ERROR_SUCCESS;
+ HCERTSTORE certStore = nullptr;
+ HCRYPTMSG cryptMsg = nullptr;
+ PCCERT_CONTEXT certContext = nullptr;
+ PCMSG_SIGNER_INFO signerInfo = nullptr;
+ DWORD lastError = ERROR_SUCCESS;
- // Get the HCERTSTORE and HCRYPTMSG from the signed file.
- DWORD encoding, contentType, formatType;
- BOOL result = CryptQueryObject(CERT_QUERY_OBJECT_FILE,
- filePath,
- CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED,
- CERT_QUERY_CONTENT_FLAG_ALL,
- 0, &encoding, &contentType,
- &formatType, &certStore, &cryptMsg, nullptr);
- if (!result) {
- lastError = GetLastError();
- LOG_WARN(("CryptQueryObject failed. (%d)", lastError));
- goto cleanup;
- }
+ // Get the HCERTSTORE and HCRYPTMSG from the signed file.
+ DWORD encoding, contentType, formatType;
+ BOOL result = CryptQueryObject(CERT_QUERY_OBJECT_FILE,
+ filePath,
+ CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED,
+ CERT_QUERY_CONTENT_FLAG_ALL,
+ 0, &encoding, &contentType,
+ &formatType, &certStore, &cryptMsg, nullptr);
+ if (!result)
+ {
+ lastError = GetLastError();
+ LOG_WARN(("CryptQueryObject failed. (%d)", lastError));
+ goto cleanup;
+ }
- // Pass in nullptr to get the needed signer information size.
- DWORD signerInfoSize;
- result = CryptMsgGetParam(cryptMsg, CMSG_SIGNER_INFO_PARAM, 0,
- nullptr, &signerInfoSize);
- if (!result) {
- lastError = GetLastError();
- LOG_WARN(("CryptMsgGetParam failed. (%d)", lastError));
- goto cleanup;
- }
+ // Pass in nullptr to get the needed signer information size.
+ DWORD signerInfoSize;
+ result = CryptMsgGetParam(cryptMsg, CMSG_SIGNER_INFO_PARAM, 0,
+ nullptr, &signerInfoSize);
+ if (!result)
+ {
+ lastError = GetLastError();
+ LOG_WARN(("CryptMsgGetParam failed. (%d)", lastError));
+ goto cleanup;
+ }
- // Allocate the needed size for the signer information.
- signerInfo = (PCMSG_SIGNER_INFO)LocalAlloc(LPTR, signerInfoSize);
- if (!signerInfo) {
- lastError = GetLastError();
- LOG_WARN(("Unable to allocate memory for Signer Info. (%d)", lastError));
- goto cleanup;
- }
+ // Allocate the needed size for the signer information.
+ signerInfo = (PCMSG_SIGNER_INFO)LocalAlloc(LPTR, signerInfoSize);
+ if (!signerInfo)
+ {
+ lastError = GetLastError();
+ LOG_WARN(("Unable to allocate memory for Signer Info. (%d)", lastError));
+ goto cleanup;
+ }
- // Get the signer information (PCMSG_SIGNER_INFO).
- // In particular we want the issuer and serial number.
- result = CryptMsgGetParam(cryptMsg, CMSG_SIGNER_INFO_PARAM, 0,
- (PVOID)signerInfo, &signerInfoSize);
- if (!result) {
- lastError = GetLastError();
- LOG_WARN(("CryptMsgGetParam failed. (%d)", lastError));
- goto cleanup;
- }
+ // Get the signer information (PCMSG_SIGNER_INFO).
+ // In particular we want the issuer and serial number.
+ result = CryptMsgGetParam(cryptMsg, CMSG_SIGNER_INFO_PARAM, 0,
+ (PVOID)signerInfo, &signerInfoSize);
+ if (!result)
+ {
+ lastError = GetLastError();
+ LOG_WARN(("CryptMsgGetParam failed. (%d)", lastError));
+ goto cleanup;
+ }
- // Search for the signer certificate in the certificate store.
- CERT_INFO certInfo;
- certInfo.Issuer = signerInfo->Issuer;
- certInfo.SerialNumber = signerInfo->SerialNumber;
- certContext = CertFindCertificateInStore(certStore, ENCODING, 0,
- CERT_FIND_SUBJECT_CERT,
- (PVOID)&certInfo, nullptr);
- if (!certContext) {
- lastError = GetLastError();
- LOG_WARN(("CertFindCertificateInStore failed. (%d)", lastError));
- goto cleanup;
- }
+ // Search for the signer certificate in the certificate store.
+ CERT_INFO certInfo;
+ certInfo.Issuer = signerInfo->Issuer;
+ certInfo.SerialNumber = signerInfo->SerialNumber;
+ certContext = CertFindCertificateInStore(certStore, ENCODING, 0,
+ CERT_FIND_SUBJECT_CERT,
+ (PVOID)&certInfo, nullptr);
+ if (!certContext)
+ {
+ lastError = GetLastError();
+ LOG_WARN(("CertFindCertificateInStore failed. (%d)", lastError));
+ goto cleanup;
+ }
- if (!DoCertificateAttributesMatch(certContext, infoToMatch)) {
- lastError = ERROR_NOT_FOUND;
- LOG_WARN(("Certificate did not match issuer or name. (%d)", lastError));
- goto cleanup;
- }
+ if (!DoCertificateAttributesMatch(certContext, infoToMatch))
+ {
+ lastError = ERROR_NOT_FOUND;
+ LOG_WARN(("Certificate did not match issuer or name. (%d)", lastError));
+ goto cleanup;
+ }
cleanup:
- if (signerInfo) {
- LocalFree(signerInfo);
- }
- if (certContext) {
- CertFreeCertificateContext(certContext);
- }
- if (certStore) {
- CertCloseStore(certStore, 0);
- }
- if (cryptMsg) {
- CryptMsgClose(cryptMsg);
- }
- return lastError;
+ if (signerInfo)
+ {
+ LocalFree(signerInfo);
+ }
+ if (certContext)
+ {
+ CertFreeCertificateContext(certContext);
+ }
+ if (certStore)
+ {
+ CertCloseStore(certStore, 0);
+ }
+ if (cryptMsg)
+ {
+ CryptMsgClose(cryptMsg);
+ }
+ return lastError;
}
/**
@@ -122,86 +132,96 @@ BOOL
DoCertificateAttributesMatch(PCCERT_CONTEXT certContext,
CertificateCheckInfo &infoToMatch)
{
- DWORD dwData;
- LPTSTR szName = nullptr;
+ DWORD dwData;
+ LPTSTR szName = nullptr;
- if (infoToMatch.issuer) {
- // Pass in nullptr to get the needed size of the issuer buffer.
- dwData = CertGetNameString(certContext,
- CERT_NAME_SIMPLE_DISPLAY_TYPE,
- CERT_NAME_ISSUER_FLAG, nullptr,
- nullptr, 0);
+ if (infoToMatch.issuer)
+ {
+ // Pass in nullptr to get the needed size of the issuer buffer.
+ dwData = CertGetNameString(certContext,
+ CERT_NAME_SIMPLE_DISPLAY_TYPE,
+ CERT_NAME_ISSUER_FLAG, nullptr,
+ nullptr, 0);
- if (!dwData) {
- LOG_WARN(("CertGetNameString failed. (%d)", GetLastError()));
- return FALSE;
- }
+ if (!dwData)
+ {
+ LOG_WARN(("CertGetNameString failed. (%d)", GetLastError()));
+ return FALSE;
+ }
- // Allocate memory for Issuer name buffer.
- LPTSTR szName = (LPTSTR)LocalAlloc(LPTR, dwData * sizeof(WCHAR));
- if (!szName) {
- LOG_WARN(("Unable to allocate memory for issuer name. (%d)",
- GetLastError()));
- return FALSE;
- }
+ // Allocate memory for Issuer name buffer.
+ LPTSTR szName = (LPTSTR)LocalAlloc(LPTR, dwData * sizeof(WCHAR));
+ if (!szName)
+ {
+ LOG_WARN(("Unable to allocate memory for issuer name. (%d)",
+ GetLastError()));
+ return FALSE;
+ }
- // Get Issuer name.
- if (!CertGetNameString(certContext, CERT_NAME_SIMPLE_DISPLAY_TYPE,
- CERT_NAME_ISSUER_FLAG, nullptr, szName, dwData)) {
- LOG_WARN(("CertGetNameString failed. (%d)", GetLastError()));
- LocalFree(szName);
- return FALSE;
- }
+ // Get Issuer name.
+ if (!CertGetNameString(certContext, CERT_NAME_SIMPLE_DISPLAY_TYPE,
+ CERT_NAME_ISSUER_FLAG, nullptr, szName, dwData))
+ {
+ LOG_WARN(("CertGetNameString failed. (%d)", GetLastError()));
+ LocalFree(szName);
+ return FALSE;
+ }
- // If the issuer does not match, return a failure.
- if (!infoToMatch.issuer ||
- wcscmp(szName, infoToMatch.issuer)) {
- LocalFree(szName);
- return FALSE;
+ // If the issuer does not match, return a failure.
+ if (!infoToMatch.issuer ||
+ wcscmp(szName, infoToMatch.issuer))
+ {
+ LocalFree(szName);
+ return FALSE;
+ }
+
+ LocalFree(szName);
+ szName = nullptr;
}
- LocalFree(szName);
- szName = nullptr;
- }
+ if (infoToMatch.name)
+ {
+ // Pass in nullptr to get the needed size of the name buffer.
+ dwData = CertGetNameString(certContext, CERT_NAME_SIMPLE_DISPLAY_TYPE,
+ 0, nullptr, nullptr, 0);
+ if (!dwData)
+ {
+ LOG_WARN(("CertGetNameString failed. (%d)", GetLastError()));
+ return FALSE;
+ }
- if (infoToMatch.name) {
- // Pass in nullptr to get the needed size of the name buffer.
- dwData = CertGetNameString(certContext, CERT_NAME_SIMPLE_DISPLAY_TYPE,
- 0, nullptr, nullptr, 0);
- if (!dwData) {
- LOG_WARN(("CertGetNameString failed. (%d)", GetLastError()));
- return FALSE;
- }
+ // Allocate memory for the name buffer.
+ szName = (LPTSTR)LocalAlloc(LPTR, dwData * sizeof(WCHAR));
+ if (!szName)
+ {
+ LOG_WARN(("Unable to allocate memory for subject name. (%d)",
+ GetLastError()));
+ return FALSE;
+ }
- // Allocate memory for the name buffer.
- szName = (LPTSTR)LocalAlloc(LPTR, dwData * sizeof(WCHAR));
- if (!szName) {
- LOG_WARN(("Unable to allocate memory for subject name. (%d)",
- GetLastError()));
- return FALSE;
- }
+ // Obtain the name.
+ if (!(CertGetNameString(certContext, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0,
+ nullptr, szName, dwData)))
+ {
+ LOG_WARN(("CertGetNameString failed. (%d)", GetLastError()));
+ LocalFree(szName);
+ return FALSE;
+ }
- // Obtain the name.
- if (!(CertGetNameString(certContext, CERT_NAME_SIMPLE_DISPLAY_TYPE, 0,
- nullptr, szName, dwData))) {
- LOG_WARN(("CertGetNameString failed. (%d)", GetLastError()));
- LocalFree(szName);
- return FALSE;
- }
+ // If the issuer does not match, return a failure.
+ if (!infoToMatch.name ||
+ wcscmp(szName, infoToMatch.name))
+ {
+ LocalFree(szName);
+ return FALSE;
+ }
- // If the issuer does not match, return a failure.
- if (!infoToMatch.name ||
- wcscmp(szName, infoToMatch.name)) {
- LocalFree(szName);
- return FALSE;
+ // We have a match!
+ LocalFree(szName);
}
- // We have a match!
- LocalFree(szName);
- }
-
- // If there were any errors we would have aborted by now.
- return TRUE;
+ // If there were any errors we would have aborted by now.
+ return TRUE;
}
/**
@@ -213,12 +233,13 @@ DoCertificateAttributesMatch(PCCERT_CONTEXT certContext,
LPWSTR
AllocateAndCopyWideString(LPCWSTR inputString)
{
- LPWSTR outputString =
- (LPWSTR)LocalAlloc(LPTR, (wcslen(inputString) + 1) * sizeof(WCHAR));
- if (outputString) {
- lstrcpyW(outputString, inputString);
- }
- return outputString;
+ LPWSTR outputString =
+ (LPWSTR)LocalAlloc(LPTR, (wcslen(inputString) + 1) * sizeof(WCHAR));
+ if (outputString)
+ {
+ lstrcpyW(outputString, inputString);
+ }
+ return outputString;
}
/**
@@ -230,41 +251,42 @@ AllocateAndCopyWideString(LPCWSTR inputString)
DWORD
VerifyCertificateTrustForFile(LPCWSTR filePath)
{
- // Setup the file to check.
- WINTRUST_FILE_INFO fileToCheck;
- ZeroMemory(&fileToCheck, sizeof(fileToCheck));
- fileToCheck.cbStruct = sizeof(WINTRUST_FILE_INFO);
- fileToCheck.pcwszFilePath = filePath;
+ // Setup the file to check.
+ WINTRUST_FILE_INFO fileToCheck;
+ ZeroMemory(&fileToCheck, sizeof(fileToCheck));
+ fileToCheck.cbStruct = sizeof(WINTRUST_FILE_INFO);
+ fileToCheck.pcwszFilePath = filePath;
- // Setup what to check, we want to check it is signed and trusted.
- WINTRUST_DATA trustData;
- ZeroMemory(&trustData, sizeof(trustData));
- trustData.cbStruct = sizeof(trustData);
- trustData.pPolicyCallbackData = nullptr;
- trustData.pSIPClientData = nullptr;
- trustData.dwUIChoice = WTD_UI_NONE;
- trustData.fdwRevocationChecks = WTD_REVOKE_NONE;
- trustData.dwUnionChoice = WTD_CHOICE_FILE;
- trustData.dwStateAction = 0;
- trustData.hWVTStateData = nullptr;
- trustData.pwszURLReference = nullptr;
- // no UI
- trustData.dwUIContext = 0;
- trustData.pFile = &fileToCheck;
+ // Setup what to check, we want to check it is signed and trusted.
+ WINTRUST_DATA trustData;
+ ZeroMemory(&trustData, sizeof(trustData));
+ trustData.cbStruct = sizeof(trustData);
+ trustData.pPolicyCallbackData = nullptr;
+ trustData.pSIPClientData = nullptr;
+ trustData.dwUIChoice = WTD_UI_NONE;
+ trustData.fdwRevocationChecks = WTD_REVOKE_NONE;
+ trustData.dwUnionChoice = WTD_CHOICE_FILE;
+ trustData.dwStateAction = 0;
+ trustData.hWVTStateData = nullptr;
+ trustData.pwszURLReference = nullptr;
+ // no UI
+ trustData.dwUIContext = 0;
+ trustData.pFile = &fileToCheck;
- GUID policyGUID = WINTRUST_ACTION_GENERIC_VERIFY_V2;
- // Check if the file is signed by something that is trusted.
- LONG ret = WinVerifyTrust(nullptr, &policyGUID, &trustData);
- if (ERROR_SUCCESS == ret) {
- // The hash that represents the subject is trusted and there were no
- // verification errors. No publisher nor time stamp chain errors.
- LOG(("The file \"%ls\" is signed and the signature was verified.",
- filePath));
- return ERROR_SUCCESS;
- }
+ GUID policyGUID = WINTRUST_ACTION_GENERIC_VERIFY_V2;
+ // Check if the file is signed by something that is trusted.
+ LONG ret = WinVerifyTrust(nullptr, &policyGUID, &trustData);
+ if (ERROR_SUCCESS == ret)
+ {
+ // The hash that represents the subject is trusted and there were no
+ // verification errors. No publisher nor time stamp chain errors.
+ LOG(("The file \"%ls\" is signed and the signature was verified.",
+ filePath));
+ return ERROR_SUCCESS;
+ }
- DWORD lastError = GetLastError();
- LOG_WARN(("There was an error validating trust of the certificate for file"
- " \"%ls\". Returned: %d. (%d)", filePath, ret, lastError));
- return ret;
+ DWORD lastError = GetLastError();
+ LOG_WARN(("There was an error validating trust of the certificate for file"
+ " \"%ls\". Returned: %d. (%d)", filePath, ret, lastError));
+ return ret;
}
diff --git a/onlineupdate/source/service/certificatecheck.hxx b/onlineupdate/source/service/certificatecheck.hxx
index 43a7c85b6b77..1efbcb153a65 100644
--- a/onlineupdate/source/service/certificatecheck.hxx
+++ b/onlineupdate/source/service/certificatecheck.hxx
@@ -9,14 +9,14 @@
struct CertificateCheckInfo
{
- LPCWSTR name;
- LPCWSTR issuer;
+ LPCWSTR name;
+ LPCWSTR issuer;
};
-BOOL DoCertificateAttributesMatch(PCCERT_CONTEXT pCertContext,
+BOOL DoCertificateAttributesMatch(PCCERT_CONTEXT pCertContext,
CertificateCheckInfo &infoToMatch);
DWORD VerifyCertificateTrustForFile(LPCWSTR filePath);
-DWORD CheckCertificateForPEFile(LPCWSTR filePath,
+DWORD CheckCertificateForPEFile(LPCWSTR filePath,
CertificateCheckInfo &infoToMatch);
#endif
diff --git a/onlineupdate/source/service/maintenanceservice.cxx b/onlineupdate/source/service/maintenanceservice.cxx
index 8471bdbd56c5..036bfe25192f 100644
--- a/onlineupdate/source/service/maintenanceservice.cxx
+++ b/onlineupdate/source/service/maintenanceservice.cxx
@@ -33,92 +33,106 @@ BOOL GetLogDirectoryPath(WCHAR *path);
int
wmain(int argc, WCHAR **argv)
{
- if (argc < 2)
- {
- LOG_WARN(("missing mandatory command line argument"));
- return 1;
- }
- // If command-line parameter is "install", install the service
- // or upgrade if already installed
- // If command line parameter is "forceinstall", install the service
- // even if it is older than what is already installed.
- // If command-line parameter is "upgrade", upgrade the service
- // but do not install it if it is not already installed.
- // If command line parameter is "uninstall", uninstall the service.
- // Otherwise, the service is probably being started by the SCM.
- bool forceInstall = !lstrcmpi(argv[1], L"forceinstall");
- if (!lstrcmpi(argv[1], L"install") || forceInstall) {
- WCHAR updatePath[MAX_PATH + 1];
- if (GetLogDirectoryPath(updatePath)) {
- LogInit(updatePath, L"maintenanceservice-install.log");
+ if (argc < 2)
+ {
+ LOG_WARN(("missing mandatory command line argument"));
+ return 1;
}
-
- SvcInstallAction action = InstallSvc;
- if (forceInstall) {
- action = ForceInstallSvc;
- LOG(("Installing service with force specified..."));
- } else {
- LOG(("Installing service..."));
+ // If command-line parameter is "install", install the service
+ // or upgrade if already installed
+ // If command line parameter is "forceinstall", install the service
+ // even if it is older than what is already installed.
+ // If command-line parameter is "upgrade", upgrade the service
+ // but do not install it if it is not already installed.
+ // If command line parameter is "uninstall", uninstall the service.
+ // Otherwise, the service is probably being started by the SCM.
+ bool forceInstall = !lstrcmpi(argv[1], L"forceinstall");
+ if (!lstrcmpi(argv[1], L"install") || forceInstall)
+ {
+ WCHAR updatePath[MAX_PATH + 1];
+ if (GetLogDirectoryPath(updatePath))
+ {
+ LogInit(updatePath, L"maintenanceservice-install.log");
+ }
+
+ SvcInstallAction action = InstallSvc;
+ if (forceInstall)
+ {
+ action = ForceInstallSvc;
+ LOG(("Installing service with force specified..."));
+ }
+ else
+ {
+ LOG(("Installing service..."));
+ }
+
+ bool ret = SvcInstall(action);
+ if (!ret)
+ {
+ LOG_WARN(("Could not install service. (%d)", GetLastError()));
+ LogFinish();
+ return 1;
+ }
+
+ LOG(("The service was installed successfully"));
+ LogFinish();
+ return 0;
}
- bool ret = SvcInstall(action);
- if (!ret) {
- LOG_WARN(("Could not install service. (%d)", GetLastError()));
- LogFinish();
- return 1;
+ if (!lstrcmpi(argv[1], L"upgrade"))
+ {
+ WCHAR updatePath[MAX_PATH + 1];
+ if (GetLogDirectoryPath(updatePath))
+ {
+ LogInit(updatePath, L"maintenanceservice-install.log");
+ }
+
+ LOG(("Upgrading service if installed..."));
+ if (!SvcInstall(UpgradeSvc))
+ {
+ LOG_WARN(("Could not upgrade service. (%d)", GetLastError()));
+ LogFinish();
+ return 1;
+ }
+
+ LOG(("The service was upgraded successfully"));
+ LogFinish();
+ return 0;
}
- LOG(("The service was installed successfully"));
- LogFinish();
- return 0;
- }
-
- if (!lstrcmpi(argv[1], L"upgrade")) {
- WCHAR updatePath[MAX_PATH + 1];
- if (GetLogDirectoryPath(updatePath)) {
- LogInit(updatePath, L"maintenanceservice-install.log");
+ if (!lstrcmpi(argv[1], L"uninstall"))
+ {
+ WCHAR updatePath[MAX_PATH + 1];
+ if (GetLogDirectoryPath(updatePath))
+ {
+ LogInit(updatePath, L"maintenanceservice-uninstall.log");
+ }
+ LOG(("Uninstalling service..."));
+ if (!SvcUninstall())
+ {
+ LOG_WARN(("Could not uninstall service. (%d)", GetLastError()));
+ LogFinish();
+ return 1;
+ }
+ LOG(("The service was uninstalled successfully"));
+ LogFinish();
+ return 0;
}
- LOG(("Upgrading service if installed..."));
- if (!SvcInstall(UpgradeSvc)) {
- LOG_WARN(("Could not upgrade service. (%d)", GetLastError()));
- LogFinish();
- return 1;
+ SERVICE_TABLE_ENTRYW DispatchTable[] =
+ {
+ { SVC_NAME, (LPSERVICE_MAIN_FUNCTIONW) SvcMain },
+ { nullptr, nullptr }
+ };
+
+ // This call returns when the service has stopped.
+ // The process should simply terminate when the call returns.
+ if (!StartServiceCtrlDispatcherW(DispatchTable))
+ {
+ LOG_WARN(("StartServiceCtrlDispatcher failed. (%d)", GetLastError()));
}
- LOG(("The service was upgraded successfully"));
- LogFinish();
return 0;
- }
-
- if (!lstrcmpi(argv[1], L"uninstall")) {
- WCHAR updatePath[MAX_PATH + 1];
- if (GetLogDirectoryPath(updatePath)) {
- LogInit(updatePath, L"maintenanceservice-uninstall.log");
- }
- LOG(("Uninstalling service..."));
- if (!SvcUninstall()) {
- LOG_WARN(("Could not uninstall service. (%d)", GetLastError()));
- LogFinish();
- return 1;
- }
- LOG(("The service was uninstalled successfully"));
- LogFinish();
- return 0;
- }
-
- SERVICE_TABLE_ENTRYW DispatchTable[] = {
- { SVC_NAME, (LPSERVICE_MAIN_FUNCTIONW) SvcMain },
- { nullptr, nullptr }
- };
-
- // This call returns when the service has stopped.
- // The process should simply terminate when the call returns.
- if (!StartServiceCtrlDispatcherW(DispatchTable)) {
- LOG_WARN(("StartServiceCtrlDispatcher failed. (%d)", GetLastError()));
- }
-
- return 0;
}
/**
@@ -130,24 +144,27 @@ wmain(int argc, WCHAR **argv)
BOOL
GetLogDirectoryPath(WCHAR *path)
{
- HRESULT hr = SHGetFolderPathW(nullptr, CSIDL_COMMON_APPDATA, nullptr,
- SHGFP_TYPE_CURRENT, path);
- if (FAILED(hr)) {
- return FALSE;
- }
-
- if (!PathAppendSafe(path, L"Mozilla")) {
- return FALSE;
- }
- // The directory should already be created from the installer, but
- // just to be safe in case someone deletes.
- CreateDirectoryW(path, nullptr);
-
- if (!PathAppendSafe(path, L"logs")) {
- return FALSE;
- }
- CreateDirectoryW(path, nullptr);
- return TRUE;
+ HRESULT hr = SHGetFolderPathW(nullptr, CSIDL_COMMON_APPDATA, nullptr,
+ SHGFP_TYPE_CURRENT, path);
+ if (FAILED(hr))
+ {
+ return FALSE;
+ }
+
+ if (!PathAppendSafe(path, L"Mozilla"))
+ {
+ return FALSE;
+ }
+ // The directory should already be created from the installer, but
+ // just to be safe in case someone deletes.
+ CreateDirectoryW(path, nullptr);
+
+ if (!PathAppendSafe(path, L"logs"))
+ {
+ return FALSE;
+ }
+ CreateDirectoryW(path, nullptr);
+ return TRUE;
}
/**
@@ -161,16 +178,19 @@ GetLogDirectoryPath(WCHAR *path)
BOOL
GetBackupLogPath(LPWSTR path, LPCWSTR basePath, int logNumber)
{
- WCHAR logName[64] = { L'\0' };
- wcsncpy(path, basePath, sizeof(logName) / sizeof(logName[0]) - 1);
- if (logNumber <= 0) {
- swprintf(logName, sizeof(logName) / sizeof(logName[0]),
- L"maintenanceservice.log");
- } else {
- swprintf(logName, sizeof(logName) / sizeof(logName[0]),
- L"maintenanceservice-%d.log", logNumber);
- }
- return PathAppendSafe(path, logName);
+ WCHAR logName[64] = { L'\0' };
+ wcsncpy(path, basePath, sizeof(logName) / sizeof(logName[0]) - 1);
+ if (logNumber <= 0)
+ {
+ swprintf(logName, sizeof(logName) / sizeof(logName[0]),
+ L"maintenanceservice.log");
+ }
+ else
+ {
+ swprintf(logName, sizeof(logName) / sizeof(logName[0]),
+ L"maintenanceservice-%d.log", logNumber);
+ }
+ return PathAppendSafe(path, logName);
}
/**
@@ -187,21 +207,25 @@ GetBackupLogPath(LPWSTR path, LPCWSTR basePath, int logNumber)
void
BackupOldLogs(LPCWSTR basePath, int numLogsToKeep)
{
- WCHAR oldPath[MAX_PATH + 1];
- WCHAR newPath[MAX_PATH + 1];
- for (int i = numLogsToKeep; i >= 1; i--) {
- if (!GetBackupLogPath(oldPath, basePath, i -1)) {
- continue;
- }
-
- if (!GetBackupLogPath(newPath, basePath, i)) {
- continue;
+ WCHAR oldPath[MAX_PATH + 1];
+ WCHAR newPath[MAX_PATH + 1];
+ for (int i = numLogsToKeep; i >= 1; i--)
+ {
+ if (!GetBackupLogPath(oldPath, basePath, i -1))
+ {
+ continue;
+ }
+
+ if (!GetBackupLogPath(newPath, basePath, i))
+ {
+ continue;
+ }
+
+ if (!MoveFileExW(oldPath, newPath, MOVEFILE_REPLACE_EXISTING))
+ {
+ continue;
+ }
}
-
- if (!MoveFileExW(oldPath, newPath, MOVEFILE_REPLACE_EXISTING)) {
- continue;
- }
- }
}
/**
@@ -221,20 +245,21 @@ BackupOldLogs(LPCWSTR basePath, int numLogsToKeep)
DWORD WINAPI
EnsureProcessTerminatedThread(LPVOID)
{
- Sleep(5000);
- exit(0);
+ Sleep(5000);
+ exit(0);
}
void
StartTerminationThread()
{
- // If the process does not self terminate like it should, this thread
- // will terminate the process after 5 seconds.
- HANDLE thread = CreateThread(nullptr, 0, EnsureProcessTerminatedThread,
- nullptr, 0, nullptr);
- if (thread) {
- CloseHandle(thread);
- }
+ // If the process does not self terminate like it should, this thread
+ // will terminate the process after 5 seconds.
+ HANDLE thread = CreateThread(nullptr, 0, EnsureProcessTerminatedThread,
+ nullptr, 0, nullptr);
+ if (thread)
+ {
+ CloseHandle(thread);
+ }
}
/**
@@ -243,61 +268,65 @@ StartTerminationThread()
void WINAPI
SvcMain(DWORD argc, LPWSTR *argv)
{
- // Setup logging, and backup the old logs
- WCHAR updatePath[MAX_PATH + 1];
- if (GetLogDirectoryPath(updatePath)) {
- BackupOldLogs(updatePath, LOGS_TO_KEEP);
- LogInit(updatePath, L"maintenanceservice.log");
- }
-
- // Disable every privilege we don't need. Processes started using
- // CreateProcess will use the same token as this process.
- UACHelper::DisablePrivileges(nullptr);
-
- // Register the handler function for the service
- gSvcStatusHandle = RegisterServiceCtrlHandlerW(SVC_NAME, SvcCtrlHandler);
- if (!gSvcStatusHandle) {
- LOG_WARN(("RegisterServiceCtrlHandler failed. (%d)", GetLastError()));
- ExecuteServiceCommand(argc, argv);
- LogFinish();
- exit(1);
- }
-
- // These values will be re-used later in calls involving gSvcStatus
- gSvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
- gSvcStatus.dwServiceSpecificExitCode = 0;
+ // Setup logging, and backup the old logs
+ WCHAR updatePath[MAX_PATH + 1];
+ if (GetLogDirectoryPath(updatePath))
+ {
+ BackupOldLogs(updatePath, LOGS_TO_KEEP);
+ LogInit(updatePath, L"maintenanceservice.log");
+ }
- // Report initial status to the SCM
- ReportSvcStatus(SERVICE_START_PENDING, NO_ERROR, 3000);
+ // Disable every privilege we don't need. Processes started using
+ // CreateProcess will use the same token as this process.
+ UACHelper::DisablePrivileges(nullptr);
+
+ // Register the handler function for the service
+ gSvcStatusHandle = RegisterServiceCtrlHandlerW(SVC_NAME, SvcCtrlHandler);
+ if (!gSvcStatusHandle)
+ {
+ LOG_WARN(("RegisterServiceCtrlHandler failed. (%d)", GetLastError()));
+ ExecuteServiceCommand(argc, argv);
+ LogFinish();
+ exit(1);
+ }
- // This event will be used to tell the SvcCtrlHandler when the work is
- // done for when a stop comamnd is manually issued.
- gWorkDoneEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
- if (!gWorkDoneEvent) {
- ReportSvcStatus(SERVICE_STOPPED, 1, 0);
- StartTerminationThread();
- return;
- }
+ // These values will be re-used later in calls involving gSvcStatus
+ gSvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
+ gSvcStatus.dwServiceSpecificExitCode = 0;
+
+ // Report initial status to the SCM
+ ReportSvcStatus(SERVICE_START_PENDING, NO_ERROR, 3000);
+
+ // This event will be used to tell the SvcCtrlHandler when the work is
+ // done for when a stop comamnd is manually issued.
+ gWorkDoneEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
+ if (!gWorkDoneEvent)
+ {
+ ReportSvcStatus(SERVICE_STOPPED, 1, 0);
+ StartTerminationThread();
+ return;
+ }
- // Initialization complete and we're about to start working on
- // the actual command. Report the service state as running to the SCM.
- ReportSvcStatus(SERVICE_RUNNING, NO_ERROR, 0);
+ // Initialization complete and we're about to start working on
+ // the actual command. Report the service state as running to the SCM.
+ ReportSvcStatus(SERVICE_RUNNING, NO_ERROR, 0);
- // The service command was executed, stop logging and set an event
- // to indicate the work is done in case someone is waiting on a
- // service stop operation.
- ExecuteServiceCommand(argc, argv);
- LogFinish();
+ // The service command was executed, stop logging and set an event
+ // to indicate the work is done in case someone is waiting on a
+ // service stop operation.
+ ExecuteServiceCommand(argc, argv);
+ LogFinish();
- SetEvent(gWorkDoneEvent);
+ SetEvent(gWorkDoneEvent);
- // If we aren't already in a stopping state then tell the SCM we're stopped
- // now. If we are already in a stopping state then the SERVICE_STOPPED state
- // will be set by the SvcCtrlHandler.
- if (!gServiceControlStopping) {
- ReportSvcStatus(SERVICE_STOPPED, NO_ERROR, 0);
- StartTerminationThread();
- }
+ // If we aren't already in a stopping state then tell the SCM we're stopped
+ // now. If we are already in a stopping state then the SERVICE_STOPPED state
+ // will be set by the SvcCtrlHandler.
+ if (!gServiceControlStopping)
+ {
+ ReportSvcStatus(SERVICE_STOPPED, NO_ERROR, 0);
+ StartTerminationThread();
+ }
}
/**
@@ -312,29 +341,35 @@ ReportSvcStatus(DWORD currentState,
DWORD exitCode,
DWORD waitHint)
{
- static DWORD dwCheckPoint = 1;
-
- gSvcStatus.dwCurrentState = currentState;
- gSvcStatus.dwWin32ExitCode = exitCode;
- gSvcStatus.dwWaitHint = waitHint;
-
- if (SERVICE_START_PENDING == currentState ||
- SERVICE_STOP_PENDING == currentState) {
- gSvcStatus.dwControlsAccepted = 0;
- } else {
- gSvcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP |
- SERVICE_ACCEPT_SHUTDOWN;
- }
-
- if ((SERVICE_RUNNING == currentState) ||
- (SERVICE_STOPPED == currentState)) {
- gSvcStatus.dwCheckPoint = 0;
- } else {
- gSvcStatus.dwCheckPoint = dwCheckPoint++;
- }
-
- // Report the status of the service to the SCM.
- SetServiceStatus(gSvcStatusHandle, &gSvcStatus);
+ static DWORD dwCheckPoint = 1;
+
+ gSvcStatus.dwCurrentState = currentState;
+ gSvcStatus.dwWin32ExitCode = exitCode;
+ gSvcStatus.dwWaitHint = waitHint;
+
+ if (SERVICE_START_PENDING == currentState ||
+ SERVICE_STOP_PENDING == currentState)
+ {
+ gSvcStatus.dwControlsAccepted = 0;
+ }
+ else
+ {
+ gSvcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP |
+ SERVICE_ACCEPT_SHUTDOWN;
+ }
+
+ if ((SERVICE_RUNNING == currentState) ||
+ (SERVICE_STOPPED == currentState))
+ {
+ gSvcStatus.dwCheckPoint = 0;
+ }
+ else
+ {
+ gSvcStatus.dwCheckPoint = dwCheckPoint++;
+ }
+
+ // Report the status of the service to the SCM.
+ SetServiceStatus(gSvcStatusHandle, &gSvcStatus);
}
/**
@@ -344,14 +379,16 @@ ReportSvcStatus(DWORD currentState,
DWORD WINAPI
StopServiceAndWaitForCommandThread(LPVOID)
{
- do {
- ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 1000);
- } while(WaitForSingleObject(gWorkDoneEvent, 100) == WAIT_TIMEOUT);
- CloseHandle(gWorkDoneEvent);
- gWorkDoneEvent = nullptr;
- ReportSvcStatus(SERVICE_STOPPED, NO_ERROR, 0);
- StartTerminationThread();
- return 0;
+ do
+ {
+ ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 1000);
+ }
+ while (WaitForSingleObject(gWorkDoneEvent, 100) == WAIT_TIMEOUT);
+ CloseHandle(gWorkDoneEvent);
+ gWorkDoneEvent = nullptr;
+ ReportSvcStatus(SERVICE_STOPPED, NO_ERROR, 0);
+ StartTerminationThread();
+ return 0;
}
/**
@@ -361,35 +398,41 @@ StopServiceAndWaitForCommandThread(LPVOID)
void WINAPI
SvcCtrlHandler(DWORD dwCtrl)
{
- // After a SERVICE_CONTROL_STOP there should be no more commands sent to
- // the SvcCtrlHandler.
- if (gServiceControlStopping) {
- return;
- }
-
- // Handle the requested control code.
- switch(dwCtrl) {
- case SERVICE_CONTROL_SHUTDOWN:
- case SERVICE_CONTROL_STOP: {
- gServiceControlStopping = true;
- ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 1000);
-
- // The SvcCtrlHandler thread should not spend more than 30 seconds in
- // shutdown so we spawn a new thread for stopping the service
- HANDLE thread = CreateThread(nullptr, 0,
- StopServiceAndWaitForCommandThread,
- nullptr, 0, nullptr);
- if (thread) {
- CloseHandle(thread);
- } else {
- // Couldn't start the thread so just call the stop ourselves.
- // If it happens to take longer than 30 seconds the caller will
- // get an error.
- StopServiceAndWaitForCommandThread(nullptr);
- }
+ // After a SERVICE_CONTROL_STOP there should be no more commands sent to
+ // the SvcCtrlHandler.
+ if (gServiceControlStopping)
+ {
+ return;
+ }
+
+ // Handle the requested control code.
+ switch (dwCtrl)
+ {
+ case SERVICE_CONTROL_SHUTDOWN:
+ case SERVICE_CONTROL_STOP:
+ {
+ gServiceControlStopping = true;
+ ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 1000);
+
+ // The SvcCtrlHandler thread should not spend more than 30 seconds in
+ // shutdown so we spawn a new thread for stopping the service
+ HANDLE thread = CreateThread(nullptr, 0,
+ StopServiceAndWaitForCommandThread,
+ nullptr, 0, nullptr);
+ if (thread)
+ {
+ CloseHandle(thread);
+ }
+ else
+ {
+ // Couldn't start the thread so just call the stop ourselves.
+ // If it happens to take longer than 30 seconds the caller will
+ // get an error.
+ StopServiceAndWaitForCommandThread(nullptr);
+ }
+ }
+ break;
+ default:
+ break;
}
- break;
- default:
- break;
- }
}
diff --git a/onlineupdate/source/service/maintenanceservice.hxx b/onlineupdate/source/service/maintenanceservice.hxx
index 9e02914a0e7b..af5db9e29dae 100644
--- a/onlineupdate/source/service/maintenanceservice.hxx
+++ b/onlineupdate/source/service/maintenanceservice.hxx
@@ -5,6 +5,6 @@
void WINAPI SvcMain(DWORD dwArgc, LPWSTR *lpszArgv);
void SvcInit(DWORD dwArgc, LPWSTR *lpszArgv);
void WINAPI SvcCtrlHandler(DWORD dwCtrl);
-void ReportSvcStatus(DWORD dwCurrentState,
- DWORD dwWin32ExitCode,
+void ReportSvcStatus(DWORD dwCurrentState,
+ DWORD dwWin32ExitCode,
DWORD dwWaitHint);
diff --git a/onlineupdate/source/service/registrycertificates.cxx b/onlineupdate/source/service/registrycertificates.cxx
index f44fb3427d00..ea0905cea888 100644
--- a/onlineupdate/source/service/registrycertificates.cxx
+++ b/onlineupdate/source/service/registrycertificates.cxx
@@ -55,115 +55,127 @@ struct AutoRegKey
BOOL
DoesBinaryMatchAllowedCertificates(LPCWSTR basePathForUpdate, LPCWSTR filePath)
{
- WCHAR maintenanceServiceKey[MAX_PATH + 1];
- if (!CalculateRegistryPathFromFilePath(basePathForUpdate,
- maintenanceServiceKey)) {
- return FALSE;
- }
-
- // We use KEY_WOW64_64KEY to always force 64-bit view.
- // The user may have both x86 and x64 applications installed
- // which each register information. We need a consistent place
- // to put those certificate attributes in and hence why we always
- // force the non redirected registry under Wow6432Node.
- // This flag is ignored on 32bit systems.
- HKEY baseKeyRaw;
- LONG retCode = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
- maintenanceServiceKey, 0,
- KEY_READ | KEY_WOW64_64KEY, &baseKeyRaw);
- if (retCode != ERROR_SUCCESS) {
- LOG_WARN(("Could not open key. (%d)", retCode));
- // Our tests run with a different apply directory for each test.
- // We use this registry key on our test slaves to store the
- // allowed name/issuers.
- retCode = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
- TEST_ONLY_FALLBACK_KEY_PATH, 0,
- KEY_READ | KEY_WOW64_64KEY, &baseKeyRaw);
- if (retCode != ERROR_SUCCESS) {
- LOG_WARN(("Could not open fallback key. (%d)", retCode));
- return FALSE;
- }
- }
- AutoRegKey baseKey(baseKeyRaw);
-
- // Get the number of subkeys.
- DWORD subkeyCount = 0;
- retCode = RegQueryInfoKeyW(baseKey.get(), nullptr, nullptr, nullptr, &subkeyCount,
- nullptr, nullptr, nullptr, nullptr, nullptr,
- nullptr, nullptr);
- if (retCode != ERROR_SUCCESS) {
- LOG_WARN(("Could not query info key. (%d)", retCode));
- return FALSE;
- }
-
- // Enumerate the subkeys, each subkey represents an allowed certificate.
- for (DWORD i = 0; i < subkeyCount; i++) {
- WCHAR subkeyBuffer[MAX_KEY_LENGTH];
- DWORD subkeyBufferCount = MAX_KEY_LENGTH;
- retCode = RegEnumKeyExW(baseKey.get(), i, subkeyBuffer,
- &subkeyBufferCount, nullptr,
- nullptr, nullptr, nullptr);
- if (retCode != ERROR_SUCCESS) {
- LOG_WARN(("Could not enum certs. (%d)", retCode));
- return FALSE;
+ WCHAR maintenanceServiceKey[MAX_PATH + 1];
+ if (!CalculateRegistryPathFromFilePath(basePathForUpdate,
+ maintenanceServiceKey))
+ {
+ return FALSE;
}
- // Open the subkey for the current certificate
- HKEY subKeyRaw;
- retCode = RegOpenKeyExW(baseKey.get(),
- subkeyBuffer,
- 0,
- KEY_READ | KEY_WOW64_64KEY,
- &subKeyRaw);
- AutoRegKey subKey(subKeyRaw);
- if (retCode != ERROR_SUCCESS) {
- LOG_WARN(("Could not open subkey. (%d)", retCode));
- continue; // Try the next subkey
+ // We use KEY_WOW64_64KEY to always force 64-bit view.
+ // The user may have both x86 and x64 applications installed
+ // which each register information. We need a consistent place
+ // to put those certificate attributes in and hence why we always
+ // force the non redirected registry under Wow6432Node.
+ // This flag is ignored on 32bit systems.
+ HKEY baseKeyRaw;
+ LONG retCode = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+ maintenanceServiceKey, 0,
+ KEY_READ | KEY_WOW64_64KEY, &baseKeyRaw);
+ if (retCode != ERROR_SUCCESS)
+ {
+ LOG_WARN(("Could not open key. (%d)", retCode));
+ // Our tests run with a different apply directory for each test.
+ // We use this registry key on our test slaves to store the
+ // allowed name/issuers.
+ retCode = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
+ TEST_ONLY_FALLBACK_KEY_PATH, 0,
+ KEY_READ | KEY_WOW64_64KEY, &baseKeyRaw);
+ if (retCode != ERROR_SUCCESS)
+ {
+ LOG_WARN(("Could not open fallback key. (%d)", retCode));
+ return FALSE;
+ }
}
-
- const int MAX_CHAR_COUNT = 256;
- DWORD valueBufSize = MAX_CHAR_COUNT * sizeof(WCHAR);
- WCHAR name[MAX_CHAR_COUNT] = { L'\0' };
- WCHAR issuer[MAX_CHAR_COUNT] = { L'\0' };
-
- // Get the name from the registry
- retCode = RegQueryValueExW(subKey.get(), L"name", 0, nullptr,
- (LPBYTE)name, &valueBufSize);
- if (retCode != ERROR_SUCCESS) {
- LOG_WARN(("Could not obtain name from registry. (%d)", retCode));
- continue; // Try the next subkey
+ AutoRegKey baseKey(baseKeyRaw);
+
+ // Get the number of subkeys.
+ DWORD subkeyCount = 0;
+ retCode = RegQueryInfoKeyW(baseKey.get(), nullptr, nullptr, nullptr, &subkeyCount,
+ nullptr, nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr);
+ if (retCode != ERROR_SUCCESS)
+ {
+ LOG_WARN(("Could not query info key. (%d)", retCode));
+ return FALSE;
}
- // Get the issuer from the registry
- valueBufSize = MAX_CHAR_COUNT * sizeof(WCHAR);
- retCode = RegQueryValueExW(subKey.get(), L"issuer", 0, nullptr,
- (LPBYTE)issuer, &valueBufSize);
- if (retCode != ERROR_SUCCESS) {
- LOG_WARN(("Could not obtain issuer from registry. (%d)", retCode));
- continue; // Try the next subkey
- }
+ // Enumerate the subkeys, each subkey represents an allowed certificate.
+ for (DWORD i = 0; i < subkeyCount; i++)
+ {
+ WCHAR subkeyBuffer[MAX_KEY_LENGTH];
+ DWORD subkeyBufferCount = MAX_KEY_LENGTH;
+ retCode = RegEnumKeyExW(baseKey.get(), i, subkeyBuffer,
+ &subkeyBufferCount, nullptr,
+ nullptr, nullptr, nullptr);
+ if (retCode != ERROR_SUCCESS)
+ {
+ LOG_WARN(("Could not enum certs. (%d)", retCode));
+ return FALSE;
+ }
- CertificateCheckInfo allowedCertificate = {
- name,
- issuer,
- };
+ // Open the subkey for the current certificate
+ HKEY subKeyRaw;
+ retCode = RegOpenKeyExW(baseKey.get(),
+ subkeyBuffer,
+ 0,
+ KEY_READ | KEY_WOW64_64KEY,
+ &subKeyRaw);
+ AutoRegKey subKey(subKeyRaw);
+ if (retCode != ERROR_SUCCESS)
+ {
+ LOG_WARN(("Could not open subkey. (%d)", retCode));
+ continue; // Try the next subkey
+ }
- retCode = CheckCertificateForPEFile(filePath, allowedCertificate);
- if (retCode != ERROR_SUCCESS) {
- LOG_WARN(("Error on certificate check. (%d)", retCode));
- continue; // Try the next subkey
- }
+ const int MAX_CHAR_COUNT = 256;
+ DWORD valueBufSize = MAX_CHAR_COUNT * sizeof(WCHAR);
+ WCHAR name[MAX_CHAR_COUNT] = { L'\0' };
+ WCHAR issuer[MAX_CHAR_COUNT] = { L'\0' };
- retCode = VerifyCertificateTrustForFile(filePath);
- if (retCode != ERROR_SUCCESS) {
- LOG_WARN(("Error on certificate trust check. (%d)", retCode));
- continue; // Try the next subkey
- }
+ // Get the name from the registry
+ retCode = RegQueryValueExW(subKey.get(), L"name", 0, nullptr,
+ (LPBYTE)name, &valueBufSize);
+ if (retCode != ERROR_SUCCESS)
+ {
+ LOG_WARN(("Could not obtain name from registry. (%d)", retCode));
+ continue; // Try the next subkey
+ }
+
+ // Get the issuer from the registry
+ valueBufSize = MAX_CHAR_COUNT * sizeof(WCHAR);
+ retCode = RegQueryValueExW(subKey.get(), L"issuer", 0, nullptr,
+ (LPBYTE)issuer, &valueBufSize);
+ if (retCode != ERROR_SUCCESS)
+ {
+ LOG_WARN(("Could not obtain issuer from registry. (%d)", retCode));
+ continue; // Try the next subkey
+ }
+
+ CertificateCheckInfo allowedCertificate =
+ {
+ name,
+ issuer,
+ };
- // Raise the roof, we found a match!
- return TRUE;
- }
+ retCode = CheckCertificateForPEFile(filePath, allowedCertificate);
+ if (retCode != ERROR_SUCCESS)
+ {
+ LOG_WARN(("Error on certificate check. (%d)", retCode));
+ continue; // Try the next subkey
+ }
+
+ retCode = VerifyCertificateTrustForFile(filePath);
+ if (retCode != ERROR_SUCCESS)
+ {
+ LOG_WARN(("Error on certificate trust check. (%d)", retCode));
+ continue; // Try the next subkey
+ }
+
+ // Raise the roof, we found a match!
+ return TRUE;
+ }
- // No certificates match, :'(
- return FALSE;
+ // No certificates match, :'(
+ return FALSE;
}
diff --git a/onlineupdate/source/service/resource.hxx b/onlineupdate/source/service/resource.hxx
index 45619457c9aa..f1a1c383665d 100644
--- a/onlineupdate/source/service/resource.hxx
+++ b/onlineupdate/source/service/resource.hxx
@@ -9,7 +9,7 @@
#define IDI_DIALOG 1003
// Next default values for new objects
-//
+//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
diff --git a/onlineupdate/source/service/servicebase.cxx b/onlineupdate/source/service/servicebase.cxx
index 1b4f406f431e..4fb632878cec 100644
--- a/onlineupdate/source/service/servicebase.cxx
+++ b/onlineupdate/source/service/servicebase.cxx
@@ -18,68 +18,80 @@
BOOL
VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL &sameContent)
{
- sameContent = FALSE;
- AutoHandle file1(CreateFileW(file1Path, GENERIC_READ, FILE_SHARE_READ,
+ sameContent = FALSE;
+ AutoHandle file1(CreateFileW(file1Path, GENERIC_READ, FILE_SHARE_READ,
nullptr, OPEN_EXISTING, 0, nullptr));
- if (file1 == INVALID_HANDLE_VALUE) {
- return FALSE;
- }
- AutoHandle file2(CreateFileW(file2Path, GENERIC_READ, FILE_SHARE_READ,
+ if (file1 == INVALID_HANDLE_VALUE)
+ {
+ return FALSE;
+ }
+ AutoHandle file2(CreateFileW(file2Path, GENERIC_READ, FILE_SHARE_READ,
nullptr, OPEN_EXISTING, 0, nullptr));
- if (file2 == INVALID_HANDLE_VALUE) {
- return FALSE;
- }
-
- DWORD fileSize1 = GetFileSize(file1.get(), nullptr);
- DWORD fileSize2 = GetFileSize(file2.get(), nullptr);
- if (INVALID_FILE_SIZE == fileSize1 || INVALID_FILE_SIZE == fileSize2) {
- return FALSE;
- }
-
- if (fileSize1 != fileSize2) {
- // sameContent is already set to FALSE
- return TRUE;
- }
-
- char buf1[COMPARE_BLOCKSIZE];
- char buf2[COMPARE_BLOCKSIZE];
- DWORD numBlocks = fileSize1 / COMPARE_BLOCKSIZE;
- DWORD leftOver = fileSize1 % COMPARE_BLOCKSIZE;
- DWORD readAmount;
- for (DWORD i = 0; i < numBlocks; i++) {
- if (!ReadFile(file1.get(), buf1, COMPARE_BLOCKSIZE, &readAmount, nullptr) ||
- readAmount != COMPARE_BLOCKSIZE) {
- return FALSE;
+ if (file2 == INVALID_HANDLE_VALUE)
+ {
+ return FALSE;
}
- if (!ReadFile(file2.get(), buf2, COMPARE_BLOCKSIZE, &readAmount, nullptr) ||
- readAmount != COMPARE_BLOCKSIZE) {
- return FALSE;
+ DWORD fileSize1 = GetFileSize(file1.get(), nullptr);
+ DWORD fileSize2 = GetFileSize(file2.get(), nullptr);
+ if (INVALID_FILE_SIZE == fileSize1 || INVALID_FILE_SIZE == fileSize2)
+ {
+ return FALSE;
}
- if (memcmp(buf1, buf2, COMPARE_BLOCKSIZE)) {
- // sameContent is already set to FALSE
- return TRUE;
+ if (fileSize1 != fileSize2)
+ {
+ // sameContent is already set to FALSE
+ return TRUE;
}
- }
- if (leftOver) {
- if (!ReadFile(file1.get(), buf1, leftOver, &readAmount, nullptr) ||
- readAmount != leftOver) {
- return FALSE;
- }
+ char buf1[COMPARE_BLOCKSIZE];
+ char buf2[COMPARE_BLOCKSIZE];
+ DWORD numBlocks = fileSize1 / COMPARE_BLOCKSIZE;
+ DWORD leftOver = fileSize1 % COMPARE_BLOCKSIZE;
+ DWORD readAmount;
+ for (DWORD i = 0; i < numBlocks; i++)
+ {
+ if (!ReadFile(file1.get(), buf1, COMPARE_BLOCKSIZE, &readAmount, nullptr) ||
+ readAmount != COMPARE_BLOCKSIZE)
+ {
+ return FALSE;
+ }
+
+ if (!ReadFile(file2.get(), buf2, COMPARE_BLOCKSIZE, &readAmount, nullptr) ||
+ readAmount != COMPARE_BLOCKSIZE)
+ {
+ return FALSE;
+ }
- if (!ReadFile(file2.get(), buf2, leftOver, &readAmount, nullptr) ||
- readAmount != leftOver) {
- return FALSE;
+ if (memcmp(buf1, buf2, COMPARE_BLOCKSIZE))
+ {
+ // sameContent is already set to FALSE
+ return TRUE;
+ }
}
- if (memcmp(buf1, buf2, leftOver)) {
- // sameContent is already set to FALSE
- return TRUE;
+ if (leftOver)
+ {
+ if (!ReadFile(file1.get(), buf1, leftOver, &readAmount, nullptr) ||
+ readAmount != leftOver)
+ {
+ return FALSE;
+ }
+
+ if (!ReadFile(file2.get(), buf2, leftOver, &readAmount, nullptr) ||
+ readAmount != leftOver)
+ {
+ return FALSE;
+ }
+
+ if (memcmp(buf1, buf2, leftOver))
+ {
+ // sameContent is already set to FALSE
+ return TRUE;
+ }
}
- }
- sameContent = TRUE;
- return TRUE;
+ sameContent = TRUE;
+ return TRUE;
}
diff --git a/onlineupdate/source/service/servicebase.hxx b/onlineupdate/source/service/servicebase.hxx
index abf88a122a1d..c47f966ad551 100644
--- a/onlineupdate/source/service/servicebase.hxx
+++ b/onlineupdate/source/service/servicebase.hxx
@@ -14,7 +14,7 @@ BOOL VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL &sameContent);
#define COMPARE_BLOCKSIZE 32768
// The following string resource value is used to uniquely identify the signed
-// Mozilla application as an updater. Before the maintenance service will
+// Mozilla application as an updater. Before the maintenance service will
// execute the updater it must have this updater identity string in its string
// table. No other signed Mozilla product will have this string table value.
#define UPDATER_IDENTITY_STRING \
diff --git a/onlineupdate/source/service/serviceinstall.cxx b/onlineupdate/source/service/serviceinstall.cxx
index cf7fef354186..a225e9445544 100644
--- a/onlineupdate/source/service/serviceinstall.cxx
+++ b/onlineupdate/source/service/serviceinstall.cxx
@@ -73,19 +73,20 @@ static int
ReadMaintenanceServiceStrings(LPCWSTR path,
MaintenanceServiceStringTable *results)
{
- // Read in the maintenance service description string if specified.
- const unsigned int kNumStrings = 1;
- const char *kServiceKeys = "MozillaMaintenanceDescription\0";
- char serviceStrings[kNumStrings][MAX_TEXT_LEN];
- int result = ReadStrings(path, kServiceKeys,
- kNumStrings, serviceStrings);
- if (result != OK) {
- serviceStrings[0][0] = '\0';
- }
- strncpy(results->serviceDescription,
- serviceStrings[0], MAX_TEXT_LEN - 1);
- results->serviceDescription[MAX_TEXT_LEN - 1] = '\0';
- return result;
+ // Read in the maintenance service description string if specified.
+ const unsigned int kNumStrings = 1;
+ const char *kServiceKeys = "MozillaMaintenanceDescription\0";
+ char serviceStrings[kNumStrings][MAX_TEXT_LEN];
+ int result = ReadStrings(path, kServiceKeys,
+ kNumStrings, serviceStrings);
+ if (result != OK)
+ {
+ serviceStrings[0][0] = '\0';
+ }
+ strncpy(results->serviceDescription,
+ serviceStrings[0], MAX_TEXT_LEN - 1);
+ results->serviceDescription[MAX_TEXT_LEN - 1] = '\0';
+ return result;
}
/**
@@ -103,30 +104,32 @@ static BOOL
GetVersionNumberFromPath(LPWSTR path, DWORD &A, DWORD &B,
DWORD &C, DWORD &D)
{
- DWORD fileVersionInfoSize = GetFileVersionInfoSizeW(path, 0);
- std::unique_ptr<char[]> fileVersionInfo(new char[fileVersionInfoSize]);
- if (!GetFileVersionInfoW(path, 0, fileVersionInfoSize,
- fileVersionInfo.get())) {
- LOG_WARN(("Could not obtain file info of old service. (%d)",
- GetLastError()));
- return FALSE;
- }
-
- VS_FIXEDFILEINFO *fixedFileInfo =
- reinterpret_cast<VS_FIXEDFILEINFO *>(fileVersionInfo.get());
- UINT size;
- if (!VerQueryValueW(fileVersionInfo.get(), L"\\",
- reinterpret_cast<LPVOID*>(&fixedFileInfo), &size)) {
- LOG_WARN(("Could not query file version info of old service. (%d)",
- GetLastError()));
- return FALSE;
- }
-
- A = HIWORD(fixedFileInfo->dwFileVersionMS);
- B = LOWORD(fixedFileInfo->dwFileVersionMS);
- C = HIWORD(fixedFileInfo->dwFileVersionLS);
- D = LOWORD(fixedFileInfo->dwFileVersionLS);
- return TRUE;
+ DWORD fileVersionInfoSize = GetFileVersionInfoSizeW(path, 0);
+ std::unique_ptr<char[]> fileVersionInfo(new char[fileVersionInfoSize]);
+ if (!GetFileVersionInfoW(path, 0, fileVersionInfoSize,
+ fileVersionInfo.get()))
+ {
+ LOG_WARN(("Could not obtain file info of old service. (%d)",
+ GetLastError()));
+ return FALSE;
+ }
+
+ VS_FIXEDFILEINFO *fixedFileInfo =
+ reinterpret_cast<VS_FIXEDFILEINFO *>(fileVersionInfo.get());
+ UINT size;
+ if (!VerQueryValueW(fileVersionInfo.get(), L"\\",
+ reinterpret_cast<LPVOID*>(&fixedFileInfo), &size))
+ {
+ LOG_WARN(("Could not query file version info of old service. (%d)",
+ GetLastError()));
+ return FALSE;
+ }
+
+ A = HIWORD(fixedFileInfo->dwFileVersionMS);
+ B = LOWORD(fixedFileInfo->dwFileVersionMS);
+ C = HIWORD(fixedFileInfo->dwFileVersionLS);
+ D = LOWORD(fixedFileInfo->dwFileVersionLS);
+ return TRUE;
}
/**
@@ -140,63 +143,70 @@ GetVersionNumberFromPath(LPWSTR path, DWORD &A, DWORD &B,
BOOL
UpdateServiceDescription(SC_HANDLE serviceHandle)
{
- WCHAR updaterINIPath[MAX_PATH + 1];
- if (!GetModuleFileNameW(nullptr, updaterINIPath,
- sizeof(updaterINIPath) /
- sizeof(updaterINIPath[0]))) {
- LOG_WARN(("Could not obtain module filename when attempting to "
- "modify service description. (%d)", GetLastError()));
- return FALSE;
- }
-
- if (!PathRemoveFileSpecW(updaterINIPath)) {
- LOG_WARN(("Could not remove file spec when attempting to "
- "modify service description. (%d)", GetLastError()));
- return FALSE;
- }
-
- if (!PathAppendSafe(updaterINIPath, L"updater.ini")) {
- LOG_WARN(("Could not append updater.ini filename when attempting to "
- "modify service description. (%d)", GetLastError()));
- return FALSE;
- }
-
- if (GetFileAttributesW(updaterINIPath) == INVALID_FILE_ATTRIBUTES) {
- LOG_WARN(("updater.ini file does not exist, will not modify "
- "service description. (%d)", GetLastError()));
- return FALSE;
- }
-
- MaintenanceServiceStringTable serviceStrings;
- int rv = ReadMaintenanceServiceStrings(updaterINIPath, &serviceStrings);
- if (rv != OK || !strlen(serviceStrings.serviceDescription)) {
- LOG_WARN(("updater.ini file does not contain a maintenance "
- "service description."));
- return FALSE;
- }
-
- WCHAR serviceDescription[MAX_TEXT_LEN];
- if (!MultiByteToWideChar(CP_UTF8, 0,
- serviceStrings.serviceDescription, -1,
- serviceDescription,
- sizeof(serviceDescription) /
- sizeof(serviceDescription[0]))) {
- LOG_WARN(("Could not convert description to wide string format. (%d)",
- GetLastError()));
- return FALSE;
- }
-
- SERVICE_DESCRIPTIONW descriptionConfig;
- descriptionConfig.lpDescription = serviceDescription;
- if (!ChangeServiceConfig2W(serviceHandle,
- SERVICE_CONFIG_DESCRIPTION,
- &descriptionConfig)) {
- LOG_WARN(("Could not change service config. (%d)", GetLastError()));
- return FALSE;
- }
-
- LOG(("The service description was updated successfully."));
- return TRUE;
+ WCHAR updaterINIPath[MAX_PATH + 1];
+ if (!GetModuleFileNameW(nullptr, updaterINIPath,
+ sizeof(updaterINIPath) /
+ sizeof(updaterINIPath[0])))
+ {
+ LOG_WARN(("Could not obtain module filename when attempting to "
+ "modify service description. (%d)", GetLastError()));
+ return FALSE;
+ }
+
+ if (!PathRemoveFileSpecW(updaterINIPath))
+ {
+ LOG_WARN(("Could not remove file spec when attempting to "
+ "modify service description. (%d)", GetLastError()));
+ return FALSE;
+ }
+
+ if (!PathAppendSafe(updaterINIPath, L"updater.ini"))
+ {
+ LOG_WARN(("Could not append updater.ini filename when attempting to "
+ "modify service description. (%d)", GetLastError()));
+ return FALSE;
+ }
+
+ if (GetFileAttributesW(updaterINIPath) == INVALID_FILE_ATTRIBUTES)
+ {
+ LOG_WARN(("updater.ini file does not exist, will not modify "
+ "service description. (%d)", GetLastError()));
+ return FALSE;
+ }
+
+ MaintenanceServiceStringTable serviceStrings;
+ int rv = ReadMaintenanceServiceStrings(updaterINIPath, &serviceStrings);
+ if (rv != OK || !strlen(serviceStrings.serviceDescription))
+ {
+ LOG_WARN(("updater.ini file does not contain a maintenance "
+ "service description."));
+ return FALSE;
+ }
+
+ WCHAR serviceDescription[MAX_TEXT_LEN];
+ if (!MultiByteToWideChar(CP_UTF8, 0,
+ serviceStrings.serviceDescription, -1,
+ serviceDescription,
+ sizeof(serviceDescription) /
+ sizeof(serviceDescription[0])))
+ {
+ LOG_WARN(("Could not convert description to wide string format. (%d)",
+ GetLastError()));
+ return FALSE;
+ }
+
+ SERVICE_DESCRIPTIONW descriptionConfig;
+ descriptionConfig.lpDescription = serviceDescription;
+ if (!ChangeServiceConfig2W(serviceHandle,
+ SERVICE_CONFIG_DESCRIPTION,
+ &descriptionConfig))
+ {
+ LOG_WARN(("Could not change service config. (%d)", GetLastError()));
+ return FALSE;
+ }
+
+ LOG(("The service description was updated successfully."));
+ return TRUE;
}
/**
@@ -213,54 +223,58 @@ FixServicePath(SC_HANDLE service,
LPCWSTR currentServicePath,
BOOL &servicePathWasWrong)
{
- // When we originally upgraded the MozillaMaintenance service we
- // would uninstall the service on each upgrade. This had an
- // intermittent error which could cause the service to use the file
- // maintenanceservice_tmp.exe as the install path. Only a small number
- // of Nightly users would be affected by this, but we check for this
- // state here and fix the user if they are affected.
- //
- // We also fix the path in the case of the path not being quoted.
- size_t currentServicePathLen = wcslen(currentServicePath);
- bool doesServiceHaveCorrectPath =
- currentServicePathLen > 2 &&
- !wcsstr(currentServicePath, L"maintenanceservice_tmp.exe") &&
- currentServicePath[0] == L'\"' &&
- currentServicePath[currentServicePathLen - 1] == L'\"';
-
- if (doesServiceHaveCorrectPath) {
- LOG(("The MozillaMaintenance service path is correct."));
- servicePathWasWrong = FALSE;
+ // When we originally upgraded the MozillaMaintenance service we
+ // would uninstall the service on each upgrade. This had an
+ // intermittent error which could cause the service to use the file
+ // maintenanceservice_tmp.exe as the install path. Only a small number
+ // of Nightly users would be affected by this, but we check for this
+ // state here and fix the user if they are affected.
+ //
+ // We also fix the path in the case of the path not being quoted.
+ size_t currentServicePathLen = wcslen(currentServicePath);
+ bool doesServiceHaveCorrectPath =
+ currentServicePathLen > 2 &&
+ !wcsstr(currentServicePath, L"maintenanceservice_tmp.exe") &&
+ currentServicePath[0] == L'\"' &&
+ currentServicePath[currentServicePathLen - 1] == L'\"';
+
+ if (doesServiceHaveCorrectPath)
+ {
+ LOG(("The MozillaMaintenance service path is correct."));
+ servicePathWasWrong = FALSE;
+ return TRUE;
+ }
+ // This is a recoverable situation so not logging as a warning
+ LOG(("The MozillaMaintenance path is NOT correct. It was: %ls",
+ currentServicePath));
+
+ servicePathWasWrong = TRUE;
+ WCHAR fixedPath[MAX_PATH + 1] = { L'\0' };
+ wcsncpy(fixedPath, currentServicePath, MAX_PATH);
+ PathUnquoteSpacesW(fixedPath);
+ if (!PathRemoveFileSpecW(fixedPath))
+ {
+ LOG_WARN(("Couldn't remove file spec. (%d)", GetLastError()));
+ return FALSE;
+ }
+ if (!PathAppendSafe(fixedPath, L"maintenanceservice.exe"))
+ {
+ LOG_WARN(("Couldn't append file spec. (%d)", GetLastError()));
+ return FALSE;
+ }
+ PathQuoteSpacesW(fixedPath);
+
+
+ if (!ChangeServiceConfigW(service, SERVICE_NO_CHANGE, SERVICE_NO_CHANGE,
+ SERVICE_NO_CHANGE, fixedPath, nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr))
+ {
+ LOG_WARN(("Could not fix service path. (%d)", GetLastError()));
+ return FALSE;
+ }
+
+ LOG(("Fixed service path to: %ls.", fixedPath));
return TRUE;
- }
- // This is a recoverable situation so not logging as a warning
- LOG(("The MozillaMaintenance path is NOT correct. It was: %ls",
- currentServicePath));
-
- servicePathWasWrong = TRUE;
- WCHAR fixedPath[MAX_PATH + 1] = { L'\0' };
- wcsncpy(fixedPath, currentServicePath, MAX_PATH);
- PathUnquoteSpacesW(fixedPath);
- if (!PathRemoveFileSpecW(fixedPath)) {
- LOG_WARN(("Couldn't remove file spec. (%d)", GetLastError()));
- return FALSE;
- }
- if (!PathAppendSafe(fixedPath, L"maintenanceservice.exe")) {
- LOG_WARN(("Couldn't append file spec. (%d)", GetLastError()));
- return FALSE;
- }
- PathQuoteSpacesW(fixedPath);
-
-
- if (!ChangeServiceConfigW(service, SERVICE_NO_CHANGE, SERVICE_NO_CHANGE,
- SERVICE_NO_CHANGE, fixedPath, nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr)) {
- LOG_WARN(("Could not fix service path. (%d)", GetLastError()));
- return FALSE;
- }
-
- LOG(("Fixed service path to: %ls.", fixedPath));
- return TRUE;
}
/**
@@ -274,263 +288,299 @@ FixServicePath(SC_HANDLE service,
BOOL
SvcInstall(SvcInstallAction action)
{
- // Get a handle to the local computer SCM database with full access rights.
- AutoServiceHandle schSCManager(OpenSCManager(nullptr, nullptr,
- SC_MANAGER_ALL_ACCESS));
- if (!schSCManager) {
- LOG_WARN(("Could not open service manager. (%d)", GetLastError()));
- return FALSE;
- }
-
- WCHAR newServiceBinaryPath[MAX_PATH + 1];
- if (!GetModuleFileNameW(nullptr, newServiceBinaryPath,
- sizeof(newServiceBinaryPath) /
- sizeof(newServiceBinaryPath[0]))) {
- LOG_WARN(("Could not obtain module filename when attempting to "
- "install service. (%d)",
- GetLastError()));
- return FALSE;
- }
-
- // Check if we already have the service installed.
- AutoServiceHandle schService(OpenServiceW(schSCManager.get(),
- SVC_NAME,
- SERVICE_ALL_ACCESS));
- DWORD lastError = GetLastError();
- if (!schService && ERROR_SERVICE_DOES_NOT_EXIST != lastError) {
- // The service exists but we couldn't open it
- LOG_WARN(("Could not open service. (%d)", GetLastError()));
- return FALSE;
- }
-
- if (schService) {
- // The service exists but it may not have the correct permissions.
- // This could happen if the permissions were not set correctly originally
- // or have been changed after the installation. This will reset the
- // permissions back to allow limited user accounts.
- if (!SetUserAccessServiceDACL(schService.get())) {
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list