Bug 421

Summary: fork() within Xprt may require to flush files/sockets...
Product: xprint Reporter: Roland Mainz <roland.mainz>
Component: Server: Spooler support: OtherAssignee: Roland Mainz <roland.mainz>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: high CC: alan.coopersmith, jay.hobson, MostAwesomedude
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Roland Mainz 2004-04-07 16:26:03 UTC
Looking at
http://xprint.freedesktop.org/cgi-bin/viewcvs.cgi/*checkout*/xprint/xprint/src/xprint_main/xc/programs/Xserver/Xprint/attributes.c?content-type=text%2Fplain&rev=1.5

The code calls |fork()| but doesn't |flush()| any files/sockets etc. before
doing that
-- snip --
/*
 * ExecuteCommand takes two pointers - the command to execute,
 * and the "argv" style NULL-terminated vector of arguments for the command.
 * We wait for the command to terminate before continuing to ensure that
 * we don't delete the job file before the spooler has made a copy.
 */
static void
ExecCommand(pCommand, argVector)
    char *pCommand;
    char **argVector;
{
    pid_t childPid;
    int status;

    if((childPid = fork()) == 0)
    {
        /* return BadAlloc? */
        if (execv(pCommand, argVector) == -1) {
            FatalError("unable to exec '%s'", pCommand);
        }
    }
    else
    {
        (void) waitpid(childPid, &status, 0);
    }
    return;
}
-- snip --

I've seen some complains about problems when printing with some spoolers, the
error message on the client side was |Xlib: unexpected async reply (sequence
0x4000)!|.

Alan:
Is it possible that calling |fork()| may require to flush the streams/files/etc.
before calling it to prevent that the child process may flush cloned data back
to the client ?
Comment 1 Corbin Simpson 2011-09-13 12:16:14 UTC
Closing WONTFIX because nobody cares about Xprint. Reopen if you plan to address this bug.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.