On Sun, 02 Feb 2025 16:33:10 +0100,
Stefan Hagen <sh+openbsd-po...@codevoid.de> wrote:
> 
> Kirill A. Korinsky wrote (2025-02-02 12:45 CET):
> > On Sun, 02 Feb 2025 11:40:16 +0100,
> > Stefan Hagen <sh+openbsd-po...@codevoid.de> wrote:
> > > 
> > > Hi,
> > > 
> > > mocp crashes when trying to play a web stream:
> > > 
> > > Feb  2 11:38:05.187035: 
> > > /usr/obj/ports/moc-2.6alpha3/mocp-fb0a63b564b40fa861204e2f804b696c6ee573da/io_curl.c:328
> > >  curl_read_internal(): Starting curl...
> > > Feb  2 11:38:05.187360: 
> > > /usr/obj/ports/moc-2.6alpha3/mocp-fb0a63b564b40fa861204e2f804b696c6ee573da/io_curl.c:351
> > >  curl_read_internal(): Doing pselect()...
> > > mocp[93617]: pledge "dns", syscall 97
> > > Abort trap
> > > 
> > > Thus, adding the "dns" pledge with the patch below.
> > > 
> > > OK?
> > >
> > 
> > an attempt to run it with your patch as mocp -D -p http://... fails as:
> > 
> >         mocp[72461]: pledge "flock", syscall 92
> >         Abort trap (core dumped) 
> > 
> > shall you add it as well?
> 
> Sure.
>

It doesn't help, but this one helps.

So, I'm OK with this version.

Index: audio/moc/Makefile
===================================================================
RCS file: /home/cvs/ports/audio/moc/Makefile,v
diff -u -p -r1.34 Makefile
--- audio/moc/Makefile  28 Nov 2024 08:16:37 -0000      1.34
+++ audio/moc/Makefile  2 Feb 2025 15:37:37 -0000
@@ -3,6 +3,7 @@ COMMENT =       console audio player
 DIST_TUPLE+=   gitlab tomaszg mocp fb0a63b564b40fa861204e2f804b696c6ee573da .
 PKGNAME =      moc-2.6alpha3
 CATEGORIES =   audio
+REVISION =     0
 
 # GPLv3+
 PERMIT_PACKAGE = Yes
Index: audio/moc/patches/patch-main_c
===================================================================
RCS file: /home/cvs/ports/audio/moc/patches/patch-main_c,v
diff -u -p -r1.5 patch-main_c
--- audio/moc/patches/patch-main_c      25 Nov 2024 11:26:07 -0000      1.5
+++ audio/moc/patches/patch-main_c      2 Feb 2025 15:46:44 -0000
@@ -8,7 +8,7 @@ Index: main.c
        if (params->foreground) {
                set_me_server ();
                server_init (params->debug, params->foreground);
-+              if (pledge("stdio rpath wpath cpath inet unix audio", NULL) == 
-1)
++              if (pledge("stdio rpath wpath cpath inet dns unix audio", NULL) 
== -1)
 +                      fatal ("pledge() failed: %s", strerror(errno));
                server_loop ();
                return;
@@ -17,7 +17,7 @@ Index: main.c
                case 0: /* child - start server */
                        set_me_server ();
                        server_init (params->debug, params->foreground);
-+                      if (pledge("stdio rpath wpath cpath inet unix audio", 
NULL) == -1)
++                      if (pledge("stdio rpath wpath cpath inet dns unix 
audio", NULL) == -1)
 +                              fatal ("pledge() failed: %s", strerror(errno));
                        rc = write (notify_pipe[1], &i, sizeof(i));
                        if (rc < 0)
@@ -51,7 +51,7 @@ Index: main.c
                start_moc (&params, args);
 -      else
 +      else {
-+              if (pledge("cpath rpath stdio unix", NULL) == -1)
++              if (pledge("cpath rpath stdio flock unix", NULL) == -1)
 +                      fatal ("pledge() failed: %s", strerror(errno));
                server_command (&params, args);
 +      }



-- 
wbr, Kirill

Reply via email to