aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Forissier2017-05-23 01:38:07 -0500
committerJérôme Forissier2017-05-31 11:11:40 -0500
commit1358c3f29628809202acde3089c1e1b566301614 (patch)
treef56eeee5d630d62520f8cdad8311ef8c9e1cc0fb
parent63106fb4e086f7965e1f17945b2bbc71841c3a71 (diff)
downloadti-optee-client-1358c3f29628809202acde3089c1e1b566301614.tar.gz
ti-optee-client-1358c3f29628809202acde3089c1e1b566301614.tar.xz
ti-optee-client-1358c3f29628809202acde3089c1e1b566301614.zip
Replace file permission symbolic values by octal numbers
Octal numbers are prefered over symbolic values for file access modes. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r--tee-supplicant/src/tee_supp_fs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tee-supplicant/src/tee_supp_fs.c b/tee-supplicant/src/tee_supp_fs.c
index 07fe7c9f..0146c862 100644
--- a/tee-supplicant/src/tee_supp_fs.c
+++ b/tee-supplicant/src/tee_supp_fs.c
@@ -174,7 +174,7 @@ static TEEC_Result ree_fs_new_create(size_t num_params,
174 strncpy(abs_dir, abs_filename, sizeof(abs_dir)); 174 strncpy(abs_dir, abs_filename, sizeof(abs_dir));
175 abs_dir[sizeof(abs_dir) - 1] = '\0'; 175 abs_dir[sizeof(abs_dir) - 1] = '\0';
176 d = dirname(abs_dir); 176 d = dirname(abs_dir);
177 if (!mkdir(d, S_IRUSR | S_IWUSR | S_IXUSR)) { 177 if (!mkdir(d, 0700)) {
178 fd = open_wrapper(abs_filename, flags); 178 fd = open_wrapper(abs_filename, flags);
179 if (fd >= 0) 179 if (fd >= 0)
180 goto out; 180 goto out;
@@ -190,14 +190,14 @@ static TEEC_Result ree_fs_new_create(size_t num_params,
190 190
191 /* Parent directory for file missing, try to make it */ 191 /* Parent directory for file missing, try to make it */
192 d = dirname(d); 192 d = dirname(d);
193 if (mkdir(d, S_IRUSR | S_IWUSR | S_IXUSR)) 193 if (mkdir(d, 0700))
194 return TEEC_ERROR_GENERIC; 194 return TEEC_ERROR_GENERIC;
195 195
196 /* Try to make directory for file again */ 196 /* Try to make directory for file again */
197 strncpy(abs_dir, abs_filename, sizeof(abs_dir)); 197 strncpy(abs_dir, abs_filename, sizeof(abs_dir));
198 abs_dir[sizeof(abs_dir) - 1] = '\0'; 198 abs_dir[sizeof(abs_dir) - 1] = '\0';
199 d = dirname(abs_dir); 199 d = dirname(abs_dir);
200 if (mkdir(d, S_IRUSR | S_IWUSR | S_IXUSR)) { 200 if (mkdir(d, 0700)) {
201 d = dirname(d); 201 d = dirname(d);
202 rmdir(d); 202 rmdir(d);
203 return TEEC_ERROR_GENERIC; 203 return TEEC_ERROR_GENERIC;