2019-02-19 Fred Gleason <fredg@paravelsystems.com>

* Added 'RnRmlOwner=' and 'RnRmlGroup=' directives to rd.conf(5).
	* Refactored the implementation of the 'Run Shell Command' ['RN']
	RML to use runuser(1).
This commit is contained in:
Fred Gleason
2019-02-19 12:47:18 -05:00
parent 26c9ff87c0
commit 489db27fc9
10 changed files with 126 additions and 29 deletions

View File

@@ -222,10 +222,12 @@
/*
* Default System Identities
*/
#define RD_DEFAULT_AUDIO_OWNER "user"
#define RD_DEFAULT_AUDIO_GROUP "users"
#define RD_DEFAULT_AUDIO_OWNER "rivendell"
#define RD_DEFAULT_AUDIO_GROUP "rivendell"
#define RD_DEFAULT_PYPAD_OWNER "pypad"
#define RD_DEFAULT_PYPAD_GROUP "pypad"
#define RD_DEFAULT_RN_RML_OWNER "rivendell"
#define RD_DEFAULT_RN_RML_GROUP "rivendell"
#define RD_DEFAULT_LABEL "Default Configuration"
/*

View File

@@ -392,6 +392,18 @@ QString RDConfig::pypadGroup() const
}
QString RDConfig::rnRmlOwner() const
{
return conf_rn_rml_owner;
}
QString RDConfig::rnRmlGroup() const
{
return conf_rn_rml_group;
}
QString RDConfig::ripcdLogname() const
{
return conf_ripcd_logname;
@@ -470,6 +482,18 @@ gid_t RDConfig::pypadGid() const
}
uid_t RDConfig::rnRmlUid() const
{
return conf_rn_rml_uid;
}
gid_t RDConfig::rnRmlGid() const
{
return conf_rn_rml_gid;
}
QString RDConfig::caeLogfile() const
{
return conf_cae_logfile;
@@ -565,6 +589,10 @@ bool RDConfig::load()
profile->stringValue("Identity","PypadOwner",RD_DEFAULT_PYPAD_OWNER);
conf_pypad_group=
profile->stringValue("Identity","PypadGroup",RD_DEFAULT_PYPAD_GROUP);
conf_rn_rml_owner=
profile->stringValue("Identity","RnRmlOwner",RD_DEFAULT_RN_RML_OWNER);
conf_rn_rml_group=
profile->stringValue("Identity","RnRmlGroup",RD_DEFAULT_RN_RML_GROUP);
conf_label=profile->stringValue("Identity","Label",RD_DEFAULT_LABEL);
conf_audio_store_mount_source=
@@ -662,6 +690,16 @@ bool RDConfig::load()
RD_DEFAULT_PYPAD_GROUP)))!=NULL) {
conf_pypad_gid=groups->gr_gid;
}
if((user=getpwnam(profile->stringValue("Identity","RnRmlOwner",
RD_DEFAULT_RN_RML_OWNER)))!=NULL) {
conf_rn_rml_uid=user->pw_uid;
}
if((groups=getgrnam(profile->stringValue("Identity","RnRmlGroup",
RD_DEFAULT_RN_RML_GROUP)))!=NULL) {
conf_rn_rml_gid=groups->gr_gid;
}
conf_cae_logfile=profile->stringValue("Caed","Logfile","");
conf_enable_mixer_logging=profile->boolValue("Caed","EnableMixerLogging");
conf_use_realtime=profile->boolValue("Tuning","UseRealtime",false);
@@ -743,6 +781,8 @@ void RDConfig::clear()
conf_audio_group="";
conf_pypad_owner="";
conf_pypad_group="";
conf_rn_rml_owner="";
conf_rn_rml_group="";
conf_audio_root=RD_AUDIO_ROOT;
conf_audio_extension=RD_AUDIO_EXTENSION;
conf_label=RD_DEFAULT_LABEL;
@@ -764,6 +804,8 @@ void RDConfig::clear()
conf_gid=65535;
conf_pypad_uid=65535;
conf_pypad_gid=65535;
conf_rn_rml_uid=65535;
conf_rn_rml_gid=65535;
conf_cae_logfile="";
conf_enable_mixer_logging=false;
conf_use_realtime=false;

View File

@@ -93,6 +93,8 @@ class RDConfig
QString audioGroup() const;
QString pypadOwner() const;
QString pypadGroup() const;
QString rnRmlOwner() const;
QString rnRmlGroup() const;
QString audioRoot() const;
QString audioExtension() const;
QString audioFileName (QString cutname);
@@ -117,6 +119,8 @@ class RDConfig
gid_t gid() const;
uid_t pypadUid() const;
gid_t pypadGid() const;
uid_t rnRmlUid() const;
gid_t rnRmlGid() const;
bool useRealtime();
int realtimePriority();
int transcodingDelay() const;
@@ -166,6 +170,8 @@ class RDConfig
QString conf_audio_group;
QString conf_pypad_owner;
QString conf_pypad_group;
QString conf_rn_rml_owner;
QString conf_rn_rml_group;
QString conf_audio_root;
QString conf_audio_extension;
QString conf_label;
@@ -186,6 +192,8 @@ class RDConfig
gid_t conf_gid;
uid_t conf_pypad_uid;
gid_t conf_pypad_gid;
uid_t conf_rn_rml_uid;
gid_t conf_rn_rml_gid;
QString conf_cae_logfile;
bool conf_enable_mixer_logging;
bool conf_use_realtime;

View File

@@ -50,5 +50,10 @@ extern "C" {
#define RD_PYPAD_PYTHON_PATH "@PYTHON@"
#define RD_PYPAD_SCRIPT_DIR "@libdir@/rivendell/pypad"
/*
* runuser(1)
*/
#define RD_RUNUSER "@RUNUSER_PATH@"
#endif // RDPATHS_H