After open of the configfile, simply fstat() that fd to ensure that
we are checking the file we just opened, not something that got
renamed in between.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
if (fd < 0)
goto out;
- ret = fstatat(dirfd, cli_config_file, &st, AT_SYMLINK_NOFOLLOW);
+ ret = fstat(fd, &st);
if (ret != 0)
goto err_out_close;
memcpy(*fpath, cli_config_file, strlen(cli_config_file));
- ret = fstatat(AT_FDCWD, cli_config_file, &st, AT_SYMLINK_NOFOLLOW);
+ ret = fstat(fd, &st);
if (ret != 0)
goto err_out_close;
goto err_out_close;
}
- ret = fstatat(dirfd, "default", &st, AT_SYMLINK_NOFOLLOW);
+ ret = fstat(fd, &st);
if (ret != 0)
goto err_out_close;