| 32 | */ |
| 33 | |
| 34 | void |
| 35 | cupsdStartServer(void) |
| 36 | { |
| 37 | /* |
| 38 | * Create the default security profile... |
| 39 | */ |
| 40 | |
| 41 | DefaultProfile = cupsdCreateProfile(0, 1); |
| 42 | |
| 43 | #ifdef HAVE_SANDBOX_H |
| 44 | if (!DefaultProfile && UseSandboxing && Sandboxing != CUPSD_SANDBOXING_OFF) |
| 45 | { |
| 46 | /* |
| 47 | * Failure to create the sandbox profile means something really bad has |
| 48 | * happened and we need to shutdown immediately. |
| 49 | */ |
| 50 | |
| 51 | return; |
| 52 | } |
| 53 | #endif /* HAVE_SANDBOX_H */ |
| 54 | |
| 55 | /* |
| 56 | * Start color management (as needed)... |
| 57 | */ |
| 58 | |
| 59 | cupsdStartColor(); |
| 60 | |
| 61 | /* |
| 62 | * Startup all the networking stuff... |
| 63 | */ |
| 64 | |
| 65 | cupsdStartListening(); |
| 66 | cupsdStartBrowsing(); |
| 67 | |
| 68 | /* |
| 69 | * Create a pipe for CGI processes... |
| 70 | */ |
| 71 | |
| 72 | if (cupsdOpenPipe(CGIPipes)) |
| 73 | cupsdLogMessage(CUPSD_LOG_ERROR, |
| 74 | "cupsdStartServer: Unable to create pipes for CGI status!"); |
| 75 | else |
| 76 | { |
| 77 | CGIStatusBuffer = cupsdStatBufNew(CGIPipes[0], "[CGI]"); |
| 78 | |
| 79 | cupsdAddSelect(CGIPipes[0], (cupsd_selfunc_t)cupsdUpdateCGI, NULL, NULL); |
| 80 | } |
| 81 | |
| 82 | /* |
| 83 | * Mark that the server has started and printers and jobs may be changed... |
| 84 | */ |
| 85 | |
| 86 | LastEvent = CUPSD_EVENT_PRINTER_CHANGED | CUPSD_EVENT_JOB_STATE_CHANGED | |
| 87 | CUPSD_EVENT_SERVER_STARTED; |
| 88 | started = 1; |
| 89 | |
| 90 | cupsdSetBusyState(0); |
| 91 | } |
no test coverage detected