- Added patch for pysmbc changes in git to prevent getdents crashing (bug

#465975).
This commit is contained in:
Tim Waugh 2008-10-17 09:12:59 +00:00
parent 5020567680
commit 4efc2732a0
2 changed files with 113 additions and 1 deletions

105
pysmbc-git.patch Normal file
View File

@ -0,0 +1,105 @@
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@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@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

View File

@ -7,7 +7,7 @@
Summary: A printer administration tool Summary: A printer administration tool
Name: system-config-printer Name: system-config-printer
Version: 1.0.8 Version: 1.0.8
Release: 6%{?dist} Release: 7%{?dist}
License: GPLv2+ License: GPLv2+
URL: http://cyberelk.net/tim/software/system-config-printer/ URL: http://cyberelk.net/tim/software/system-config-printer/
Group: System Environment/Base Group: System Environment/Base
@ -15,6 +15,7 @@ Source0: http://cyberelk.net/tim/data/system-config-printer/1.0.x/system-config-
Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2 Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2
Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2 Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2
Patch1: system-config-printer-1.0.x.patch Patch1: system-config-printer-1.0.x.patch
Patch2: pysmbc-git.patch
BuildRequires: cups-devel >= 1.2 BuildRequires: cups-devel >= 1.2
BuildRequires: python-devel >= 2.4 BuildRequires: python-devel >= 2.4
@ -62,6 +63,8 @@ the configuration tool.
%prep %prep
%setup -q -a 1 -a 2 %setup -q -a 1 -a 2
%patch1 -p1 -z .1.0.x %patch1 -p1 -z .1.0.x
cd pysmbc-%{pysmbc_version}
%patch2 -p1 -z .git
%build %build
%configure %configure
@ -151,6 +154,10 @@ rm -rf %buildroot
exit 0 exit 0
%changelog %changelog
* Fri Oct 17 2008 Tim Waugh <twaugh@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@redhat.com> 1.0.8-6 * Thu Oct 16 2008 Tim Waugh <twaugh@redhat.com> 1.0.8-6
- Updated patch for 1.0.x changes: - Updated patch for 1.0.x changes:
- Fixed SMB authentication dialog's cancel button (bug #467127). - Fixed SMB authentication dialog's cancel button (bug #467127).