Skip to content

Commit cd3c925

Browse files
authored
Ota/fix sudo issue (#1487)
* Fix sudo file path issue
1 parent 7d6e54e commit cd3c925

File tree

9 files changed

+279
-128
lines changed

9 files changed

+279
-128
lines changed

platform/lexicon.txt

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ basedefs
1212
bio
1313
bitmasking
1414
blocksize
15+
blocksize
1516
bool
1617
bootable
1718
bootloader
@@ -27,6 +28,7 @@ cert
2728
cmock
2829
com
2930
config
31+
config
3032
connectsuccessindex
3133
const
3234
couldn
@@ -122,26 +124,45 @@ ota
122124
otafile
123125
otaimagestateaborted
124126
otaimagestateaccepted
125-
otaimagestaterejected
126-
otaimagestatetesting
127127
otaimagestateinvalid
128128
otaimagestatependingcommit
129129
otaimagestaterejected
130+
otaimagestaterejected
131+
otaimagestatetesting
130132
otaimagestateunknown
131133
otalastimagestate
134+
otapal_closefile
135+
otapalabortfailed
136+
otapalactivatefailed
137+
otapalbadimagestate
138+
otapalbadsignercert
139+
otapalbootinfocreatefailed
140+
otapalbufferinsufficient
141+
otapalcommitfailed
142+
otapalcwdfailed
143+
otapalfileabort
144+
otapalfileclose
145+
otapalfilegensuccess
132146
otapalimagestateinvalid
133147
otapalimagestatependingcommit
134148
otapalimagestateunknown
135149
otapalimagestatevalid
136150
otapalnullfilecontext
151+
otapalnullfilecontext
152+
otapaloutofmemory
137153
otapaloutofmemory
138154
otapalrejectfailed
155+
otapalrejectfailed
139156
otapalrxfilecreatefailed
157+
otapalrxfilecreatefailed
158+
otapalrxfiletoolarge
140159
otapalrxfiletoolarge
141160
otapalsignaturecheckfailed
161+
otapalsignaturecheckfailed
162+
otapalsuccess
142163
otapalsuccess
143164
otapaluninitialized
144-
otapal_closefile
165+
otapaluninitialized
145166
paddrinfo
146167
palpnprotos
147168
param
@@ -151,9 +172,11 @@ pcdata
151172
pcertfilepath
152173
pclientcertpath
153174
pdata
175+
pdata
154176
pem
155177
pfile
156178
pfilecontext
179+
pfilecontext
157180
pfilepath
158181
pformat
159182
phostname
@@ -199,7 +222,6 @@ sizeof
199222
sleeptimems
200223
sni
201224
snihostname
202-
snprintf
203225
sockaddr
204226
sockets_invalid_parameter
205227
socketstatus
@@ -239,23 +261,3 @@ variadic
239261
vtaskdelay
240262
writesize
241263
www
242-
blocksize
243-
config
244-
otapalsuccess
245-
otapaluninitialized
246-
otapaloutofmemory
247-
otapalnullfilecontext
248-
otapalsignaturecheckfailed
249-
otapalrxfilecreatefailed
250-
otapalrxfiletoolarge
251-
otapalbootinfocreatefailed
252-
otapalbadsignercert
253-
otapalbadimagestate
254-
otapalabortfailed
255-
otapalrejectfailed
256-
otapalcommitfailed
257-
otapalactivatefailed
258-
otapalfileabort
259-
otapalfileclose
260-
pdata
261-
pfilecontext

platform/posix/ota_pal/source/include/ota_pal_posix.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,22 @@
2828

2929
#include "ota.h"
3030

31-
32-
3331
/**
3432
* @brief Maximum file path length on Linux
3533
*/
3634
#define OTA_FILE_PATH_LENGTH_MAX 512
3735

36+
/**
37+
* @brief The OTA platform interface status for generating
38+
* absolute file path from the incoming relative file path.
39+
*/
40+
typedef enum OtaPalPathGenStatus
41+
{
42+
OtaPalFileGenSuccess, /*!< @brief Absolute path generation success. */
43+
OtaPalCWDFailed, /*!< @brief getcwd failed to output path. */
44+
OtaPalBufferInsufficient /*!< @brief Buffer insufficient for storing the file path. */
45+
} OtaPalPathGenStatus_t;
46+
3847
/**
3948
* @brief Abort an OTA transfer.
4049
*

0 commit comments

Comments
 (0)