summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJianzheng Zhou <jianzheng.zhou@freescale.com>2012-12-27 12:26:39 +0800
committerTapani <tapani@vmail.me>2013-03-29 11:42:29 +0800
commitb435b9820407427aa86e65b2a227e6d5d8c72788 (patch)
tree85437af211ea3a6b856ee8c681aa51c6f8397ad5
parent316089d18407586fba5a013680951d284b5e7eea (diff)
ENGR00238276: rfkill:change rfkill node permission
Use CONFIG_ANDROID_PARANOID_NETWORK to change the rfkill's attr permission (state and type) to fix android upper has no right to access and write issue when use dongle devices. Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>
-rw-r--r--net/rfkill/core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index df2dae6b2723..9a2d2a0d227a 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -2,6 +2,7 @@
* Copyright (C) 2006 - 2007 Ivo van Doorn
* Copyright (C) 2007 Dmitry Torokhov
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
+ * Copyright (C) 2012 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -719,10 +720,18 @@ static ssize_t rfkill_claim_store(struct device *dev,
static struct device_attribute rfkill_dev_attrs[] = {
__ATTR(name, S_IRUGO, rfkill_name_show, NULL),
+#ifdef CONFIG_ANDROID_PARANOID_NETWORK
+ __ATTR(type, S_IRUGO|S_IWUGO, rfkill_type_show, NULL),
+#else
__ATTR(type, S_IRUGO, rfkill_type_show, NULL),
+#endif
__ATTR(index, S_IRUGO, rfkill_idx_show, NULL),
__ATTR(persistent, S_IRUGO, rfkill_persistent_show, NULL),
+#ifdef CONFIG_ANDROID_PARANOID_NETWORK
+ __ATTR(state, S_IRUGO|S_IWUGO, rfkill_state_show, rfkill_state_store),
+#else
__ATTR(state, S_IRUGO|S_IWUSR, rfkill_state_show, rfkill_state_store),
+#endif
__ATTR(claim, S_IRUGO|S_IWUSR, rfkill_claim_show, rfkill_claim_store),
__ATTR(soft, S_IRUGO|S_IWUSR, rfkill_soft_show, rfkill_soft_store),
__ATTR(hard, S_IRUGO, rfkill_hard_show, NULL),