Liste des Groupes | Revenir à cl c |
Bonita Montero <Bonita.Montero@gmail.com> writes:And why is this relevant for directory_iterator or recursive_directory_iterator ?Am 01.06.2025 um 09:43 schrieb Lawrence D'Oliveiro:The fchownat() function shall be equivalent to the chown() and lchown()
>On Sun, 1 Jun 2025 07:58:54 +0200, Bonita Montero wrote:>>Sth. like this:
>
for( directory_entry const &de : recursive_directory_iterator( "\",
directory_options::follow_directory_symlink ) )
cout << de.path() << endl;You need the dirfd functions to avoid certain potential security holes>
on operations with symlinks.
Which security holes ?
>
functions except in the case where path specifies a relative path. In
this case the file to be changed is determined relative to the directory
associated with the file descriptor fd instead of the current working
directory. If the access mode of the open file description associated
with the file descriptor is not O_SEARCH, the function shall check
whether directory searches are permitted using the current permissions
of the directory underlying the file descriptor. If the access mode is
O_SEARCH, the function shall not perform the check.
Les messages affichés proviennent d'usenet.