Explorar el Código

pohmelfs/connector: Disallow unpliviged users to configure pohmelfs

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Philipp Reisner hace 15 años
padre
commit
98a5783af0
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      drivers/staging/pohmelfs/config.c

+ 3 - 0
drivers/staging/pohmelfs/config.c

@@ -531,6 +531,9 @@ static void pohmelfs_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *n
 {
 	int err;
 
+	if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN))
+		return;
+
 	switch (msg->flags) {
 		case POHMELFS_FLAGS_ADD:
 		case POHMELFS_FLAGS_DEL: