{"dmalloc-mark", MSG_REQ_DMALLOC_MARK },
{"dmalloc-log-changed", MSG_REQ_DMALLOC_LOG_CHANGED },
{"shutdown", MSG_SHUTDOWN },
- {"change_id", MSG_PRINTER_DRVUPGRADE},
+ {"drvupgrade", MSG_PRINTER_DRVUPGRADE},
{NULL, -1}
};
#define MAX_WAIT 10
+/* we need these because we link to printing*.o */
+
+void become_root(void) {}
+void unbecome_root(void) {}
+
+
static void usage(BOOL doexit)
{
int i;
int i, n, v;
int mtype;
BOOL retval=False;
+ BOOL check_notify_msgs = False;
mtype = parse_type(msg_name);
if (mtype == -1) {
break;
/* Send a notification message to a printer */
- /* NB. None of these currently work due to changes in the printing notify mechanisms. */
-#if 0
case MSG_PRINTER_NOTIFY2: {
char *cmd;
cmd = params[0];
+ check_notify_msgs = True;
+
/* Pause a print queue */
if (strequal(cmd, "queuepause")) {
notify_job_status_byname(
params[1], jobid, JOB_STATUS_PAUSED,
SPOOLSS_NOTIFY_MSG_UNIX_JOBID);
+ break;
}
/* Resume a print job */
notify_job_status_byname(
params[1], jobid, JOB_STATUS_QUEUED,
SPOOLSS_NOTIFY_MSG_UNIX_JOBID);
+ break;
}
/* Delete a print job */
JOB_STATUS_DELETED,
SPOOLSS_NOTIFY_MSG_UNIX_JOBID);
}
-
+
+ /* printer change notify */
+
+ if (strequal(cmd, "printer")) {
+ int attribute = -1;
+
+ if (!params[1] || !params[2] || !params[3]) {
+ fprintf(stderr, "printer command requires an and attribute name and value!\n");
+ fprintf(stderr, "supported attributes:\n");
+ fprintf(stderr, "\tcomment:\n");
+ fprintf(stderr, "\tport:\n");
+ fprintf(stderr, "\tdriver:\n");
+ return False;
+ }
+ if ( strequal(params[2], "comment") )
+ attribute = PRINTER_NOTIFY_COMMENT;
+ else if ( strequal(params[2], "port") )
+ attribute = PRINTER_NOTIFY_PORT_NAME;
+ else if ( strequal(params[2], "driver") )
+ attribute = PRINTER_NOTIFY_DRIVER_NAME;
+
+ if ( attribute == -1 ) {
+ fprintf(stderr, "bad attribute!\n");
+ return False;
+ }
+
+ notify_printer_byname( params[1], attribute, params[3]);
+
+ break;
+ }
+
break;
}
-#endif
+
case MSG_SMB_FORCE_TDIS:
if (!strequal(dest, "smbd")) {
break;
}
+ /* check if we have any pending print notify messages */
+
+ if ( check_notify_msgs )
+ print_notify_send_messages();
+
return (True);
}