Skip to contentSkip to conversation

s390: s390dbf permissions.

PATCH New Martin Schwidefsky 1 participant 1 message Mar 17, 2005 s390

lore
Share & tools
lore
#0 lore raw

PATCH 5/8 s390: s390dbf permissions.

[patch 5/8] s390: s390dbf permissions.

From: Michael Holzheu <[email protected]>

Use more specific permissions for the procfiles if s390dbf. Read only views should have read permission, write only views should have write permission.

diffstat:

 arch/s390/kernel/debug.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
arch/s390/kernel/debug.c +5 -5
diff -urN linux-2.6/arch/s390/kernel/debug.c linux-2.6-patched/arch/s390/kernel/debug.c
@@ -931,11 +931,15 @@
 	int rc = 0;
 	int i;
 	unsigned long flags;
-	mode_t mode = S_IFREG | S_IRUSR | S_IWUSR;
+	mode_t mode = S_IFREG;
 	struct proc_dir_entry *pde;
 
 	if (!id)
 		goto out;
+	if (view->prolog_proc || view->format_proc || view->header_proc)
+		mode |= S_IRUSR;
+	if (view->input_proc)
+		mode |= S_IWUSR;
 	pde = create_proc_entry(view->name, mode, id->proc_root_entry);
 	if (!pde){
 		printk(KERN_WARNING "debug: create_proc_entry() failed! Cannot register view %s/%s\n", id->name,view->name);
@@ -958,10 +962,6 @@
 	}
 	else {
 		id->views[i] = view;
-		if (view->prolog_proc || view->format_proc || view->header_proc)
-			mode |= S_IRUSR;
-		if (view->input_proc)
-			mode |= S_IWUSR;
 		pde->proc_fops = &debug_file_ops;
 		id->proc_entries[i] = pde;
 	}