Hello community,
here is the log from the commit of package python-smbc for openSUSE:Factory checked in at 2012-02-16 15:00:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-smbc (Old)
and /work/SRC/openSUSE:Factory/.python-smbc.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-smbc", Maintainer is "gnome-maintainers@suse.de"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-smbc/python-smbc.changes 2011-12-21 10:03:19.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python-smbc.new/python-smbc.changes 2012-02-16 15:02:05.000000000 +0100
@@ -1,0 +2,7 @@
+Wed Feb 15 20:13:29 UTC 2012 - dimstar@opensuse.org
+
+- Update to version 1.0.13:
+ + Call initial libsmbclient functions in right order.
+ + Memory/connection leaks.
+
+-------------------------------------------------------------------
Old:
----
pysmbc-1.0.12.tar.bz2
New:
----
pysmbc-1.0.13.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-smbc.spec ++++++
--- /var/tmp/diff_new_pack.l4a58N/_old 2012-02-16 15:02:07.000000000 +0100
+++ /var/tmp/diff_new_pack.l4a58N/_new 2012-02-16 15:02:07.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-smbc
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
BuildRequires: libsmbclient-devel
BuildRequires: python-devel
BuildRequires: python3-devel
-Version: 1.0.12
+Version: 1.0.13
Release: 0
# FIXME: once we have proper macros for python3 packaging, build a python3-smbc subpackage
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ pysmbc-1.0.12.tar.bz2 -> pysmbc-1.0.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.12/PKG-INFO new/pysmbc-1.0.13/PKG-INFO
--- old/pysmbc-1.0.12/PKG-INFO 2011-12-09 16:23:42.000000000 +0100
+++ new/pysmbc-1.0.13/PKG-INFO 2012-02-15 17:17:46.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: pysmbc
-Version: 1.0.12
+Version: 1.0.13
Summary: Python bindings for libsmbclient
Home-page: http://cyberelk.net/tim/software/pysmbc/
Author: ['Tim Waugh ', 'Tsukasa Hamano ']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.12/context.c new/pysmbc-1.0.13/context.c
--- old/pysmbc-1.0.12/context.c 2011-06-09 11:40:51.000000000 +0200
+++ new/pysmbc-1.0.13/context.c 2012-02-15 13:00:15.000000000 +0100
@@ -1,6 +1,6 @@
/* -*- Mode: C; c-file-style: "gnu" -*-
* pysmbc - Python bindings for libsmbclient
- * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2011 Red Hat, Inc
+ * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2011, 2012 Red Hat, Inc
* Copyright (C) 2010 Open Source Solution Technology Corporation
* Copyright (C) 2010 Patrick Geltinger
* Authors:
@@ -109,7 +109,7 @@
PyObject *auth = NULL;
int debug = 0;
SMBCCTX *ctx;
- static char *kwlist[] =
+ static char *kwlist[] =
{
"auth_fn",
"debug",
@@ -117,9 +117,10 @@
};
if (!PyArg_ParseTupleAndKeywords (args, kwds, "|Oi", kwlist,
- &auth, &debug)){
- return -1;
- }
+ &auth, &debug))
+ {
+ return -1;
+ }
if (auth)
{
@@ -144,6 +145,13 @@
return -1;
}
+ smbc_setDebug (ctx, debug);
+
+ self->context = ctx;
+ smbc_setOptionUserData (ctx, self);
+ if (auth)
+ smbc_setFunctionAuthDataWithContext (ctx, auth_fn);
+
if (smbc_init_context (ctx) == NULL)
{
PyErr_SetFromErrno (PyExc_RuntimeError);
@@ -152,13 +160,6 @@
return -1;
}
- smbc_setDebug (ctx, debug);
-
- self->context = ctx;
- smbc_setOptionUserData (ctx, self);
- if (auth)
- smbc_setFunctionAuthDataWithContext (ctx, auth_fn);
-
debugprintf ("%p <- Context_init() = 0\n", self->context);
return 0;
}
@@ -186,31 +187,39 @@
smbc_open_fn fn;
debugprintf ("%p -> Context_open()\n", self->context);
- if(!PyArg_ParseTuple (args, "s|ii", &uri, &flags, &mode)){
+ if (!PyArg_ParseTuple (args, "s|ii", &uri, &flags, &mode))
+ {
debugprintf ("%p <- Context_open() EXCEPTION\n", self->context);
return NULL;
- }
+ }
largs = Py_BuildValue ("()");
lkwlist = PyDict_New ();
PyDict_SetItemString (lkwlist, "context", (PyObject *) self);
- file = (File *)smbc_FileType.tp_new(&smbc_FileType, largs, lkwlist);
- if(!file){
- return PyErr_NoMemory();
- }
- if (smbc_FileType.tp_init ((PyObject *)file, largs, lkwlist) < 0){
- smbc_FileType.tp_dealloc((PyObject *)file);
- debugprintf ("%p <- Context_open() EXCEPTION\n", self->context);
- // already set error
- return NULL;
- }
+ file = (File *)smbc_FileType.tp_new (&smbc_FileType, largs, lkwlist);
+ if (!file)
+ {
+ return PyErr_NoMemory ();
+ }
+
+ if (smbc_FileType.tp_init ((PyObject *)file, largs, lkwlist) < 0)
+ {
+ smbc_FileType.tp_dealloc ((PyObject *)file);
+ debugprintf ("%p <- Context_open() EXCEPTION\n", self->context);
+ // already set error
+ return NULL;
+ }
+
fn = smbc_getFunctionOpen (self->context);
errno = 0;
- file->file = (*fn)(self->context, uri, (int)flags, (mode_t)mode);
- if(!file->file){
- pysmbc_SetFromErrno();
- return NULL;
- }
+ file->file = (*fn) (self->context, uri, (int)flags, (mode_t)mode);
+ if (!file->file)
+ {
+ pysmbc_SetFromErrno ();
+ smbc_FileType.tp_dealloc ((PyObject *)file);
+ file = NULL;
+ }
+
Py_DECREF (largs);
Py_DECREF (lkwlist);
debugprintf ("%p <- Context_open() = File\n", self->context);
@@ -218,7 +227,7 @@
}
static PyObject *
-Context_creat(Context *self, PyObject *args)
+Context_creat (Context *self, PyObject *args)
{
PyObject *largs, *lkwlist;
char *uri;
@@ -226,56 +235,67 @@
File *file;
smbc_creat_fn fn;
- if(!PyArg_ParseTuple (args, "s|i", &uri, &mode)){
+ if (!PyArg_ParseTuple (args, "s|i", &uri, &mode))
+ {
return NULL;
- }
+ }
largs = Py_BuildValue ("()");
lkwlist = PyDict_New ();
PyDict_SetItemString (lkwlist, "context", (PyObject *) self);
- file = (File *)smbc_FileType.tp_new(&smbc_FileType, largs, lkwlist);
- if(!file){
- return PyErr_NoMemory();
- }
- if (smbc_FileType.tp_init ((PyObject *)file, largs, lkwlist) < 0){
- smbc_FileType.tp_dealloc((PyObject *)file);
- return NULL;
- }
- fn = smbc_getFunctionCreat(self->context);
+ file = (File *)smbc_FileType.tp_new (&smbc_FileType, largs, lkwlist);
+ if (!file)
+ {
+ return PyErr_NoMemory();
+ }
+
+ if (smbc_FileType.tp_init ((PyObject *)file, largs, lkwlist) < 0)
+ {
+ smbc_FileType.tp_dealloc ((PyObject *)file);
+ return NULL;
+ }
+
+ fn = smbc_getFunctionCreat (self->context);
errno = 0;
- file->file = (*fn)(self->context, uri, mode);
- if(!file->file){
- pysmbc_SetFromErrno();
- return NULL;
- }
+ file->file = (*fn) (self->context, uri, mode);
+ if (!file->file)
+ {
+ pysmbc_SetFromErrno ();
+ smbc_FileType.tp_dealloc ((PyObject *)file);
+ file = NULL;
+ }
+
Py_DECREF (largs);
Py_DECREF (lkwlist);
return (PyObject *)file;
}
static PyObject *
-Context_unlink(Context *self, PyObject *args)
+Context_unlink (Context *self, PyObject *args)
{
int ret;
char *uri = NULL;
smbc_unlink_fn fn;
- if(!PyArg_ParseTuple (args, "s", &uri)) {
- return NULL;
- }
+ if(!PyArg_ParseTuple (args, "s", &uri))
+ {
+ return NULL;
+ }
- fn = smbc_getFunctionUnlink(self->context);
+ fn = smbc_getFunctionUnlink (self->context);
errno = 0;
- ret = (*fn)(self->context, uri);
- if(ret < 0){
- pysmbc_SetFromErrno();
- return NULL;
- }
- return PyLong_FromLong(ret);
+ ret = (*fn) (self->context, uri);
+ if (ret < 0)
+ {
+ pysmbc_SetFromErrno ();
+ return NULL;
+ }
+
+ return PyLong_FromLong (ret);
}
static PyObject *
-Context_rename(Context *self, PyObject *args)
+Context_rename (Context *self, PyObject *args)
{
int ret;
char *ouri = NULL;
@@ -283,22 +303,29 @@
Context *nctx = NULL;
smbc_rename_fn fn;
- if (!PyArg_ParseTuple(args, "ss|O", &ouri, &nuri, &nctx)) {
- return NULL;
- }
+ if (!PyArg_ParseTuple (args, "ss|O", &ouri, &nuri, &nctx))
+ {
+ return NULL;
+ }
fn = smbc_getFunctionRename(self->context);
errno = 0;
- if(nctx && nctx->context){
- ret = (*fn)(self->context, ouri, nctx->context, nuri);
- }else{
- ret = (*fn)(self->context, ouri, self->context, nuri);
- }
- if(ret < 0){
- pysmbc_SetFromErrno();
- return NULL;
- }
- return PyLong_FromLong(ret);
+ if (nctx && nctx->context)
+ {
+ ret = (*fn) (self->context, ouri, nctx->context, nuri);
+ }
+ else
+ {
+ ret = (*fn) (self->context, ouri, self->context, nuri);
+ }
+
+ if (ret < 0)
+ {
+ pysmbc_SetFromErrno ();
+ return NULL;
+ }
+
+ return PyLong_FromLong (ret);
}
static PyObject *
@@ -334,99 +361,112 @@
}
static PyObject *
-Context_mkdir(Context *self, PyObject *args)
+Context_mkdir (Context *self, PyObject *args)
{
int ret;
char *uri = NULL;
unsigned int mode = 0;
smbc_mkdir_fn fn;
- if(!PyArg_ParseTuple (args, "s|I", &uri, &mode)) {
- return NULL;
- }
+ if (!PyArg_ParseTuple (args, "s|I", &uri, &mode))
+ {
+ return NULL;
+ }
- fn = smbc_getFunctionMkdir(self->context);
+ fn = smbc_getFunctionMkdir (self->context);
errno = 0;
- ret = (*fn)(self->context, uri, mode);
- if(ret < 0){
- pysmbc_SetFromErrno();
- return NULL;
- }
- return PyLong_FromLong(ret);
+ ret = (*fn) (self->context, uri, mode);
+ if (ret < 0)
+ {
+ pysmbc_SetFromErrno ();
+ return NULL;
+ }
+
+ return PyLong_FromLong (ret);
}
static PyObject *
-Context_rmdir(Context *self, PyObject *args)
+Context_rmdir (Context *self, PyObject *args)
{
int ret;
char *uri = NULL;
smbc_rmdir_fn fn;
- if(!PyArg_ParseTuple (args, "s", &uri)) {
- return NULL;
- }
+ if (!PyArg_ParseTuple (args, "s", &uri))
+ {
+ return NULL;
+ }
- fn = smbc_getFunctionRmdir(self->context);
+ fn = smbc_getFunctionRmdir (self->context);
errno = 0;
- ret = (*fn)(self->context, uri);
- if(ret < 0){
- pysmbc_SetFromErrno();
- return NULL;
- }
- return PyLong_FromLong(ret);
+ ret = (*fn) (self->context, uri);
+ if (ret < 0)
+ {
+ pysmbc_SetFromErrno ();
+ return NULL;
+ }
+
+ return PyLong_FromLong (ret);
}
static PyObject *
-Context_stat(Context *self, PyObject *args)
+Context_stat (Context *self, PyObject *args)
{
int ret;
char *uri = NULL;
smbc_stat_fn fn;
struct stat st;
- if(!PyArg_ParseTuple (args, "s", &uri)) {
- return NULL;
- }
+ if (!PyArg_ParseTuple (args, "s", &uri))
+ {
+ return NULL;
+ }
- fn = smbc_getFunctionStat(self->context);
+ fn = smbc_getFunctionStat (self->context);
errno = 0;
- ret = (*fn)(self->context, uri, &st);
- if(ret < 0){
- pysmbc_SetFromErrno();
- return NULL;
- }
- return Py_BuildValue("(IKKKIIKIII)",
- st.st_mode,
- (unsigned long long)st.st_ino,
- (unsigned long long)st.st_dev,
- (unsigned long long)st.st_nlink,
- st.st_uid,
- st.st_gid,
- st.st_size,
- st.st_atime,
- st.st_mtime,
- st.st_ctime);
+ ret = (*fn) (self->context, uri, &st);
+ if (ret < 0)
+ {
+ pysmbc_SetFromErrno ();
+ return NULL;
+ }
+
+ return Py_BuildValue ("(IKKKIIKIII)",
+ st.st_mode,
+ (unsigned long long)st.st_ino,
+ (unsigned long long)st.st_dev,
+ (unsigned long long)st.st_nlink,
+ st.st_uid,
+ st.st_gid,
+ st.st_size,
+ st.st_atime,
+ st.st_mtime,
+ st.st_ctime);
}
static PyObject *
-Context_chmod(Context *self, PyObject *args)
+Context_chmod (Context *self, PyObject *args)
{
int ret;
char *uri = NULL;
mode_t mode = 0;
smbc_chmod_fn fn;
- if(!PyArg_ParseTuple (args, "si", &uri, &mode)) {
- return NULL;
- }
+ if (!PyArg_ParseTuple (args, "si", &uri, &mode))
+ {
+ return NULL;
+ }
+
errno = 0;
- fn = smbc_getFunctionChmod(self->context);
- ret = (*fn)(self->context, uri, mode);
- if(ret < 0){
- pysmbc_SetFromErrno();
- return NULL;
- }
- return PyLong_FromLong(ret);
+ fn = smbc_getFunctionChmod (self->context);
+ ret = (*fn) (self->context, uri, mode);
+ if (ret < 0)
+ {
+ pysmbc_SetFromErrno ();
+ return NULL;
+ }
+
+ return PyLong_FromLong (ret);
}
static PyObject *
@@ -440,10 +480,10 @@
Context_setDebug (Context *self, PyObject *value, void *closure)
{
int d;
-
+
#if PY_MAJOR_VERSION < 3
- if (PyInt_Check(value))
- value = PyLong_FromLong(PyInt_AsLong(value));
+ if (PyInt_Check (value))
+ value = PyLong_FromLong (PyInt_AsLong (value));
#endif
if (!PyLong_Check (value))
@@ -474,8 +514,8 @@
ssize_t written;
#if PY_MAJOR_VERSION < 3
- if (PyString_Check(value))
- value = PyUnicode_FromString(PyString_AsString(value));
+ if (PyString_Check (value))
+ value = PyUnicode_FromString (PyString_AsString (value));
#endif
if (!PyUnicode_Check (value))
@@ -485,7 +525,7 @@
}
chars = PyUnicode_GetSize (value); /* not including NUL */
- w_name = malloc((chars + 1) * sizeof (wchar_t));
+ w_name = malloc ((chars + 1) * sizeof (wchar_t));
if (!w_name)
{
PyErr_NoMemory ();
@@ -539,8 +579,8 @@
ssize_t written;
#if PY_MAJOR_VERSION < 3
- if (PyString_Check(value))
- value = PyUnicode_FromString(PyString_AsString(value));
+ if (PyString_Check (value))
+ value = PyUnicode_FromString (PyString_AsString (value));
#endif
if (!PyUnicode_Check (value))
@@ -867,7 +907,7 @@
Py_TPFLAGS_DEFAULT, /*tp_flags*/
"SMBC context\n"
"============\n\n"
-
+
" A context for libsmbclient calls.\n\n"
"Optional parameters are:\n\n"
"auth_fn: a function for collecting authentication details from\n"
@@ -922,7 +962,7 @@
Py_TPFLAGS_DEFAULT, /*tp_flags*/
"SMBC context\n"
"============\n\n"
-
+
" A context for libsmbclient calls.\n\n"
"Optional parameters are:\n\n"
"auth_fn: a function for collecting authentication details from\n"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.12/file.c new/pysmbc-1.0.13/file.c
--- old/pysmbc-1.0.12/file.c 2011-05-20 17:31:53.000000000 +0200
+++ new/pysmbc-1.0.13/file.c 2012-02-15 13:00:55.000000000 +0100
@@ -1,6 +1,6 @@
/* -*- Mode: C; c-file-style: "gnu" -*-
* pysmbc - Python bindings for libsmbclient
- * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2011 Red Hat, Inc
+ * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2011, 2012 Red Hat, Inc
* Copyright (C) 2010 Open Source Solution Technology Corporation
* Copyright (C) 2010 Patrick Geltinger
* Authors:
@@ -101,6 +101,7 @@
if (file == NULL)
{
pysmbc_SetFromErrno();
+ Py_DECREF (ctxobj);
return -1;
}
@@ -154,7 +155,7 @@
size = st.st_size;
}
- buf = (char *) malloc(size);
+ buf = (char *)malloc (size);
if (!buf)
return PyErr_NoMemory ();
@@ -284,8 +285,8 @@
offset = py_offset;
/* check for data loss from cast */
- if ((off_t_long) offset != py_offset)
- PyErr_SetString(PyExc_OverflowError, "Data loss in casting off_t");
+ if ((off_t_long)offset != py_offset)
+ PyErr_SetString (PyExc_OverflowError, "Data loss in casting off_t");
fn = smbc_getFunctionLseek (ctx->context);
ret = (*fn) (ctx->context, self->file, offset, whence);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pysmbc-1.0.12/setup.py new/pysmbc-1.0.13/setup.py
--- old/pysmbc-1.0.12/setup.py 2011-12-09 16:22:21.000000000 +0100
+++ new/pysmbc-1.0.13/setup.py 2012-02-15 17:12:44.000000000 +0100
@@ -52,7 +52,7 @@
from distutils.core import setup, Extension
setup (name="pysmbc",
- version="1.0.12",
+ version="1.0.13",
description="Python bindings for libsmbclient",
long_description=__doc__,
author=["Tim Waugh ",
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org