Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29919490 authored by Nick Kralevich's avatar Nick Kralevich
Browse files

Add O_CLOEXEC

Prevent an FD from accidentally leaking across an exec() boundary.

Test: code compiles.
Change-Id: I90ca6e332802700403f401db016cc6c0c72b0ea3
parent 30fa1b78
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -746,7 +746,7 @@ void load_recovery_id_prop() {
        return;
    }

    int fd = open(rec->blk_device, O_RDONLY);
    int fd = open(rec->blk_device, O_RDONLY | O_CLOEXEC);
    if (fd == -1) {
        PLOG(ERROR) << "error opening block device " << rec->blk_device;
        return;