message: switch to fget_raw() to allow passing O_PATH file descriptors
authorDjalal Harouni <tixxdz@opendz.org>
Wed, 22 Oct 2014 14:45:04 +0000 (15:45 +0100)
committerDjalal Harouni <tixxdz@opendz.org>
Wed, 22 Oct 2014 14:45:04 +0000 (15:45 +0100)
Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
message.c

index cb45bc6e4f85bf9c233bf66ba8630f8053881657..579ad7609075716f0aadf408ffaef87141560242 100644 (file)
--- a/message.c
+++ b/message.c
@@ -232,9 +232,10 @@ static int kdbus_msg_scan_items(struct kdbus_conn *conn,
 
                                /*
                                 * Verify the fd and increment the
-                                * usage count
+                                * usage count. Use fget_raw() to allow
+                                * passing O_PATH fds
                                 */
-                               if (fd < 0 || !(f = fget(fd)))
+                               if (fd < 0 || !(f = fget_raw(fd)))
                                        return -EBADF;
 
                                kmsg->fds[i] = f;