rpms/system-config-printer/devel pysmbc-git.patch, NONE, 1.1 system-config-printer.spec, 1.223, 1.224

Tim Waugh twaugh at fedoraproject.org
Fri Oct 17 09:13:29 UTC 2008


Author: twaugh

Update of /cvs/pkgs/rpms/system-config-printer/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32753

Modified Files:
	system-config-printer.spec 
Added Files:
	pysmbc-git.patch 
Log Message:
* Fri Oct 17 2008 Tim Waugh <twaugh at redhat.com> 1.0.8-7
- Added patch for pysmbc changes in git to prevent getdents crashing
  (bug #465975).


pysmbc-git.patch:

--- NEW FILE pysmbc-git.patch ---
diff -U0 pysmbc-1.0.5/ChangeLog.git pysmbc-1.0.5/ChangeLog
--- pysmbc-1.0.5/ChangeLog.git	2008-08-29 10:33:35.000000000 +0100
+++ pysmbc-1.0.5/ChangeLog	2008-10-17 10:10:28.000000000 +0100
@@ -0,0 +1,11 @@
+2008-10-17  Tim Waugh  <twaugh at redhat.com>
+
+	* dir.c (Dir_getdents): Fixed crash when getdents provides more
+	than one batch of entries (bug #465975).
+
+2008-10-08  Tim Waugh  <twaugh at redhat.com>
+
+	* test.py (Browser.__init__): Prevent unbound local variable
+	traceback when the auth dialog is cancelled.
+	(Browser.row_expanded): Likewise.
+
diff -up pysmbc-1.0.5/dir.c.git pysmbc-1.0.5/dir.c
--- pysmbc-1.0.5/dir.c.git	2008-06-09 13:19:54.000000000 +0100
+++ pysmbc-1.0.5/dir.c	2008-10-17 10:10:28.000000000 +0100
@@ -114,12 +114,10 @@ Dir_getdents (Dir *self)
   SMBCCTX *ctx;
   char dirbuf[1024];
   smbc_getdents_fn fn;
-  struct smbc_dirent *dirp;
   int dirlen;
 
   debugprintf ("-> Dir_getdents()\n");
   ctx = self->context->context;
-  dirp = (struct smbc_dirent *) dirbuf;
   listobj = PyList_New (0);
   fn = smbc_getFunctionGetdents (ctx);
   errno = 0;
@@ -127,6 +125,8 @@ Dir_getdents (Dir *self)
 			  (struct smbc_dirent *) dirbuf,
 			  sizeof (dirbuf))) != 0)
     {
+      struct smbc_dirent *dirp;
+
       debugprintf ("dirlen = %d\n", dirlen);
       if (dirlen < 0)
 	{
@@ -136,6 +136,7 @@ Dir_getdents (Dir *self)
 	  return NULL;
 	}
 
+      dirp = (struct smbc_dirent *) dirbuf;
       while (dirlen > 0)
 	{
 	  PyObject *dent;
diff -up pysmbc-1.0.5/test.py.git pysmbc-1.0.5/test.py
--- pysmbc-1.0.5/test.py.git	2008-05-21 17:04:07.000000000 +0100
+++ pysmbc-1.0.5/test.py	2008-10-17 10:10:28.000000000 +0100
@@ -146,6 +146,7 @@ class Browser:
         ctx.optionNoAutoAnonymousLogin = True
         self.smbc = ctx
         self.auth = AuthContext (w)
+        workgroups = None
         try:
             while self.auth.perform_authentication () > 0:
                 try:
@@ -153,9 +154,7 @@ class Browser:
                 except Exception, e:
                     self.auth.failed (e)
         except RuntimeError, (e, s):
-            if e == errno.ENOENT:
-                workgroups = None
-            else:
+            if e != errno.ENOENT:
                 raise
 
         if workgroups:
@@ -201,6 +200,7 @@ class Browser:
 
             uri = "smb://%s" % entry.name
             self.auth = AuthContext (self.main)
+            servers = None
             try:
                 while self.auth.perform_authentication () > 0:
                     try:
@@ -208,9 +208,7 @@ class Browser:
                     except Exception, e:
                         self.auth.failed (e)
             except RuntimeError, (e, s):
-                if e == errno.ENOENT:
-                    servers = None
-                else:
+                if e != errno.ENOENT:
                     raise
 
             if servers:
@@ -235,6 +233,7 @@ class Browser:
             uri = "smb://%s" % entry.name
 
             self.auth = AuthContext (self.main)
+            shares = None
             try:
                 while self.auth.perform_authentication () > 0:
                     try:
@@ -242,7 +241,6 @@ class Browser:
                     except Exception, e:
                         self.auth.failed (e)
             except RuntimeError, (e, s):
-                shares = None
                 if e != errno.EACCES and e != errno.EPERM:
                     del self.expanding_row
                     raise


Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/devel/system-config-printer.spec,v
retrieving revision 1.223
retrieving revision 1.224
diff -u -r1.223 -r1.224
--- system-config-printer.spec	16 Oct 2008 09:35:30 -0000	1.223
+++ system-config-printer.spec	17 Oct 2008 09:12:59 -0000	1.224
@@ -7,7 +7,7 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 1.0.8
-Release: 6%{?dist}
+Release: 7%{?dist}
 License: GPLv2+
 URL: http://cyberelk.net/tim/software/system-config-printer/
 Group: System Environment/Base
@@ -15,6 +15,7 @@
 Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2
 Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2
 Patch1: system-config-printer-1.0.x.patch
+Patch2: pysmbc-git.patch
 
 BuildRequires: cups-devel >= 1.2
 BuildRequires: python-devel >= 2.4
@@ -62,6 +63,8 @@
 %prep
 %setup -q -a 1 -a 2
 %patch1 -p1 -z .1.0.x
+cd pysmbc-%{pysmbc_version}
+%patch2 -p1 -z .git
 
 %build
 %configure
@@ -151,6 +154,10 @@
 exit 0
 
 %changelog
+* Fri Oct 17 2008 Tim Waugh <twaugh at redhat.com> 1.0.8-7
+- Added patch for pysmbc changes in git to prevent getdents crashing
+  (bug #465975).
+
 * Thu Oct 16 2008 Tim Waugh <twaugh at redhat.com> 1.0.8-6
 - Updated patch for 1.0.x changes:
   - Fixed SMB authentication dialog's cancel button (bug #467127).




More information about the scm-commits mailing list