Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
Merge pull request #723 from giuseppe/silence-lgtm-warnings
Browse files Browse the repository at this point in the history
linux: silence two false positives reported by lgtm
  • Loading branch information
giuseppe authored Aug 25, 2021
2 parents 71da98d + 74543d3 commit c84d519
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcrun/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ create_dev (libcrun_container_t *container, int devfd, struct device_s *device,
if (UNLIKELY (ret < 0))
return crun_make_error (err, errno, "fchmodat `%s`", device->path);

ret = chown (fd_buffer, device->uid, device->gid);
ret = chown (fd_buffer, device->uid, device->gid); /* lgtm [cpp/toctou-race-condition] */
if (UNLIKELY (ret < 0))
return crun_make_error (err, errno, "chown `%s`", device->path);
}
Expand Down Expand Up @@ -1149,7 +1149,7 @@ create_dev (libcrun_container_t *container, int devfd, struct device_s *device,
if (UNLIKELY (ret < 0))
return crun_make_error (err, errno, "chmod `%s`", device->path);

ret = chown (fd_buffer, device->uid, device->gid);
ret = chown (fd_buffer, device->uid, device->gid); /* lgtm [cpp/toctou-race-condition] */
if (UNLIKELY (ret < 0))
return crun_make_error (err, errno, "chown `%s`", device->path);
}
Expand Down

0 comments on commit c84d519

Please sign in to comment.