summaryrefslogtreecommitdiffstats
path: root/download_manager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Enable clang code formatAdriana Kobylak2018-03-021-6/+3
| | | | | Change-Id: Ia899858c11cff6e4fa26b820b35b1e5dca1b57df Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Fix error loggingAdriana Kobylak2018-02-131-2/+2
| | | | | | | | | | | | | | | | - The logging interfaces don't support std::string, so need to pass c-strings to the metadata fields, or the pointer address will be the one added to the log. - Log the name of the file uploaded to the BMC instead of the manifest path when there is a manifest error. The manifest path is always /tmp/imgXXXX/MANIFEST which doesn't help debug. - Check the status of the child process after waitpid returns. The execl call returns when there was an error executing execl, not if the command executed failed. This will catch when tar returns a non-0 return code. Change-Id: Ia4bd2666fc6beec28dee7e821d959a336800d282 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
* Create Image Dir if not presentGunnar Mills2017-11-131-2/+4
| | | | | | | | | | | Instead of throwing an error, create the image directory, if not present. The inotify code should create the image directory if not present, not the upload or TFTP code. Removed creating the image directory from the TFTP here and removed from the upload in another commit. Change-Id: I8c142283cfd5a3c87bdf2291d2e79729ec9ac319 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Style changes in download_manager.cppGunnar Mills2017-08-311-10/+8
| | | | | Change-Id: Ib7f26fc620301439768095d8d18965e3daa914e3 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* download: Check for empty filenameBrad Bishop2017-08-311-3/+6
| | | | | | | | Avoid an unhandled std::out_of_range exception if the client provides an empty filename. Change-Id: Ibfc99eee9adada255052375581bb308f7afa9da4 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Sanitize FileName stringGunnar Mills2017-04-271-2/+9
| | | | | | | | For security reasons, the FileName string must be sanitized. Resolves openbmc/openbmc#1331 Change-Id: I90aeda32421caf16e6919cffb71dd0450e4cf868 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create image dir if neededGunnar Mills2017-04-271-0/+9
| | | | | Change-Id: If1c1a62292027ae98d1ba1c6d62bd72d0ae8a307 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create error log on failGunnar Mills2017-04-271-0/+14
| | | | | | | Use elog to create error log on fail. Change-Id: I27863f5102f56fa04defbab1831c462bf152f771 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Call tftpGunnar Mills2017-04-271-0/+40
| | | | | | | | | Call tftp using fork/exec. The file is downloaded to /tmp/images/ which the inotify daemon will monitor. Change-Id: Id69fea183503dd95181acb9bcdb57c1e6d7bb070 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Initial Download managerGunnar Mills2017-04-071-0/+19
This is the basic download manager that implements xyz/openbmc_project/Common/TFTP.interface.yaml Change-Id: I429b0f2fbce3864dee5051af727b88b3a3fe1227 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
OpenPOWER on IntegriCloud