Updated: April 19, 2023 |
Determine if a file is trusted
#include <sys/stat.h> int fchecktrust( const int fd, const struct stat *pstat, const unsigned operation);
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The fchecktrust() function determines whether or not the file associated with the given file descriptor is trusted or is in a trusted filesystem.
QNX recommends that you use this function instead of fdistrusted() For example, to call the equivalent of fdistrusted(fd), call fchecktrust(fd, NULL, CHECK_TRUST_FILE).
You can use the pathtrust feature to prevent processes from executing untrusted files. See Pathtrust in the System Security Guide.
EOK if the file is trusted, or errno value if an error occurred.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |