Changeset 4195
- Timestamp:
- 03/12/08 18:09:35 (5 years ago)
- File:
-
- 1 edited
-
trunk/src/target/opkg/libbb/make_directory.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/opkg/libbb/make_directory.c
r3837 r4195 51 51 if (stat (path, &st) < 0 && errno == ENOENT) { 52 52 int status; 53 char * buf, *parent;53 char *pathcopy, *parent, *parentcopy; 54 54 mode_t mask; 55 55 … … 57 57 umask (mask); 58 58 59 buf = xstrdup (path); 60 parent = dirname (buf); 61 status = make_directory (parent, (0777 & ~mask) | 0300, 62 FILEUTILS_RECUR); 63 free (buf); 59 /* dirname is unsafe, it may both modify the 60 memory of the path argument and may return 61 a pointer to static memory, which can then 62 be modified by consequtive calls to dirname */ 63 64 pathcopy = xstrdup (path); 65 parent = dirname (pathcopy); 66 parentcopy = xstrdup (parent); 67 status = make_directory (parentcopy, (0777 & ~mask) 68 | 0300, FILEUTILS_RECUR); 69 free (pathcopy); 70 free (parentcopy); 71 64 72 65 73 if (status < 0 || make_directory (path, mode, 0) < 0)
Note: See TracChangeset
for help on using the changeset viewer.
