Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37732856
en ru br
ALT Linux repositórios
S:2.4.7-alt1
5.0: 1.3.10-alt1
4.1: 1.3.10-alt0.M41.4
+updates:1.3.9-alt1.M41.1
4.0: 1.2.12-alt6.M40.9
+updates:1.2.12-alt6.M40.8
3.0: 1.1.20-alt14.1

Group :: Sistema/Servidores
RPM: cups

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: cups-1.3.2-alt-izvrat.patch
Download


diff -Naur cups-1.3.2.orig/cups/usersys.c cups-1.3.2/cups/usersys.c
--- cups-1.3.2.orig/cups/usersys.c	2007-07-12 01:46:42 +0400
+++ cups-1.3.2/cups/usersys.c	2007-09-28 18:41:37 +0400
@@ -154,6 +154,26 @@
   _cupsGlobals()->encryption = e;
 }
 
+static
+int socket_access(const char* name)
+{
+	struct sockaddr_un s_un;
+	int sock = -1;
+	int ret = 0;
+
+	bzero(&s_un, sizeof(s_un));
+
+	strncpy(s_un.sun_path, name,sizeof s_un.sun_path);
+	s_un.sun_family = AF_UNIX;
+
+	if (((sock = socket(AF_UNIX, SOCK_STREAM, 0)) > 0) &&
+	    (connect(sock, (struct sockaddr *)&s_un,SUN_LEN(&s_un)) == 0))
+	       ret = 1;
+	
+	if (sock >= 0) close(sock);
+	return ret;
+}
+
 
 /*
  * 'cupsServer()' - Return the hostname/address of the default server.
@@ -201,8 +221,7 @@
       * domain socket if it exists and has the right permissions...
       */
 
-      if (!stat(CUPS_DEFAULT_DOMAINSOCKET, &sockinfo) &&
-          (sockinfo.st_mode & S_IRWXO) == S_IRWXO)
+      if (socket_access(CUPS_DEFAULT_DOMAINSOCKET))
         server = CUPS_DEFAULT_DOMAINSOCKET;
       else
 #endif /* CUPS_DEFAULT_DOMAINSOCKET */
@@ -236,6 +255,9 @@
       }
     }
 
+/* don't mix set and get operations, otherwise we will have a problems in sequence like:
+   getCups, setuid, getCups */
+#if 0
    /*
     * Copy the server name over and set the port number, if any...
     */
@@ -257,6 +279,8 @@
       strcpy(cg->servername, "localhost");
     else
       strlcpy(cg->servername, cg->server, sizeof(cg->servername));
+#endif
+    return server;
   }
 
   return (cg->server);
diff -Naur cups-1.3.2.orig/scheduler/listen.c cups-1.3.2/scheduler/listen.c
--- cups-1.3.2.orig/scheduler/listen.c	2007-08-13 21:20:14 +0400
+++ cups-1.3.2/scheduler/listen.c	2007-09-28 18:41:45 +0400
@@ -304,7 +304,11 @@
       cupsdLogMessage(CUPSD_LOG_INFO, "Listening to %s on fd %d...",
         	      s, lis->fd);
 
-      if (chmod(s, 0140777))
+      if (chmod(s, 0770))
+	cupsdLogMessage(CUPSD_LOG_ERROR,
+			"Unable to change permisssions on domain socket "
+			"\"%s\" - %s", s, strerror(errno));
+      if (chown(s, 0,Group))
 	cupsdLogMessage(CUPSD_LOG_ERROR,
 			"Unable to change permisssions on domain socket "
 			"\"%s\" - %s", s, strerror(errno));
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009