]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/listen.c
Load cups into easysw/current.
[thirdparty/cups.git] / scheduler / listen.c
index d5b9ea579a1f832dec63c7563019d6cc4d823c65..42e1d3e0aa1275c6c1fb54a992ff227f86ff38d1 100644 (file)
@@ -1,10 +1,10 @@
 /*
- * "$Id: listen.c 5041 2006-02-01 16:54:50Z mike $"
+ * "$Id: listen.c 5053 2006-02-02 18:14:38Z mike $"
  *
  *   Server listening routines for the Common UNIX Printing System (CUPS)
  *   scheduler.
  *
- *   Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -293,10 +293,17 @@ cupsdStartListening(void)
                       "cupsdStartListening: Listening to %s:%d on fd %d...",
                      s, p, lis->fd);
     else
+    {
       cupsdLogMessage(CUPSD_LOG_INFO,
                       "cupsdStartListening: Listening to %s on fd %d...",
                      s, lis->fd);
 
+      if (chmod(s, 0140777))
+       cupsdLogMessage(CUPSD_LOG_ERROR,
+                       "cupsdStartListening: Unable to change permisssions on "
+                       "domain socket \"%s\" - %s", s, strerror(errno));
+    }
+
    /*
     * Save the first port that is bound to the local loopback or
     * "any" address...
@@ -372,7 +379,7 @@ cupsdStartListening(void)
 void
 cupsdStopListening(void)
 {
-  int          i;              /* Looping var */
+  int                  i;              /* Looping var */
   cupsd_listener_t     *lis;           /* Current listening socket */
 
 
@@ -392,11 +399,15 @@ cupsdStopListening(void)
 #endif /* WIN32 */
 
 #ifdef AF_LOCAL
-   /*
-    * Remove domain sockets...
-    */
+     /*
+      * Remove domain sockets...
+      */
 
+#  ifdef HAVE_LAUNCH_H
+      if (lis->address.addr.sa_family == AF_LOCAL && !Launchd)
+#  else
       if (lis->address.addr.sa_family == AF_LOCAL)
+#  endif /* HAVE_LAUNCH_H */
        unlink(lis->address.un.sun_path);
 #endif /* AF_LOCAL */
     }
@@ -405,5 +416,5 @@ cupsdStopListening(void)
 
 
 /*
- * End of "$Id: listen.c 5041 2006-02-01 16:54:50Z mike $".
+ * End of "$Id: listen.c 5053 2006-02-02 18:14:38Z mike $".
  */