File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1041
1041
However, it is not part of SUSv4 and thus not portable, unfortunately.
1042
1042
The portable way is to call \texttt {stat } on each directory entry.
1043
1043
\item \texttt {rmdir } does not work on directories that are not empty. You have
1044
- to remove all entries before you can delete a directory. You can use
1045
- \texttt {system("rm -r xxx") } etc. but be careful to sanitize the environment and
1046
- the directory name to avoid any security implications.
1044
+ to remove all entries before you can delete a directory. It might be tempting
1045
+ to use something like \texttt {system("rm -r xxx") }, e.g. invoke a shell to
1046
+ run the \texttt {rm } command etc., however this should be avoided as it is prone
1047
+ to errors (the environment and the directory name might be hard to sanitize)
1048
+ and might have security implications.
1047
1049
\item \hlabel {REMOVE} The specification also defines \texttt {remove } which
1048
1050
behaves like \texttt {unlink } for files and as \texttt {rmdir } for directories.
1049
1051
\end {itemize }
You can’t perform that action at this time.
0 commit comments