]> Git Repo - linux.git/commitdiff
bpfilter: don't pass O_CREAT when opening console for debug
authorJakub Kicinski <[email protected]>
Thu, 24 May 2018 07:41:19 +0000 (00:41 -0700)
committerDavid S. Miller <[email protected]>
Thu, 24 May 2018 13:36:49 +0000 (09:36 -0400)
Passing O_CREAT (00000100) to open means we should also pass file
mode as the third parameter.  Creating /dev/console as a regular
file may not be helpful anyway, so simply drop the flag when
opening debug_fd.

Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Jakub Kicinski <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/bpfilter/main.c

index 81bbc1684896ec68c04322248abf7b26667d1aa4..1317f108df8ae650454def33340546ab20eea03d 100644 (file)
@@ -55,7 +55,7 @@ static void loop(void)
 
 int main(void)
 {
-       debug_fd = open("/dev/console", 00000002 | 00000100);
+       debug_fd = open("/dev/console", 00000002);
        dprintf(debug_fd, "Started bpfilter\n");
        loop();
        close(debug_fd);
This page took 0.058836 seconds and 4 git commands to generate.