diff --git a/src/raspberrypi/rascsi_interface.proto b/src/raspberrypi/rascsi_interface.proto index 010b1a29..6aa23a82 100644 --- a/src/raspberrypi/rascsi_interface.proto +++ b/src/raspberrypi/rascsi_interface.proto @@ -61,8 +61,7 @@ enum PbOperation { RESERVE = 14; // Create an image file. The image file must not yet exist. // PbCommand.params(0) contains the filename, PbCommand.params(1) contains the file size in bytes. - // PbCommand.params(2) is optional (default is false) and controls the file permissions. - // If "true" (case-insensitive) a read-only file is created. + // PbCommand.params(2) controls the file permissions. If "true" (case-insensitive) a read-only file is created. // The filename is relative to the default image folder and must not contain a slash. // The file size must be a multiple of 512. CREATE_IMAGE = 15; diff --git a/src/raspberrypi/rasctl.cpp b/src/raspberrypi/rasctl.cpp index 15c0d289..9f1dd58a 100644 --- a/src/raspberrypi/rasctl.cpp +++ b/src/raspberrypi/rasctl.cpp @@ -216,6 +216,12 @@ void CommandCreateImage(const string&hostname, int port, const string& image_par command.add_params(image_params.substr(0, separatorPos)); command.add_params(image_params.substr(separatorPos + 1)); } + else { + cerr << "Error: Invalid file description '" << image_params << "', format is NAME:SIZE" << endl; + exit(EXIT_FAILURE); + } + + command.add_params("false"); PbResult result; SendCommand(hostname.c_str(), port, command, result); @@ -242,6 +248,10 @@ void CommandRenameImage(const string&hostname, int port, const string& image_par command.add_params(image_params.substr(0, separatorPos)); command.add_params(image_params.substr(separatorPos + 1)); } + else { + cerr << "Error: Invalid file description '" << image_params << "', format is OLD_NAME:NEW_NAME" << endl; + exit(EXIT_FAILURE); + } PbResult result; SendCommand(hostname.c_str(), port, command, result);