Skip to content

Instantly share code, notes, and snippets.

View vortec's full-sized avatar

Fabian Kochem vortec

View GitHub Profile
Compiling vfs_python.c
#@gcc -g -O2 -g -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER -fPIC -Iinclude -I/home/vortec/workspace/samba/source3/include -I/home/vortec/workspace/samba/source3/include/autoconf -I/home/vortec/workspace/samba/source3/autoconf -I/home/vortec/workspace/samba/source3/../popt -I/home/vortec/workspace/samba/source3/../lib/replace -I/home/vortec/workspace/samba/source3/../lib/talloc -I/home/vortec/workspace/samba/source3/../lib/tevent -I/home/vortec/workspace/samba/source3/../lib/tdb/include -I/home/vortec/workspace/samba/source3/librpc -I/home/vortec/workspace/samba/source3/../librpc -I/home/vortec/workspace/samba/source3/../ -I/home/vortec/workspace/samba/source3 -I. -c commands.c -c python_importer.c -c vfs_python.c -Dvfs_python_init=samba_init_module
commands.c: In function ‘python_connect’:
commands.c:15:22: warning: initialization from incompatible pointer type [enabled by default]
commands.c:18:3: warning
vfs_python.c: In function ‘get_py_mod’:
vfs_python.c:50:2: warning: return from incompatible pointer type [enabled by default]
vfs_python.c: In function ‘get_py_func’:
vfs_python.c:63:4: warning: return from incompatible pointer type [enabled by default]
vfs_python.c: In function ‘get_func’:
vfs_python.c:78:14: warning: assignment from incompatible pointer type [enabled by default]
vfs_python.c: At top level:
vfs_python.h:18:12: warning: ‘python_connect’ used but never defined [enabled by default]
vfs_python.h:21:13: warning: ‘python_disconnect’ used but never defined [enabled by default]
vfs_python.h:22:12: warning: ‘python_mkdir’ used but never defined [enabled by default]
Compiling vfs_python.c
vfs_python.c: In function ‘get_py_mod’:
vfs_python.c:50:2: warning: return from incompatible pointer type [enabled by default]
vfs_python.c: In function ‘get_py_func’:
vfs_python.c:63:4: warning: return from incompatible pointer type [enabled by default]
vfs_python.c: In function ‘get_func’:
vfs_python.c:78:14: warning: assignment from incompatible pointer type [enabled by default]
vfs_python.c: At top level:
vfs_python.c:105:17: error: ‘python_connect’ undeclared here (not in a function)
vfs_python.c:106:20: error: ‘python_disconnect’ undeclared here (not in a function)
class Food(object):
def eat(self):
pass
product = Food()
x = {'x': product}
print x['x'] is product
print x['x'].eat == product.eat
print x['x'].eat is product.eat
>>> from test_dispatcher import Food
>>> product = Food()
>>> x = {'x': product}
>>> assert x['x'] is product
>>> assert x['x'].eat == product.eat
>>> assert x['x'].eat is product.eat
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AssertionError
class Food(object):
def eat(self):
pass
@pytest.fixture
def product():
return Food()
def test_product(product):
(versionbump)[vortec@MBPro] ~VIRTUAL_ENV/versionbump (git)-[master]$ time tox †: 0
GLOB sdist-make: /Users/vortec/workspace/virtualenvs/versionbump/versionbump/setup.py
py26 inst-nodeps: /Users/vortec/workspace/virtualenvs/versionbump/versionbump/.tox/dist/versionbump-1.0.0.zip
py26 runtests: PYTHONHASHSEED='754264446'
py26 runtests: commands[0] | py.test
========================================= test session starts ==========================================
platform darwin -- Python 2.6.8 -- py-1.4.20 -- pytest-2.5.2
collected 14 items
tests/unit/test_filebump.py ......
vanilla (ipv6:::1:45743) connect to service public initially as user nobody (uid=65534, gid=65534) (pid 23041)
tconX service=PUBLIC
Transaction 8 of length 57 (0 toread)
switch message SMBecho (pid 23041) conn 0x7f823c843cd0
echo 1 times
vanilla (ipv6:::1:45743) closed connection to service public
Server exit (failed to receive smb request)
#include "../source3/include/includes.h"
#include "lib/util/tevent_unix.h"
#include "lib/util/tevent_ntstatus.h"
static int fspattern_connect(vfs_handle_struct *handle,
const char *service,
const char *user)
{
FILE *f = fopen("/tmp/mylog.txt", "w");
if (f != NULL)
diff --git a/fspattern/fspattern.c b/fspattern/fspattern.c
new file mode 100644
index 0000000..7afd838
--- /dev/null
+++ b/fspattern/fspattern.c
@@ -0,0 +1,47 @@
+#include "../source3/include/includes.h"
+#include "lib/util/tevent_unix.h"
+#include "lib/util/tevent_ntstatus.h"
+