| 333 | } |
| 334 | |
| 335 | static bool fd_regular_current_user(int fd, struct stat *status_out) { |
| 336 | struct stat status; |
| 337 | if (fstat(fd, &status) != 0 || !S_ISREG(status.st_mode) || status.st_uid != geteuid() || |
| 338 | status.st_nlink != 1) { |
| 339 | return false; |
| 340 | } |
| 341 | if (status_out) { |
| 342 | *status_out = status; |
| 343 | } |
| 344 | return true; |
| 345 | } |
| 346 | |
| 347 | static bool fd_regular(int fd, struct stat *status_out) { |
| 348 | struct stat status; |
no outgoing calls
no test coverage detected