utils: use O_PATH when opening /dev
authorJo-Philipp Wich <jo@mein.io>
Tue, 17 May 2016 15:42:11 +0000 (17:42 +0200)
committerJohn Crispin <john@phrozen.org>
Tue, 17 May 2016 08:40:48 +0000 (10:40 +0200)
commit1418c6ce8559ea125c525c2663105fa5ff14905e
tree291f487ffa169a39bd2fae864dcd4b5cf9633019
parentf2c77756933f22981c1202c039e7f7e24d7247f3
utils: use O_PATH when opening /dev

Use the O_PATH and O_DIRECTORY flags when opening the "/dev" path for the
subsequent openat() call to ensure that it is indeed a directory.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
utils/utils.c