Patch to printing.c to add log message if permissions wrong.

David Collier-Brown davecb at canada.sun.com
Thu Feb 15 17:23:29 GMT 2001


This change to 2.2.0 alpha 1 adds log messages when the spool-file
open fails, and logs a common installation error (insufficient
permission to write to the spool) at a high priority. 

--dave


--- -   Thu Feb 15 12:16:32 2001
+++ printing/printing.c  Thu Feb 15 12:16:28 2001
@@ -866,7 +866,23 @@
                goto next_jobnum;
        }
        pjob.fd =
sys_open(pjob.filename,O_WRONLY|O_CREAT|O_EXCL,0600);
-       if (pjob.fd == -1) goto fail;
+       if (pjob.fd == -1) {
+               if (errno == EACCES) {
+                       /* Common setup error, force a report. */
+                       DEBUG(0, ("print_job_start: insufficient
permissions "
+                                 "to open spool file %s.\n",
+                                 pjob.filename));
+               }
+               else {
+                       /* Normal case, report at level 3 and above.
*/
+                       DEBUG(3, ("print_job_start: can't open spool "
+                                 "file %s,\n",
+                                 pjob.filename));
+                       DEBUGADD(3, ("errno = %d (%s).\n", errno, 
+                                    strerror(errno)));
+               }
+               goto fail;
+       }
 
        print_job_store(jobid, &pjob);




More information about the samba-technical mailing list