From 11a660987639389b732cbb5d7b1f39af87368e59 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Thu, 30 Mar 2017 11:38:18 -0400 Subject: [PATCH] 2017-03-30 Fred Gleason * Changed the result code of the 'AddCart' service when the cart already exists from '403' to '400'. * Changed the result code of the 'EditCart' service when attempting to set a forced length on a macro cart from '403' to '400'. * Changed the result code of the 'EditCart' service when attempting to set a forced length outside of the valid range from '403' to '400'. * Changed the result code of the 'Export' service when attempting to export from a cut with no audio content from '403' to '404'. * Changed the '401' result code of the 'EditCart' service to be 403. * Changed the '401' result code of the 'DeleteAudio' service to be 403. * Changed the '401' result code of the 'Export' service to be 403. --- ChangeLog | 12 ++++++++++++ web/rdxport/carts.cpp | 20 ++++++++++---------- web/rdxport/deleteaudio.cpp | 2 +- web/rdxport/export.cpp | 2 +- web/rdxport/import.cpp | 4 ++-- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index be33bf79..8d727c7b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15681,3 +15681,15 @@ 2017-03-30 Fred Gleason * Added '--relink-audio' and '--relink-audio-move' commands to rddbcheck(8) in 'utils/rddbcheck.cpp' and 'utils/rddbcheck.h'. +2017-03-30 Fred Gleason + * Changed the result code of the 'AddCart' service when the cart + already exists from '403' to '400'. + * Changed the result code of the 'EditCart' service when attempting + to set a forced length on a macro cart from '403' to '400'. + * Changed the result code of the 'EditCart' service when attempting + to set a forced length outside of the valid range from '403' to '400'. + * Changed the result code of the 'Export' service when attempting + to export from a cut with no audio content from '403' to '404'. + * Changed the '401' result code of the 'EditCart' service to be 403. + * Changed the '401' result code of the 'DeleteAudio' service to be 403. + * Changed the '401' result code of the 'Export' service to be 403. diff --git a/web/rdxport/carts.cpp b/web/rdxport/carts.cpp index f67f9fc5..2f20b80f 100644 --- a/web/rdxport/carts.cpp +++ b/web/rdxport/carts.cpp @@ -81,11 +81,11 @@ void Xport::AddCart() } if(!group->cartNumberValid(cart_number)) { delete group; - XmlExit("Cart number out of range for group",401); + XmlExit("Cart number out of range for group",403); } delete group; if(!xport_user->createCarts()) { - XmlExit("Unauthorized",401); + XmlExit("Forbidden",403); } // @@ -94,7 +94,7 @@ void Xport::AddCart() cart=new RDCart(cart_number); if(cart->exists()) { delete cart; - XmlExit("Cart already exists",403); + XmlExit("Cart already exists",400); } if(!cart->create(group_name,cart_type)) { delete cart; @@ -249,7 +249,7 @@ void Xport::EditCart() XmlExit("No such cart",404); } if(!xport_user->modifyCarts()) { - XmlExit("Unauthorized",401); + XmlExit("Unauthorized",403); } if(xport_post->getValue("GROUP_NAME",&group_name)) { if(!xport_user->groupAuthorized(group_name)) { @@ -282,11 +282,11 @@ void Xport::EditCart() number=RDSetTimeLength(value); if(cart->type()==RDCart::Macro) { delete cart; - XmlExit("Unsupported operation for cart type",403); + XmlExit("Unsupported operation for cart type",400); } if(!cart->validateLengths(number)) { delete cart; - XmlExit("Forced length out of range",403); + XmlExit("Forced length out of range",400); } } switch(cart->type()) { @@ -413,7 +413,7 @@ void Xport::RemoveCart() XmlExit("No such cart",404); } if(!xport_user->deleteCarts()) { - XmlExit("Unauthorized",401); + XmlExit("Unauthorized",403); } // @@ -454,7 +454,7 @@ void Xport::AddCut() XmlExit("No such cart",404); } if(!xport_user->editAudio()) { - XmlExit("Unauthorized",401); + XmlExit("Forbidden",403); } // @@ -620,7 +620,7 @@ void Xport::EditCut() XmlExit("No such cart",404); } if(!xport_user->editAudio()) { - XmlExit("Unauthorized",401); + XmlExit("Forbidden",403); } // @@ -911,7 +911,7 @@ void Xport::RemoveCut() XmlExit("No such cart",404); } if(!xport_user->editAudio()) { - XmlExit("Unauthorized",401); + XmlExit("Forbidden",403); } // diff --git a/web/rdxport/deleteaudio.cpp b/web/rdxport/deleteaudio.cpp index a7ae09c8..e0f2254a 100644 --- a/web/rdxport/deleteaudio.cpp +++ b/web/rdxport/deleteaudio.cpp @@ -49,7 +49,7 @@ void Xport::DeleteAudio() // Process Request // if((!xport_user->deleteCarts())&&(!xport_user->adminConfig())) { - XmlExit("User not authorized",401); + XmlExit("User not authorized",403); } RDCut *cut=new RDCut(cartnum,cutnum); if(!cut->exists()) { diff --git a/web/rdxport/export.cpp b/web/rdxport/export.cpp index a7367a2f..9f42b692 100644 --- a/web/rdxport/export.cpp +++ b/web/rdxport/export.cpp @@ -189,7 +189,7 @@ void Xport::Export() break; case RDAudioConvert::ErrorNoSource: - resp_code=403; + resp_code=404; break; case RDAudioConvert::ErrorNoDestination: diff --git a/web/rdxport/import.cpp b/web/rdxport/import.cpp index f394a55c..94700824 100644 --- a/web/rdxport/import.cpp +++ b/web/rdxport/import.cpp @@ -101,10 +101,10 @@ void Xport::Import() } } if(!xport_user->editAudio()) { - XmlExit("Unauthorized",401); + XmlExit("Forbidden",403); } if(create&&(!xport_user->createCarts())) { - XmlExit("Unauthorized",401); + XmlExit("Forbidden",403); } //