From: Guillaume Chazarain <guichaz@yahoo.fr>
To: alsa-devel@lists.sourceforge.net
Subject: Unhelpful permissions in some /proc files
Date: Fri, 01 Apr 2005 23:19:37 +0200 [thread overview]
Message-ID: <424DBAE9.7060208@yahoo.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 435 bytes --]
Hello,
Some tunables in /proc have a write() function, but as their
permission does not reflect it, it can be confusing to the user.
So here is a patch that corrects the mode of those files. Note that I
have only tested the "xrun_debug" entry.
Also, there is a little inconsistency in that some code does
'entry->mode = S_IFREG | S_IRUGO | S_IWUSR;' whereas some other does
'entry->mode |= S_IWUSR;'.
Kind regards.
--
Guillaume
[-- Attachment #2: alsa_proc_mode.diff --]
[-- Type: text/x-patch, Size: 4378 bytes --]
--- linux-2.6.12-rc1-bk3/sound/core/pcm.c
+++ linux-2.6.12-rc1-bk3-new/sound/core/pcm.c
@@ -447,6 +447,7 @@ static int snd_pcm_stream_proc_init(snd_
#ifdef CONFIG_SND_DEBUG
if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug", pstr->proc_root)) != NULL) {
+ entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
entry->c.text.read_size = 64;
entry->c.text.read = snd_pcm_xrun_debug_read;
entry->c.text.write_size = 64;
--- linux-2.6.12-rc1-bk3/sound/core/pcm_memory.c
+++ linux-2.6.12-rc1-bk3-new/sound/core/pcm_memory.c
@@ -200,6 +200,7 @@ static int snd_pcm_lib_preallocate_pages
substream->buffer_bytes_max = substream->dma_buffer.bytes;
substream->dma_max = max;
if ((entry = snd_info_create_card_entry(substream->pcm->card, "prealloc", substream->proc_root)) != NULL) {
+ entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
entry->c.text.read_size = 64;
entry->c.text.read = snd_pcm_lib_preallocate_proc_read;
entry->c.text.write_size = 64;
--- linux-2.6.12-rc1-bk3/sound/drivers/opl4/opl4_proc.c
+++ linux-2.6.12-rc1-bk3-new/sound/drivers/opl4/opl4_proc.c
@@ -145,6 +145,7 @@ int snd_opl4_create_proc(opl4_t *opl4)
entry->size = 1 * 1024 * 1024;
}
entry->content = SNDRV_INFO_CONTENT_DATA;
+ entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
entry->c.ops = &snd_opl4_mem_proc_ops;
entry->module = THIS_MODULE;
entry->private_data = opl4;
--- linux-2.6.12-rc1-bk3/sound/pci/ca0106/ca0106_proc.c
+++ linux-2.6.12-rc1-bk3-new/sound/pci/ca0106/ca0106_proc.c
@@ -416,6 +416,7 @@ int __devinit snd_ca0106_proc_init(ca010
snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_iec958);
if(! snd_card_proc_new(emu->card, "ca0106_reg32", &entry)) {
snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read32);
+ entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
entry->c.text.write_size = 64;
entry->c.text.write = snd_ca0106_proc_reg_write32;
}
@@ -425,6 +426,7 @@ int __devinit snd_ca0106_proc_init(ca010
snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read8);
if(! snd_card_proc_new(emu->card, "ca0106_regs1", &entry)) {
snd_info_set_text_ops(entry, emu, 1024, snd_ca0106_proc_reg_read1);
+ entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
entry->c.text.write_size = 64;
entry->c.text.write = snd_ca0106_proc_reg_write;
// entry->private_data = emu;
--- linux-2.6.12-rc1-bk3/sound/pci/emu10k1/emu10k1x.c
+++ linux-2.6.12-rc1-bk3-new/sound/pci/emu10k1/emu10k1x.c
@@ -1073,6 +1073,7 @@ static int __devinit snd_emu10k1x_proc_i
if(! snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) {
snd_info_set_text_ops(entry, emu, 1024, snd_emu10k1x_proc_reg_read);
+ entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
entry->c.text.write_size = 64;
entry->c.text.write = snd_emu10k1x_proc_reg_write;
entry->private_data = emu;
--- linux-2.6.12-rc1-bk3/sound/pci/emu10k1/emuproc.c
+++ linux-2.6.12-rc1-bk3-new/sound/pci/emu10k1/emuproc.c
@@ -498,26 +498,31 @@ int __devinit snd_emu10k1_proc_init(emu1
#ifdef CONFIG_SND_DEBUG
if (! snd_card_proc_new(emu->card, "io_regs", &entry)) {
snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_io_reg_read);
+ entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
entry->c.text.write_size = 64;
entry->c.text.write = snd_emu_proc_io_reg_write;
}
if (! snd_card_proc_new(emu->card, "ptr_regs00a", &entry)) {
snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read00a);
+ entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
entry->c.text.write_size = 64;
entry->c.text.write = snd_emu_proc_ptr_reg_write00;
}
if (! snd_card_proc_new(emu->card, "ptr_regs00b", &entry)) {
snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read00b);
+ entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
entry->c.text.write_size = 64;
entry->c.text.write = snd_emu_proc_ptr_reg_write00;
}
if (! snd_card_proc_new(emu->card, "ptr_regs20a", &entry)) {
snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read20a);
+ entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
entry->c.text.write_size = 64;
entry->c.text.write = snd_emu_proc_ptr_reg_write20;
}
if (! snd_card_proc_new(emu->card, "ptr_regs20b", &entry)) {
snd_info_set_text_ops(entry, emu, 65536, snd_emu_proc_ptr_reg_read20b);
+ entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
entry->c.text.write_size = 64;
entry->c.text.write = snd_emu_proc_ptr_reg_write20;
}
next reply other threads:[~2005-04-01 21:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-01 21:19 Guillaume Chazarain [this message]
2005-04-04 10:32 ` Unhelpful permissions in some /proc files Takashi Iwai
2005-04-04 12:24 ` Guillaume Chazarain
2005-04-12 15:34 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=424DBAE9.7060208@yahoo.fr \
--to=guichaz@yahoo.fr \
--cc=alsa-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.