stat-util: add fd_verify_symlink() helper
This commit is contained in:
@@ -108,6 +108,10 @@ int stat_verify_symlink(const struct stat *st) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fd_verify_symlink(int fd) {
|
||||
return verify_stat_at(fd, /* path= */ NULL, /* follow= */ false, stat_verify_symlink, /* verify= */ true);
|
||||
}
|
||||
|
||||
int is_symlink(const char *path) {
|
||||
assert(!isempty(path));
|
||||
return verify_stat_at(AT_FDCWD, path, false, stat_verify_symlink, false);
|
||||
|
||||
@@ -16,6 +16,7 @@ int is_dir_at(int fd, const char *path, bool follow);
|
||||
int is_dir(const char *path, bool follow);
|
||||
|
||||
int stat_verify_symlink(const struct stat *st);
|
||||
int fd_verify_symlink(int fd);
|
||||
int is_symlink(const char *path);
|
||||
|
||||
int stat_verify_linked(const struct stat *st);
|
||||
|
||||
Reference in New Issue
Block a user