r1295: To be able to send a message to the background queue updated, we need to be
authorVolker Lendecke <vlendec@samba.org>
Tue, 29 Jun 2004 15:42:00 +0000 (15:42 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:04 +0000 (10:52 -0500)
root. Otherwise the USR1 signal will not be delivered.

Volker

source/printing/printing.c

index 5814182b2587e1dcecc8c6bec2dc2b02aa9a85a6..8beea9d0cec91334b33509b311530f5c236891d4 100644 (file)
@@ -1231,9 +1231,13 @@ static void print_queue_update(int snum)
         * Otherwise just do the update ourselves 
         */
           
-       if ( background_lpq_updater_pid != -1 )
-               message_send_pid(background_lpq_updater_pid, MSG_PRINTER_UPDATE, &snum, sizeof(snum), False);
-       else
+       if ( background_lpq_updater_pid != -1 ) {
+               become_root();
+               message_send_pid(background_lpq_updater_pid,
+                                MSG_PRINTER_UPDATE, &snum, sizeof(snum),
+                                False);
+               unbecome_root();
+       } else
                print_queue_update_internal( snum );
 }