@@ -12,6 +12,7 @@ int python_connect(vfs_handle_struct *handle,
1212 PyObject * py_ret = PyObject_CallFunction (py_func , "ss" , service , user );
1313 success = PyObject_IsTrue (py_ret );
1414 Py_DECREF (py_ret );
15+ Py_DECREF (py_func );
1516 }
1617
1718 if (success == 1 )
@@ -42,6 +43,7 @@ int python_mkdir(vfs_handle_struct *handle,
4243 PyObject * py_ret = PyObject_CallFunction (py_func , "s" , path );
4344 success = PyObject_IsTrue (py_ret );
4445 Py_DECREF (py_ret );
46+ Py_DECREF (py_func );
4547 }
4648
4749 if (success == 1 )
@@ -54,6 +56,29 @@ int python_mkdir(vfs_handle_struct *handle,
5456 }
5557}
5658
59+ int python_rmdir (vfs_handle_struct * handle , const char * path )
60+ {
61+ int success = 1 ;
62+
63+ PyObject * py_func = get_func (handle , "rmdir" );
64+ if (py_func != NULL )
65+ {
66+ PyObject * py_ret = PyObject_CallFunction (py_func , "s" , path );
67+ success = PyObject_IsTrue (py_ret );
68+ Py_DECREF (py_ret );
69+ Py_DECREF (py_func );
70+ }
71+
72+ if (success == 1 )
73+ {
74+ return SMB_VFS_NEXT_RMDIR (handle , path );
75+ }
76+ else
77+ {
78+ return -1 ;
79+ }
80+ }
81+
5782NTSTATUS python_create_file (struct vfs_handle_struct * handle ,
5883 struct smb_request * req ,
5984 uint16_t root_dir_fid ,
@@ -79,6 +104,7 @@ NTSTATUS python_create_file(struct vfs_handle_struct *handle,
79104 PyObject * py_ret = PyObject_CallFunction (py_func , "s" , smb_fname -> base_name );
80105 success = PyObject_IsTrue (py_ret );
81106 Py_DECREF (py_ret );
107+ Py_DECREF (py_func );
82108 }
83109
84110 if (success == 1 )
@@ -121,6 +147,7 @@ int python_rename(vfs_handle_struct *handle,
121147 smb_fname_dst -> base_name );
122148 success = PyObject_IsTrue (py_ret );
123149 Py_DECREF (py_ret );
150+ Py_DECREF (py_func );
124151 }
125152
126153 if (success == 1 )
0 commit comments