mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-21 06:01:15 +02:00
2021-04-18 Fred Gleason <fredg@paravelsystems.com>
* Escaped all SQL identifiers in 'rdadmin/'. * Replaced " with ' delimiters in all SQL literal strings in 'rdadmin/'. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -102,12 +102,12 @@ int EditSasResource::exec(unsigned id)
|
||||
edit_id=id;
|
||||
|
||||
QString sql=QString("select ")+
|
||||
"NUMBER,"+ // 00
|
||||
"ENGINE_NUM,"+ // 01
|
||||
"DEVICE_NUM,"+ // 02
|
||||
"RELAY_NUM "+ // 03
|
||||
"from VGUEST_RESOURCES where "+
|
||||
QString().sprintf("ID=%u",edit_id);
|
||||
"`NUMBER`,"+ // 00
|
||||
"`ENGINE_NUM`,"+ // 01
|
||||
"`DEVICE_NUM`,"+ // 02
|
||||
"`RELAY_NUM` "+ // 03
|
||||
"from `VGUEST_RESOURCES` where "+
|
||||
QString().sprintf("`ID`=%u",edit_id);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
if(q->value(1).toInt()>=0) {
|
||||
@@ -171,11 +171,11 @@ void EditSasResource::okData()
|
||||
}
|
||||
}
|
||||
|
||||
QString sql=QString("update VGUEST_RESOURCES set ")+
|
||||
QString().sprintf("ENGINE_NUM=%d,",enginenum)+
|
||||
QString().sprintf("DEVICE_NUM=%d,",devicenum)+
|
||||
QString().sprintf("RELAY_NUM=%d ",relaynum)+
|
||||
QString().sprintf("where ID=%u",edit_id);
|
||||
QString sql=QString("update `VGUEST_RESOURCES` set ")+
|
||||
QString().sprintf("`ENGINE_NUM`=%d,",enginenum)+
|
||||
QString().sprintf("`DEVICE_NUM`=%d,",devicenum)+
|
||||
QString().sprintf("`RELAY_NUM`=%d ",relaynum)+
|
||||
QString().sprintf("where `ID`=%u",edit_id);
|
||||
RDSqlQuery::apply(sql);
|
||||
|
||||
done(true);
|
||||
|
Reference in New Issue
Block a user