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

errors occurred when there is no HAVE_POSIX_SPAWN definition #4510

Closed
michaelrsweet opened this Issue Oct 28, 2014 · 5 comments

Comments

Projects
None yet
1 participant
@michaelrsweet
Copy link
Collaborator

michaelrsweet commented Oct 28, 2014

Version: 2.0-current
CUPS.org User: tommy

Making all in cups...
Making all in test...
Making all in filter...
Making all in backend...
Making all in berkeley...
Making all in cgi-bin...
Making all in monitor...
Making all in notifier...
Making all in ppdc...
Making all in scheduler...
make[5]: Entering directory '/home/tommy/cups-2.0.0/scheduler'
Compiling process.c...
process.c: In function �cupsdStartProcess�:
process.c:542:14: error: �user_str� undeclared (first use in this function)
process.c:542:14: note: each undeclared identifier is reported only once for each function it appears in
process.c:543:14: error: �group_str� undeclared (first use in this function)
process.c:544:14: error: �nice_str� undeclared (first use in this function)
At top level:
cc1: warning: unrecognized command line option "-Wno-tautological-compare"
../Makedefs:248: recipe for target 'process.o' failed
make[5]: *** [process.o] Error 1

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Oct 28, 2014

CUPS.org User: tommy

my solution:

[tommy@alfread scheduler]$ diff process.c process.c.fix
541a542

#ifdef HAVE_POSIX_SPAWN
545c546

<

#endif
547a549,550

#ifdef HAVE_POSIX_SPAWN
555c558,561

<

#else
real_argv[2] = profile ? profile : "none";
real_argv[3] = (char *)command;
#endif

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Oct 28, 2014

CUPS.org User: mike

Current CUPS requires POSIX conformance for Unix operating systems. What OS and compiler are you using?

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Oct 28, 2014

CUPS.org User: tommy

I'm using arm-linux-gcc cross compile for arm.
Seems it will cause compile issue if HAVE_POSIX_SPAWN not define.
So I try to handle it while POSIX not supported.
Just make it more tolerant.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Nov 12, 2014

CUPS.org User: mike

Fixed in Subversion repository.

Your proposed fix was incorrect and would cause filters to run as root... The correct "fix" is attached, although longer term we will no longer support non-POSIX systems.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Nov 12, 2014

"str4510.patch":

Index: scheduler/process.c

--- scheduler/process.c (revision 12243)
+++ scheduler/process.c (working copy)
@@ -459,15 +459,15 @@
int i; /* Looping var /
const char *exec_path = command; /
Command to be exec'd /
char *real_argv[110], /
Real command-line arguments */

  •   cups_exec[1024];    /\* Path to "cups-exec" program */
    
  •   cups_exec[1024],    /\* Path to "cups-exec" program */
    
  •   user_str[16],       /\* User string */
    
  •   group_str[16],      /\* Group string */
    
  •   nice_str[16];       /\* FilterNice string _/
    
    uid_t user; /_ Command UID /
    cupsd_proc_t *proc; /
    New process record /
    #ifdef HAVE_POSIX_SPAWN
    posix_spawn_file_actions_t actions; /
    Spawn file actions /
    posix_spawnattr_t attrs; /
    Spawn attributes */
  • char user_str[16], /* User string */
  •   group_str[16],      /\* Group string */
    
  •   nice_str[16];       /\* FilterNice string _/
    
    #elif defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
    struct sigaction action; /_ POSIX signal handler /
    #endif /
    HAVE_POSIX_SPAWN */

@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.