Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no need for OpenBSD posix_spawn workaround anymore #4526

Closed
michaelrsweet opened this issue Nov 16, 2014 · 4 comments
Closed

no need for OpenBSD posix_spawn workaround anymore #4526

michaelrsweet opened this issue Nov 16, 2014 · 4 comments

Comments

@michaelrsweet
Copy link
Collaborator

Version: 2.0.1
CUPS.org User: ajacoutot

Hi Michael.

str4496 added a workaround for a bug in OpenBSD posix_spawn which has
since been fixed:
http://anoncvs.estpak.ee/cgi-bin/cgit/openbsd-src/commit/?id=f763ac77721519f204bd4080d21ea60ecc421e3b

The workaround is not needed anymore, I can confirm everything works
beautifully and cups 2.0.1 (with the workaround reverted) is now part of
the OpenBSD ports tree. So I think it should be reverted in svn.
Thanks.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Antoine,

Is there a version check we can add for this? I'd gate to leave existing OpenBSD users unable to use the latest CUPS separate from this update.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: ajacoutot

Hi Michael.

You can do something like this, but it's not a very precise check:
(it will match the next OpenBSD release: 5.7 -- but will not match current where the bug is fixed)

#include <sys/param.h>
#if defined(OpenBSD) && OpenBSD < 201505

That said, I am not sure it's worth it as I'm not aware of any OpenBSD users running CUPS from source (without using patches from the cups port).
Anyway that is you call :-)
Thank you for getting to back on this.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"str4526.patch":

Index: scheduler/process.c

--- scheduler/process.c (revision 12463)
+++ scheduler/process.c (working copy)
@@ -26,6 +26,15 @@

include <spawn.h>

extern char *environ;
#endif /
HAVE_POSIX_SPAWN /
+#ifdef HAVE_POSIX_SPAWN
+# if !defined(OpenBSD) || OpenBSD >= 201505
+# define USE_POSIX_SPAWN 1
+# else
+# define USE_POSIX_SPAWN 0
+# endif /
!OpenBSD || /
+#else
+# define USE_POSIX_SPAWN 0
+#endif /
HAVE_POSIX_SPAWN */

/*
@@ -468,13 +477,13 @@
nice_str[16]; /* FilterNice string /
uid_t user; /
Command UID /
cupsd_proc_t *proc; /
New process record /
-#if defined(HAVE_POSIX_SPAWN) && !defined(OpenBSD)
+#if USE_POSIX_SPAWN
posix_spawn_file_actions_t actions; /
Spawn file actions /
posix_spawnattr_t attrs; /
Spawn attributes /
sigset_t defsignals; /
Default signals /
#elif defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /
POSIX signal handler /
-#endif /
HAVE_POSIX_SPAWN && !OpenBSD /
+#endif /
USE_POSIX_SPAWN /
#if defined(APPLE)
char processPath[1024], /
CFProcessPath environment variable /
linkpath[1024]; /
Link path for symlinks... */
@@ -538,9 +547,9 @@

  • Use helper program when we have a sandbox profile...
    */

-#if !defined(HAVE_POSIX_SPAWN) || defined(OpenBSD)
+#if !USE_POSIX_SPAWN
if (profile)
-#endif /* !HAVE_POSIX_SPAWN || OpenBSD /
+#endif /
!USE_POSIX_SPAWN */
{
snprintf(cups_exec, sizeof(cups_exec), "%s/daemon/cups-exec", ServerBin);
snprintf(user_str, sizeof(user_str), "%d", user);
@@ -576,7 +585,7 @@
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdStartProcess: argv[%d] = "%s"", i, argv[i]);
}

-#if defined(HAVE_POSIX_SPAWN) && !defined(OpenBSD) /* OpenBSD posix_spawn is busted with SETSIGDEF /
+#if USE_POSIX_SPAWN
/

  • Setup attributes and file actions for the spawn...
    */
    @@ -799,7 +808,7 @@
    }

    cupsdReleaseSignals();
    -#endif /* HAVE_POSIX_SPAWN && !OpenBSD /
    +#endif /
    USE_POSIX_SPAWN */

    if (*pid)
    {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant