diff --git a/ChangeLog b/ChangeLog index ad5a6c32..7b946296 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24260,3 +24260,8 @@ 2023-06-23 Fred Gleason * Updated the 'INSTALL' file to cover use of the 'configure_build.sh' script. +2023-06-29 Fred Gleason + * Added a 'RDCoreApplication::isUniqueProcess()' static method. + * Added processuniqueness checks to caed(8), rdairplay(1), + rdrepld(8), rdrssd(8), rdservice(8), rdvairplayd(8), ripcd(8) and + rdalsaconfig(8). diff --git a/cae/cae.cpp b/cae/cae.cpp index 7899b0a7..32d0364b 100644 --- a/cae/cae.cpp +++ b/cae/cae.cpp @@ -2,7 +2,7 @@ // // The Core Audio Engine component of Rivendell // -// (C) Copyright 2002-2021 Fred Gleason +// (C) Copyright 2002-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -93,7 +93,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("caed","caed", CAED_USAGE,false,this)); - if(!rda->open(&err_msg,&err_type,false)) { + if(!rda->open(&err_msg,&err_type,false,true)) { fprintf(stderr,"caed: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/importers/nexgen_filter.cpp b/importers/nexgen_filter.cpp index ffa4c74a..6d5ac9f5 100644 --- a/importers/nexgen_filter.cpp +++ b/importers/nexgen_filter.cpp @@ -64,7 +64,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("nexgen_filter", "nexgen_filter",NEXGEN_FILTER_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,false)) { + if(!rda->open(&err_msg,NULL,false,false)) { fprintf(stderr,"nexgen_filter: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/importers/wings_filter.cpp b/importers/wings_filter.cpp index e24a1ff0..4169d7b0 100644 --- a/importers/wings_filter.cpp +++ b/importers/wings_filter.cpp @@ -52,7 +52,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("wings_filter", "wings_filter",WINGS_FILTER_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,false)) { + if(!rda->open(&err_msg,NULL,false,false)) { fprintf(stderr,"wings_filter: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/lib/rdcoreapplication.cpp b/lib/rdcoreapplication.cpp index 56c992f8..7b67396c 100644 --- a/lib/rdcoreapplication.cpp +++ b/lib/rdcoreapplication.cpp @@ -1,4 +1,4 @@ -// rdapplication.cpp +// rdcoreapplication.cpp // // Base Application Class // @@ -22,6 +22,9 @@ #include #include +#include +#include +#include #include #include #include @@ -132,8 +135,8 @@ RDCoreApplication::~RDCoreApplication() } -bool RDCoreApplication::open(QString *err_msg,RDCoreApplication::ErrorType *err_type, - bool check_svc) +bool RDCoreApplication::open(QString *err_msg,ErrorType *err_type, + bool check_svc,bool check_unique) { int schema=0; QString db_err; @@ -177,6 +180,17 @@ bool RDCoreApplication::open(QString *err_msg,RDCoreApplication::ErrorType *err_ } } + // + // Process Uniqueness Check + // + if(check_unique) { + if(!isUniqueProcess(app_command_name)) { + fprintf(stderr,"%s: prior instance found\n", + app_command_name.toUtf8().constData()); + exit(RDApplication::ExitPriorInstance); + } + } + // // Open rd.conf(5) // @@ -638,6 +652,32 @@ QString RDCoreApplication::exitCodeText(RDCoreApplication::ExitCode code) } +bool RDCoreApplication::isUniqueProcess(const QString &cmdname) +{ + bool ok=false; + QStringList dirs= + QDir("/proc").entryList(QDir::Dirs|QDir::NoDotAndDotDot); + + for(int i=0;iopen(QIODevice::ReadOnly)) { + QString cmdline(QString::fromUtf8(file->readAll())); + QStringList f0=cmdline.trimmed().split("/",QString::SkipEmptyParts); + if((f0.size()>0)&&(f0.last().trimmed()==cmdname)) { + delete file; + return false; + } + } + delete file; + } + } + + return true; +} + + void RDCoreApplication::userChangedData() { QString sql; diff --git a/lib/rdcoreapplication.h b/lib/rdcoreapplication.h index 26ddab91..ee4ebfd6 100644 --- a/lib/rdcoreapplication.h +++ b/lib/rdcoreapplication.h @@ -2,7 +2,7 @@ // // Base Application Class // -// (C) Copyright 2018-2022 Fred Gleason +// (C) Copyright 2018-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -58,7 +58,8 @@ class RDCoreApplication : public QObject RDCoreApplication(const QString &module_name,const QString &cmdname, const QString &usage,bool use_translations,QObject *parent); ~RDCoreApplication(); - bool open(QString *err_msg,ErrorType *err_type,bool check_svc); + bool open(QString *err_msg,ErrorType *err_type, + bool check_svc,bool check_unique); RDAirPlayConf *airplayConf(); RDCae *cae(); RDCmdSwitch *cmdSwitch(); @@ -89,6 +90,7 @@ class RDCoreApplication : public QObject const QString &login_name=QString()); static void syslog(RDConfig *config,int priority,const char *fmt,...); static QString exitCodeText(ExitCode code); + static bool isUniqueProcess(const QString &cmdname); private slots: void userChangedData(); diff --git a/rdadmin/rdadmin.cpp b/rdadmin/rdadmin.cpp index 83f519dc..21dde49a 100644 --- a/rdadmin/rdadmin.cpp +++ b/rdadmin/rdadmin.cpp @@ -84,7 +84,7 @@ MainWidget::MainWidget(RDConfig *config,RDWidget *parent) // Open the Database // rda=new RDApplication("RDAdmin","rdadmin",RDADMIN_USAGE,true,this); - if(!rda->open(&err_msg,&err_type,false)) { + if(!rda->open(&err_msg,&err_type,false,false)) { if(err_type!=RDApplication::ErrorNoHostEntry) { QMessageBox::critical(this,"RDAdmin - "+tr("Error"),err_msg); exit(RDCoreApplication::ExitNoDb); diff --git a/rdairplay/rdairplay.cpp b/rdairplay/rdairplay.cpp index 6d966628..c1ade027 100644 --- a/rdairplay/rdairplay.cpp +++ b/rdairplay/rdairplay.cpp @@ -74,7 +74,7 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent) // Open the Database // rda=new RDApplication("RDAirPlay","rdairplay",RDAIRPLAY_USAGE,true,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,true)) { QMessageBox::critical(this,"RDAirPlay - "+tr("Error"),err_msg); exit(1); } diff --git a/rdcartslots/rdcartslots.cpp b/rdcartslots/rdcartslots.cpp index 39e9ccfb..bd80b548 100644 --- a/rdcartslots/rdcartslots.cpp +++ b/rdcartslots/rdcartslots.cpp @@ -35,7 +35,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // Open the Database // rda=new RDApplication("RDCartSlots","rdcartslots",RDCARTSLOTS_USAGE,true,this); - if(!rda->open(&err_msg,NULL,false)) { + if(!rda->open(&err_msg,NULL,false,false)) { QMessageBox::critical(this,"RDCartSlots - "+tr("Error"),err_msg); exit(1); } diff --git a/rdcastmanager/rdcastmanager.cpp b/rdcastmanager/rdcastmanager.cpp index 8e0233da..7a3e5e1d 100644 --- a/rdcastmanager/rdcastmanager.cpp +++ b/rdcastmanager/rdcastmanager.cpp @@ -59,7 +59,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // rda=new RDApplication("RDCastManager","rdcastmanager",RDCASTMANAGER_USAGE,true, this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"RDCastManager - "+tr("Error"),err_msg); exit(1); } diff --git a/rdcatch/rdcatch.cpp b/rdcatch/rdcatch.cpp index edad388c..59fb3784 100644 --- a/rdcatch/rdcatch.cpp +++ b/rdcatch/rdcatch.cpp @@ -67,7 +67,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // Open the Database // rda=new RDApplication("RDCatch","rdcatch",RDCATCH_USAGE,true,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"RDCatch - "+tr("Error"),err_msg); exit(1); } diff --git a/rdcatchd/rdcatchd.cpp b/rdcatchd/rdcatchd.cpp index e826ce48..7bb5da9c 100644 --- a/rdcatchd/rdcatchd.cpp +++ b/rdcatchd/rdcatchd.cpp @@ -91,7 +91,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdcatchd","rdcatchd", RDCATCHD_USAGE,false,this)); - if(!rda->open(&err_msg,&err_type,false)) { + if(!rda->open(&err_msg,&err_type,false,false)) { fprintf(stderr,"rdcatchd: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/rdlibrary/rdlibrary.cpp b/rdlibrary/rdlibrary.cpp index 6beeb53b..d8578955 100644 --- a/rdlibrary/rdlibrary.cpp +++ b/rdlibrary/rdlibrary.cpp @@ -87,7 +87,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // Open the Database // rda=new RDApplication("RDLibrary","rdlibrary",RDLIBRARY_USAGE,true,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"RDLibrary - "+tr("Error"),err_msg); exit(1); } diff --git a/rdlogedit/rdlogedit.cpp b/rdlogedit/rdlogedit.cpp index 1f44869a..821d4f8d 100644 --- a/rdlogedit/rdlogedit.cpp +++ b/rdlogedit/rdlogedit.cpp @@ -61,7 +61,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // Open the Database // rda=new RDApplication("RDLogEdit","rdlogedit",RDLOGEDIT_USAGE,true,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"RDLogEdit - "+tr("Error"),err_msg); exit(1); } diff --git a/rdlogin/rdlogin.cpp b/rdlogin/rdlogin.cpp index 96254644..cda59b3f 100644 --- a/rdlogin/rdlogin.cpp +++ b/rdlogin/rdlogin.cpp @@ -48,7 +48,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // Open the database // rda=new RDApplication("RDLogin","rdlogin",RDLOGIN_USAGE,true,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"RDLogin - "+tr("Error"),err_msg); exit(1); } diff --git a/rdlogmanager/commandline_ops.cpp b/rdlogmanager/commandline_ops.cpp index ca145140..37ef9366 100644 --- a/rdlogmanager/commandline_ops.cpp +++ b/rdlogmanager/commandline_ops.cpp @@ -2,7 +2,7 @@ // // Command Line Operations for RDLogManager // -// (C) Copyright 2012-2022 Fred Gleason +// (C) Copyright 2012-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -47,7 +47,7 @@ int RunReportOperation(int argc,char *argv[],const QString &rptname, rda=static_cast(new RDCoreApplication("RDLogManager", "rdlogmanager",RDLOGMANAGER_USAGE,true,NULL)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"rdlogmanager: %s\n",err_msg.toUtf8().constData()); exit(RDApplication::ExitNoDb); } diff --git a/rdlogmanager/logobject.cpp b/rdlogmanager/logobject.cpp index a89d2c44..30c9834d 100644 --- a/rdlogmanager/logobject.cpp +++ b/rdlogmanager/logobject.cpp @@ -2,7 +2,7 @@ // // Generate/merge logs from the command line. // -// (C) Copyright 2018-2022 Fred Gleason +// (C) Copyright 2018-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -46,7 +46,7 @@ LogObject::LogObject(const QString &svcname,int start_offset, // rda=static_cast(new RDCoreApplication("RDLogManager", "rdlogmanager","",true,NULL)); - if(!rda->open(&err_msg,NULL,false)) { + if(!rda->open(&err_msg,NULL,false,false)) { fprintf(stderr,"rdlogmanager: %s\n",err_msg.toUtf8().constData()); exit(RDApplication::ExitNoDb); } diff --git a/rdlogmanager/rdlogmanager.cpp b/rdlogmanager/rdlogmanager.cpp index 37fa91af..b0c86036 100644 --- a/rdlogmanager/rdlogmanager.cpp +++ b/rdlogmanager/rdlogmanager.cpp @@ -54,7 +54,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // rda=new RDApplication("RDLogManager","rdlogmanager",RDLOGMANAGER_USAGE,true, this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"RDLogManager - "+tr("Error"),err_msg); exit(RDApplication::ExitNoDb); } diff --git a/rdpadengined/rdpadengined.cpp b/rdpadengined/rdpadengined.cpp index ca089d3e..04c3d2c5 100644 --- a/rdpadengined/rdpadengined.cpp +++ b/rdpadengined/rdpadengined.cpp @@ -2,7 +2,7 @@ // // Rivendell PAD Consolidation Server // -// (C) Copyright 2018-2021 Fred Gleason +// (C) Copyright 2018-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -56,7 +56,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdpadengined", "rdpadengined",RDPADENGINED_USAGE,false,this)); - if(!rda->open(&err_msg,&err_type,false)) { + if(!rda->open(&err_msg,&err_type,false,true)) { fprintf(stderr,"rdpadengined: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/rdpanel/rdpanel.cpp b/rdpanel/rdpanel.cpp index 1bf03a17..557828c9 100644 --- a/rdpanel/rdpanel.cpp +++ b/rdpanel/rdpanel.cpp @@ -54,7 +54,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // Open the Database // rda=new RDApplication("RDPanel","rdpanel",RDPANEL_USAGE,true,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"RDPanel - "+tr("Error"),err_msg); exit(1); } diff --git a/rdrepld/rdrepld.cpp b/rdrepld/rdrepld.cpp index 473e040f..58fffc5b 100644 --- a/rdrepld/rdrepld.cpp +++ b/rdrepld/rdrepld.cpp @@ -73,7 +73,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdrepld","rdrepld", RDREPLD_USAGE,false,this)); - if(!rda->open(&err_msg,&err_type,false)) { + if(!rda->open(&err_msg,&err_type,false,true)) { fprintf(stderr,"rdrepld: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/rdrssd/rdrssd.cpp b/rdrssd/rdrssd.cpp index c1d8e554..a43ee350 100644 --- a/rdrssd/rdrssd.cpp +++ b/rdrssd/rdrssd.cpp @@ -41,7 +41,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdrssd","rdrssd", RDRSSD_USAGE,false,this)); - if(!rda->open(&err_msg,&err_type,false)) { + if(!rda->open(&err_msg,&err_type,false,true)) { fprintf(stderr,"rdrssd: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/rdservice/rdservice.cpp b/rdservice/rdservice.cpp index ea4db051..7cf1120d 100644 --- a/rdservice/rdservice.cpp +++ b/rdservice/rdservice.cpp @@ -2,7 +2,7 @@ // // Rivendell Services Manager // -// (C) Copyright 2018-2021 Fred Gleason +// (C) Copyright 2018-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -68,7 +68,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdservice","rdservice", "\n\n",false,this)); - if(!rda->open(&err_msg,&err_type,false)) { + if(!rda->open(&err_msg,&err_type,false,true)) { rda->syslog(LOG_ERR,"unable to open database [%s]", err_msg.toUtf8().constData()); exit(RDApplication::ExitNoDb); diff --git a/rdvairplayd/rdvairplayd.cpp b/rdvairplayd/rdvairplayd.cpp index fd80cd33..afcd1963 100644 --- a/rdvairplayd/rdvairplayd.cpp +++ b/rdvairplayd/rdvairplayd.cpp @@ -68,7 +68,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdvairplayd", "rdvairplayd",RDVAIRPLAYD_USAGE,false,this)); - if(!rda->open(&err_msg,&err_type,false)) { + if(!rda->open(&err_msg,&err_type,false,true)) { fprintf(stderr,"rdvairplayd: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/ripcd/ripcd.cpp b/ripcd/ripcd.cpp index c52272fd..f090c5b0 100644 --- a/ripcd/ripcd.cpp +++ b/ripcd/ripcd.cpp @@ -2,7 +2,7 @@ // // Rivendell Interprocess Communication Daemon // -// (C) Copyright 2002-2021 Fred Gleason +// (C) Copyright 2002-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -73,7 +73,7 @@ MainObject::MainObject(QObject *parent) rda=static_cast(new RDCoreApplication("ripcd","ripcd", RIPCD_USAGE,false,this)); - if(!rda->open(&err_msg,&err_type,false)) { + if(!rda->open(&err_msg,&err_type,false,true)) { fprintf(stderr,"ripcd: %s\n",(const char *)err_msg.toUtf8()); exit(1); } diff --git a/tests/audio_convert_test.cpp b/tests/audio_convert_test.cpp index ddb0c5af..00d50754 100644 --- a/tests/audio_convert_test.cpp +++ b/tests/audio_convert_test.cpp @@ -2,7 +2,7 @@ // // Test the Rivendell file format converter. // -// (C) Copyright 2010-2022 Fred Gleason +// (C) Copyright 2010-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -44,7 +44,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("audio_convert_test", "audio_convert_test",AUDIO_CONVERT_TEST_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"audio_convert_test: %s\n",(const char *)err_msg.toUtf8()); exit(1); } diff --git a/tests/audio_export_test.cpp b/tests/audio_export_test.cpp index d24dc456..9cd035dc 100644 --- a/tests/audio_export_test.cpp +++ b/tests/audio_export_test.cpp @@ -2,7 +2,7 @@ // // Test the Rivendell file format exporter. // -// (C) Copyright 2010-2022 Fred Gleason +// (C) Copyright 2010-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -46,7 +46,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("audio_export_test", "audio_export_test",AUDIO_EXPORT_TEST_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"audio_export_test: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/tests/audio_import_test.cpp b/tests/audio_import_test.cpp index 6e7bfdf6..9f450ff5 100644 --- a/tests/audio_import_test.cpp +++ b/tests/audio_import_test.cpp @@ -2,7 +2,7 @@ // // Test Rivendell file importing. // -// (C) Copyright 2010-2022 Fred Gleason +// (C) Copyright 2010-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -47,7 +47,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("audio_import_test", "audio_import_test",AUDIO_IMPORT_TEST_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"audio_import_test: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/tests/audio_metadata_test.cpp b/tests/audio_metadata_test.cpp index 7e49cd36..ef6ec63b 100644 --- a/tests/audio_metadata_test.cpp +++ b/tests/audio_metadata_test.cpp @@ -2,7 +2,7 @@ // // Test the Rivendell audio file metadata reader. // -// (C) Copyright 2018-2022 Fred Gleason +// (C) Copyright 2018-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -37,7 +37,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("audio_metadata_test", "audio_metadata_test",AUDIO_METADATA_TEST_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"audio_metadata_test: %s\n",(const char *)err_msg.toUtf8()); exit(1); } diff --git a/tests/db_charset_test.cpp b/tests/db_charset_test.cpp index aabae649..7c9260c3 100644 --- a/tests/db_charset_test.cpp +++ b/tests/db_charset_test.cpp @@ -2,7 +2,7 @@ // // Display charset/collation parameters for a DB connection // -// (C) Copyright 2018-2022 Fred Gleason +// (C) Copyright 2018-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -44,7 +44,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDApplication("db_charset_test", "rdvairplayd",DB_CHARSET_TEST_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"db_charset_test: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/tests/delete_test.cpp b/tests/delete_test.cpp index bb50dc28..fdaa4d35 100644 --- a/tests/delete_test.cpp +++ b/tests/delete_test.cpp @@ -2,7 +2,7 @@ // // Test Rivendell file deletion routines. // -// (C) Copyright 2010-2021 Fred Gleason +// (C) Copyright 2010-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -41,7 +41,7 @@ MainObject::MainObject(QObject *parent) // rda=new RDApplication("delete_test","delete_test",DELETE_TEST_USAGE,false, this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"delete_test: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/tests/download_test.cpp b/tests/download_test.cpp index f739c52b..70080d25 100644 --- a/tests/download_test.cpp +++ b/tests/download_test.cpp @@ -43,7 +43,7 @@ MainObject::MainObject(QObject *parent) // rda=new RDApplication("download_test","download_test",DOWNLOAD_TEST_USAGE, false,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"download_test: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/tests/feed_image_test.cpp b/tests/feed_image_test.cpp index 9ba21c88..da851018 100644 --- a/tests/feed_image_test.cpp +++ b/tests/feed_image_test.cpp @@ -2,7 +2,7 @@ // // Test Rivendell image storage // -// (C) Copyright 2010-2022 Fred Gleason +// (C) Copyright 2010-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -47,7 +47,7 @@ MainObject::MainObject(QObject *parent) // rda=new RDApplication("feed_image_test","feed_image_test", FEED_IMAGE_TEST_USAGE,false,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"feed_image_test: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/tests/metadata_wildcard_test.cpp b/tests/metadata_wildcard_test.cpp index 494215fb..d06a05fa 100644 --- a/tests/metadata_wildcard_test.cpp +++ b/tests/metadata_wildcard_test.cpp @@ -41,7 +41,7 @@ MainObject::MainObject(QObject *parent) // rda=new RDApplication("metadata_wildcard_test","metadata_wildcard_test", METADATA_WILDCARD_TEST_USAGE,false,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"metadata_wildcard_test: %s\n",(const char *)err_msg.toUtf8()); exit(1); } diff --git a/tests/meterstrip_test.cpp b/tests/meterstrip_test.cpp index 642ebcfe..63060ad8 100644 --- a/tests/meterstrip_test.cpp +++ b/tests/meterstrip_test.cpp @@ -36,7 +36,7 @@ MainWidget::MainWidget(QWidget *parent) // rda=new RDApplication("meterstrip_test","meterstrip_test",METERSTRIP_TEST_USAGE, false,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"meterstrip_test - "+tr("Error"),err_msg); exit(RDApplication::ExitNoDb); } diff --git a/tests/notification_test.cpp b/tests/notification_test.cpp index 302752a2..1fd97ec1 100644 --- a/tests/notification_test.cpp +++ b/tests/notification_test.cpp @@ -2,7 +2,7 @@ // // Test Rivendell RDNotification class. // -// (C) Copyright 2019-2022 Fred Gleason +// (C) Copyright 2019-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -31,7 +31,7 @@ MainObject::MainObject(QObject *parent) rda=new RDApplication("notification_test","notification_test", NOTIFICATION_TEST_USAGE,false,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"notification_test: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/tests/timeengine_test.cpp b/tests/timeengine_test.cpp index fdabce21..72df2351 100644 --- a/tests/timeengine_test.cpp +++ b/tests/timeengine_test.cpp @@ -2,7 +2,7 @@ // // Test the RDTimeEngine class // -// (C) Copyright 2021 Fred Gleason +// (C) Copyright 2021-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -42,7 +42,7 @@ MainObject::MainObject(QObject *parent) "timeengine_test", TIMEENGINE_TEST_USAGE, false,this)); - if(!rda->open(&err_msg,&err_type,false)) { + if(!rda->open(&err_msg,&err_type,false,false)) { fprintf(stderr,"timeengine_test: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/tests/upload_test.cpp b/tests/upload_test.cpp index 3b7c1c8d..bc170e4a 100644 --- a/tests/upload_test.cpp +++ b/tests/upload_test.cpp @@ -43,7 +43,7 @@ MainObject::MainObject(QObject *parent) // rda=new RDApplication("upload_test","upload_test",UPLOAD_TEST_USAGE,false, this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"upload_test: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/tests/wavefactory_test.cpp b/tests/wavefactory_test.cpp index a85f2dcd..b4b2aadd 100644 --- a/tests/wavefactory_test.cpp +++ b/tests/wavefactory_test.cpp @@ -44,7 +44,7 @@ MainWidget::MainWidget(QWidget *parent) // rda=new RDApplication("wavefactory_test","wavefactory_test", WAVEFACTORY_TEST_USAGE,false,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"wavefactory_test - "+tr("Error"),err_msg); exit(RDApplication::ExitNoDb); } diff --git a/tests/wavescene_test.cpp b/tests/wavescene_test.cpp index d899af6c..0a784a80 100644 --- a/tests/wavescene_test.cpp +++ b/tests/wavescene_test.cpp @@ -2,7 +2,7 @@ // // Test harness for RDWaveScene // -// (C) Copyright 2022 Fred Gleason +// (C) Copyright 2022-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -43,7 +43,7 @@ MainWidget::MainWidget(QWidget *parent) // rda=new RDApplication("wavescene_test","wavescene_test",WAVESCENE_TEST_USAGE, false,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"wavescene_test - "+tr("Error"),err_msg); exit(RDApplication::ExitNoDb); } diff --git a/tests/wavewidget_test.cpp b/tests/wavewidget_test.cpp index 0201fc0b..47e07e41 100644 --- a/tests/wavewidget_test.cpp +++ b/tests/wavewidget_test.cpp @@ -2,7 +2,7 @@ // // Test harness for RDWaveWidget // -// (C) Copyright 2021-2022 Fred Gleason +// (C) Copyright 2021-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -42,7 +42,7 @@ MainWidget::MainWidget(QWidget *parent) // rda=new RDApplication("wavewidget_test","wavewidget_test",WAVEWIDGET_TEST_USAGE, false,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"wavewidget_test - "+tr("Error"),err_msg); exit(RDApplication::ExitNoDb); } diff --git a/utils/rdalsaconfig/rdalsaconfig.cpp b/utils/rdalsaconfig/rdalsaconfig.cpp index 3420ab8b..a0339424 100644 --- a/utils/rdalsaconfig/rdalsaconfig.cpp +++ b/utils/rdalsaconfig/rdalsaconfig.cpp @@ -84,7 +84,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // rda=new RDApplication("RDAlsaConfig","rdalsaconfig",RDALSACONFIG_USAGE,false, this); - if(!rda->open(&err_msg,NULL,false)) { + if(!rda->open(&err_msg,NULL,false,true)) { QMessageBox::critical(this,"RDAlsaConfig - "+tr("Error"),err_msg); exit(1); } @@ -365,7 +365,7 @@ Autogen::Autogen() // rda=new RDApplication("RDAlsaConfig","rdalsaconfig",RDALSACONFIG_USAGE, false,this); - if(!rda->open(&err_msg,NULL,false)) { + if(!rda->open(&err_msg,NULL,false,true)) { fprintf(stderr,"rdalsaconfig: unable to open database [%s]\n", (const char *)err_msg.toUtf8()); exit(1); diff --git a/utils/rdcheckcuts/rdcheckcuts.cpp b/utils/rdcheckcuts/rdcheckcuts.cpp index efe4f6b1..092085de 100644 --- a/utils/rdcheckcuts/rdcheckcuts.cpp +++ b/utils/rdcheckcuts/rdcheckcuts.cpp @@ -44,7 +44,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdcheckcuts", "rdcheckcuts",RDCHECKCUTS_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"rdcheckcuts: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/utils/rdclilogedit/rdclilogedit.cpp b/utils/rdclilogedit/rdclilogedit.cpp index 521e4de5..de7fc883 100644 --- a/utils/rdclilogedit/rdclilogedit.cpp +++ b/utils/rdclilogedit/rdclilogedit.cpp @@ -2,7 +2,7 @@ // // A command-line log editor for Rivendell // -// (C) Copyright 2016-2021 Fred Gleason +// (C) Copyright 2016-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -50,7 +50,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdclilogedit", "rdclilogedit",RDCLILOGEDIT_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"rdclilogedit: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/utils/rdconvert/rdconvert.cpp b/utils/rdconvert/rdconvert.cpp index 1a1907e8..5b31235f 100644 --- a/utils/rdconvert/rdconvert.cpp +++ b/utils/rdconvert/rdconvert.cpp @@ -2,7 +2,7 @@ // // Rivendell file format converter. // -// (C) Copyright 2017-2022 Fred Gleason +// (C) Copyright 2017-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -44,7 +44,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdconvert","rdconvert", RDCONVERT_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"rdconvert: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/utils/rddelete/rddelete.cpp b/utils/rddelete/rddelete.cpp index 3f4671f4..078366e7 100644 --- a/utils/rddelete/rddelete.cpp +++ b/utils/rddelete/rddelete.cpp @@ -2,7 +2,7 @@ // // A Batch Deleter for Rivendell. // -// (C) Copyright 2013-2022 Fred Gleason +// (C) Copyright 2013-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -45,7 +45,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rddelete","rddelete", RDDELETE_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,true)) { fprintf(stderr,"rddelete: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/utils/rdexport/rdexport.cpp b/utils/rdexport/rdexport.cpp index 7a4bc6b8..1232d3d1 100644 --- a/utils/rdexport/rdexport.cpp +++ b/utils/rdexport/rdexport.cpp @@ -2,7 +2,7 @@ // // A Batch Exporter for Rivendell. // -// (C) Copyright 2016-2022 Fred Gleason +// (C) Copyright 2016-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -58,7 +58,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdexport","rdexport", RDEXPORT_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"rdexport: %s\n",(const char *)err_msg.toUtf8()); exit(1); } diff --git a/utils/rdgpimon/rdgpimon.cpp b/utils/rdgpimon/rdgpimon.cpp index ab4d4482..8f44b179 100644 --- a/utils/rdgpimon/rdgpimon.cpp +++ b/utils/rdgpimon/rdgpimon.cpp @@ -2,7 +2,7 @@ // // A Qt-based application for testing General Purpose Input (GPI) devices. // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -39,7 +39,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent) // Open the Database // rda=new RDApplication("RDGpiMon","rdgpimon",RDGPIMON_USAGE,true,this); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { QMessageBox::critical(this,"RDGpiMon - "+tr("Error"),err_msg); exit(1); } diff --git a/utils/rdimport/rdimport.cpp b/utils/rdimport/rdimport.cpp index a05a2349..6dfbd46d 100644 --- a/utils/rdimport/rdimport.cpp +++ b/utils/rdimport/rdimport.cpp @@ -2,7 +2,7 @@ // // A Batch Importer for Rivendell. // -// (C) Copyright 2002-2022 Fred Gleason +// (C) Copyright 2002-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -109,7 +109,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdimport","rdimport", RDIMPORT_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"rdimport: %s\n",err_msg.toUtf8().constData()); ErrorExit(RDApplication::ExitNoDb); } diff --git a/utils/rdmaint/rdmaint.cpp b/utils/rdmaint/rdmaint.cpp index 34c4eefc..56fb8f2e 100644 --- a/utils/rdmaint/rdmaint.cpp +++ b/utils/rdmaint/rdmaint.cpp @@ -2,7 +2,7 @@ // // A Utility for running periodic system maintenance. // -// (C) Copyright 2008-2021 Fred Gleason +// (C) Copyright 2008-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -59,7 +59,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdmaint","rdmaint", RDMAINT_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,false)) { + if(!rda->open(&err_msg,NULL,false,true)) { fprintf(stderr,"rdmaint: %s\n",err_msg.toUtf8().constData()); rda->syslog(LOG_ERR,"%s",err_msg.toUtf8().constData()); exit(1); diff --git a/utils/rdmarkerset/rdmarkerset.cpp b/utils/rdmarkerset/rdmarkerset.cpp index 0fb5b075..e1ab6633 100644 --- a/utils/rdmarkerset/rdmarkerset.cpp +++ b/utils/rdmarkerset/rdmarkerset.cpp @@ -2,7 +2,7 @@ // // Command-line tool for setting Rivendell Cut Markers // -// (C) Copyright 2014-2022 Fred Gleason +// (C) Copyright 2014-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -59,7 +59,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdmarkerset", "rdmarkerset",RDMARKERSET_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"rdmarkerset: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/utils/rdmetadata/rdmetadata.cpp b/utils/rdmetadata/rdmetadata.cpp index ce6df6a7..17a13ca3 100644 --- a/utils/rdmetadata/rdmetadata.cpp +++ b/utils/rdmetadata/rdmetadata.cpp @@ -3,7 +3,7 @@ // Command-line tool for setting Rivendell Cart Metadata // // Patrick Linstruth -// (C) Copyright 2019-2022 Fred Gleason +// (C) Copyright 2019-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -51,7 +51,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdmetadata", "rdmetadata",RDMETADATA_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"rdmetadata: %s\n",err_msg.toUtf8().constData()); exit(1); } diff --git a/utils/rdrender/rdrender.cpp b/utils/rdrender/rdrender.cpp index c4dc4ed3..38b29610 100644 --- a/utils/rdrender/rdrender.cpp +++ b/utils/rdrender/rdrender.cpp @@ -2,7 +2,7 @@ // // Render a Rivendell log. // -// (C) Copyright 2017-2022 Fred Gleason +// (C) Copyright 2017-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -69,7 +69,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("rdrender","rdrender", RDRENDER_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { fprintf(stderr,"rdrender: %s\n",(const char *)err_msg.toUtf8()); exit(1); } diff --git a/web/rdxport/rdxport.cpp b/web/rdxport/rdxport.cpp index 9ea50799..436e2491 100644 --- a/web/rdxport/rdxport.cpp +++ b/web/rdxport/rdxport.cpp @@ -2,7 +2,7 @@ // // Rivendell web service portal // -// (C) Copyright 2010-2021 Fred Gleason +// (C) Copyright 2010-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -51,7 +51,7 @@ Xport::Xport(QObject *parent) // rda=static_cast(new RDCoreApplication("rdxport.cgi", "rdxport.cgi",RDXPORT_CGI_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,false)) { + if(!rda->open(&err_msg,NULL,false,false)) { printf("Content-type: text/html\n"); printf("Status: 500\n"); printf("\n"); diff --git a/web/webget/webget.cpp b/web/webget/webget.cpp index 83a5c7b4..d1894a27 100644 --- a/web/webget/webget.cpp +++ b/web/webget/webget.cpp @@ -2,7 +2,7 @@ // // Rivendell upload/download utility // -// (C) Copyright 2018-2022 Fred Gleason +// (C) Copyright 2018-2023 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -52,7 +52,7 @@ MainObject::MainObject(QObject *parent) // rda=static_cast(new RDCoreApplication("webget.cgi", "webget.cgi",WEBGET_CGI_USAGE,false,this)); - if(!rda->open(&err_msg,NULL,true)) { + if(!rda->open(&err_msg,NULL,true,false)) { TextExit(err_msg,500,LINE_NUMBER); }