OSDN Git Service

Add permission bits to open calls with O_CREAT
authorGeorge Burgess IV <gbiv@google.com>
Wed, 25 Jan 2017 19:36:12 +0000 (11:36 -0800)
committerGeorge Burgess IV <gbiv@google.com>
Fri, 27 Jan 2017 20:56:37 +0000 (12:56 -0800)
commit3ef54f28c2143170e172fc12f0e9e6bde15ea4d3
treec9294ccaf99b677d143967f9c219632550692050
parent70a5f120458f1705090cc3f8f144a322527618e6
Add permission bits to open calls with O_CREAT

Open needs a third argument if you pass it O_CREAT:
https://linux.die.net/man/3/open

This turns into a compile-time error with FORITFY, so we need this fixed
before our unbroken FORTIFY can go in.

(The TEMP_FAILURE_RETRY open isn't detected by clang FORTIFY, but I
noticed that open_reference_profile potentially passes in O_CREAT as an
open_flag.)

Bug: 32073964
Test: Now builds with clang FORTIFY; CtsCompilationTestCases passes;
manually verified that /data/misc/profiles/ref/*/primary.prof has rw
permissions after a successful `cmd package compile -m speed-profile`.
Change-Id: Ie707d5ad403d2f86c769277b3e0f147c45000a6b
cmds/installd/dexopt.cpp