JackOfAll wrote:
> Hmmmm. Last time I looked at this, which admittedly was some time ago,
> start squeezelite with -v and it creates the /dev/shm/squeezelite file
> owner squeezelite, group squeezelite, mode rw-r--r--, so it was readable
> by anyone. Thought that jivelite user, (which the jivelite-autologin
> service is running as), just needs to read, rather than write the file.
> I'll take another look later today.
>
> I forgot about visulizer last time I updated the web-gui. Should have
> added a dedicated checkbox for that option. Oh well, at least you can
> put the "-v" in the options field for the moment.
>
> Edit: 20140109 12:50
>
> Just had a quick look at code,
>
> squeezelite
> >
Code:
--------------------
> >
> vis_fd = shm_open(vis_shm_path, O_CREAT | O_RDWR, 0666);
>
--------------------
> >
>
> jivelite
> >
Code:
--------------------
> >
> vis_fd = shm_open(shm_path, O_RDWR, 0666);
>
--------------------
> >
>
> Still need to come back to this, just heading out of the front door
> right now.
>
> EDIT 20140109 13:30
>
> Quick patch for squeezelite to get the shm file created 0666, by
> clearing the umask. I'll push a new build later.
> >
Code:
--------------------
> >
> --- squeezelite-1.5-c71ee71/output_vis.c.umask 2014-01-03
13:20:04.000000000 +0000
> +++ squeezelite-1.5-c71ee71/output_vis.c 2014-01-09
13:26:28.224066710 +0000
> @@ -24,6 +24,7 @@
>
> #if VISEXPORT
>
> +#include <sys/stat.h>
> #include <sys/mman.h>
> #include <fcntl.h>
>
> @@ -109,6 +110,8 @@
> }
>
> void output_vis_init(log_level level, u8_t *mac) {
> + umask(000);
> +
> loglevel = level;
>
> sprintf(vis_shm_path, "/squeezelite-%02x:%02x:%02x:%02x:%02x:%02x", mac[0],
mac[1], mac[2], mac[3], mac[4], mac[5]);
> @@ -134,6 +137,8 @@
> LOG_WARN("unable to open visualizer shared memory");
> vis_mmap = NULL;
> }
> +
> + umask(002);
> }
>
> #endif // VISEXPORT
>
--------------------
> >
Thanks for looking at this. I tried your patch, but it doesn't seem to
remove the requirement for squeezelite itself to have root to get a
positive address for the shared memory pointer as tested in the next if
statement.
Code:
--------------------
if (vis_mmap > 0) {
pthread_rwlockattr_t attr;
pthread_rwlocka
--------------------
In other words, I still see the following after patching and recompiling
unless I use sudo with it:
Code:
--------------------
[fedora@wandquad squeezelite]$ ./squeezelite -v -o plughw:CARD=UD501 -a
40::::1
[07:38:46.523984] output_vis_init:137 unable to open visualizer shared memory
--------------------
Again, thanks for paying such quick attention, I know there are too many
other things that demand your time right now!
----------------------
"Dreamer, easy in the chair that really fits you..."
------------------------------------------------------------------------
dsdreamer's Profile: http://forums.slimdevices.com/member.php?userid=12588
View this thread: http://forums.slimdevices.com/showthread.php?t=99395
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix