Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1624787

[PATCH 2/2 v2] char: misc: use octal permissions for the proc entry

From Martin Kaiser <martin@kaiser.cx>
Newsgroups linux.kernel
Subject [PATCH 2/2 v2] char: misc: use octal permissions for the proc entry
Date 2017-04-17 20:30 +0200
Message-ID <txjzs-42t-3@gated-at.bofh.it> (permalink)
References <tfHJT-7FS-7@gated-at.bofh.it> <txjzs-42t-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Set the permissions for /proc/misc to 0444 explicitly. At the moment,
we're using 0 and have proc_create_data() convert this to 0444.
This fixes a checkpatch warning.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
v2:
   separate patch for each checkpatch warning

 drivers/char/misc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 3447b2e..3c633d5 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -280,7 +280,7 @@ static int __init misc_init(void)
 	int err;
 	struct proc_dir_entry *ret;
 
-	ret = proc_create("misc", 0, NULL, &misc_proc_fops);
+	ret = proc_create("misc", 0444, NULL, &misc_proc_fops);
 	misc_class = class_create(THIS_MODULE, "misc");
 	err = PTR_ERR(misc_class);
 	if (IS_ERR(misc_class))
-- 
1.7.10.4

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/2 v2] char: misc: use octal permissions for the proc entry Martin Kaiser <martin@kaiser.cx> - 2017-04-17 20:30 +0200
  Re: [PATCH 2/2 v2] char: misc: use octal permissions for the proc  entry Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-04-18 06:40 +0200
    Re: [PATCH 2/2 v2] char: misc: use octal permissions for the proc  entry Martin Kaiser <martin@kaiser.cx> - 2017-04-18 10:00 +0200
      Re: [PATCH 2/2 v2] char: misc: use octal permissions for the proc  entry Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-04-18 10:20 +0200
        Re: [PATCH 2/2 v2] char: misc: use octal permissions for the proc  entry Martin Kaiser <martin@kaiser.cx> - 2017-04-18 11:20 +0200

csiph-web