2017-04-06 Fred Gleason <fredg@paravelsystems.com>

* Added an rdauth(1) utility in 'utils/rdauth/'.
	* Fixed a regression in 'lib/rdcart.cpp' that caused the 'Import'
	web API call to fail with an 'unsupported format' error.
This commit is contained in:
Fred Gleason
2017-04-06 15:26:30 -04:00
parent 2dd20efbad
commit 0eda6b79fc
10 changed files with 181 additions and 17 deletions

View File

@@ -52,6 +52,19 @@ Xport::Xport(QObject *parent)
xport_config=new RDConfig();
xport_config->load();
//
// Drop root permissions
//
if(setgid(xport_config->gid())<0) {
XmlExit("Unable to set Rivendell group",500);
}
if(setuid(xport_config->uid())<0) {
XmlExit("Unable to set Rivendell user",500);
}
if(getuid()==0) {
XmlExit("Rivendell user should never be \"root\"!",500);
}
//
// Open Database
//
@@ -126,19 +139,6 @@ Xport::Xport(QObject *parent)
XmlExit("Invalid User",403);
}
//
// Drop root permissions
//
if(setgid(xport_config->gid())<0) {
XmlExit("Unable to set Rivendell group",500);
}
if(setuid(xport_config->uid())<0) {
XmlExit("Unable to set Rivendell user",500);
}
if(getuid()==0) {
XmlExit("Rivendell user should never be \"root\"!",500);
}
//
// Read Command Variable and Dispatch
//