Skip to content

Commit

Permalink
s4-libnet: Split up samba-net into samba-net and samba-net-join
Browse files Browse the repository at this point in the history
samba-net-join links to python and so needs the variable name
with the python ABI tag, while samba-net is a normal C library
and can be included in a package without python dependencies.

Signed-off-by: Andrew Bartlett <[email protected]>
Reviewed-by: Alexander Bokovoy <[email protected]>
  • Loading branch information
abartlet committed Jun 5, 2024
1 parent a54dca4 commit 829b52f
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 13 deletions.
3 changes: 1 addition & 2 deletions source4/lib/policy/wscript_build
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

pytalloc_util = bld.pyembed_libname('pytalloc-util')
samba_policy = bld.pyembed_libname('samba-policy')
samba_net = bld.pyembed_libname('samba-net')
bld.SAMBA_LIBRARY(samba_policy,
source='gp_ldap.c gp_filesys.c gp_manage.c gp_ini.c',
pc_files='samba-policy.pc',
public_deps='ldb %s' % samba_net,
public_deps='ldb samba-net',
vnum='0.0.1',
pyembed=True,
public_headers='policy.h',
Expand Down
1 change: 1 addition & 0 deletions source4/libnet/libnet_join.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "includes.h"
#include "libnet/libnet.h"
#include "libnet/libnet_join_proto.h"
#include "librpc/gen_ndr/ndr_drsuapi_c.h"
#include <ldb.h>
#include <ldb_errors.h>
Expand Down
1 change: 1 addition & 0 deletions source4/libnet/libnet_vampire.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "includes.h"
#include "libnet/libnet.h"
#include "libnet/libnet_join_proto.h"
#include "lib/events/events.h"
#include "dsdb/samdb/samdb.h"
#include "../lib/util/dlinklist.h"
Expand Down
1 change: 1 addition & 0 deletions source4/libnet/py_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <pyldb.h>
#include <pytalloc.h>
#include "libnet.h"
#include "libnet_join_proto.h"
#include "auth/credentials/pycredentials.h"
#include "libcli/security/security.h"
#include "lib/events/events.h"
Expand Down
23 changes: 15 additions & 8 deletions source4/libnet/wscript_build
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,28 @@ pytalloc_util = bld.pyembed_libname('pytalloc-util')
pyrpc_util = bld.pyembed_libname('pyrpc_util')
pyldb_util = bld.pyembed_libname('pyldb-util')
provision = bld.pyembed_libname('PROVISION')
name = bld.pyembed_libname('samba-net')
name = bld.pyembed_libname('samba-net-join')
auto_proto='libnet_proto.h'
bld.SAMBA_LIBRARY(name,
source='libnet.c libnet_passwd.c libnet_time.c libnet_rpc.c libnet_join.c libnet_site.c libnet_become_dc.c libnet_unbecome_dc.c libnet_vampire.c libnet_user.c libnet_group.c libnet_share.c libnet_lookup.c libnet_domain.c userinfo.c groupinfo.c userman.c groupman.c prereq_domain.c',
bld.SAMBA_LIBRARY('samba-net',
source='libnet.c libnet_passwd.c libnet_time.c libnet_rpc.c libnet_site.c libnet_become_dc.c libnet_unbecome_dc.c libnet_user.c libnet_group.c libnet_share.c libnet_lookup.c libnet_domain.c userinfo.c groupinfo.c userman.c groupman.c prereq_domain.c',
autoproto=auto_proto,
deps='INIT_SAMR',
public_deps='samba-credentials dcerpc dcerpc-samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI cli_composite LIBCLI_RESOLVE LIBCLI_FINDDCS cli_cldap LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH ndr smbpasswdparser %s LIBCLI_SAMSYNC LIBTSOCKET GNUTLS_HELPERS' % (provision),
private_library=True,
pyembed=True,
enabled=bld.PYTHON_BUILD_IS_ENABLED()
public_deps='samba-credentials dcerpc dcerpc-samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI cli_composite LIBCLI_RESOLVE LIBCLI_FINDDCS cli_cldap LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH ndr smbpasswdparser LIBCLI_SAMSYNC LIBTSOCKET GNUTLS_HELPERS',
private_library=True
)

bld.SAMBA_LIBRARY(name,
source='libnet_join.c libnet_vampire.c',
autoproto='libnet_join_proto.h',
deps=f'samba-net {provision}',
private_library=True,
pyembed=True,
enabled=bld.PYTHON_BUILD_IS_ENABLED()
)

bld.SAMBA_PYTHON('python_net',
source='py_net.c',
deps='%s %s %s' % (name, pyrpc_util, pytalloc_util),
deps=f'samba-net {name} {pyrpc_util} {pytalloc_util}',
realname='samba/net.so'
)

Expand Down
1 change: 1 addition & 0 deletions source4/torture/libnet/libnet_BecomeDC.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "lib/cmdline/cmdline.h"
#include "torture/rpc/torture_rpc.h"
#include "libnet/libnet.h"
#include "libnet/libnet_join_proto.h"
#include "dsdb/samdb/samdb.h"
#include "../lib/util/dlinklist.h"
#include "librpc/gen_ndr/ndr_drsuapi.h"
Expand Down
1 change: 1 addition & 0 deletions source4/torture/rpc/testjoin.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "includes.h"
#include "system/time.h"
#include "libnet/libnet.h"
#include "libnet/libnet_join_proto.h"
#include "lib/cmdline/cmdline.h"
#include "librpc/gen_ndr/ndr_lsa_c.h"
#include "librpc/gen_ndr/ndr_samr_c.h"
Expand Down
6 changes: 3 additions & 3 deletions source4/torture/wscript_build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

provision = bld.pyembed_libname('PROVISION')
samba_net = bld.pyembed_libname('samba-net')
samba_net_join = bld.pyembed_libname('samba-net-join')

bld.SAMBA_SUBSYSTEM('TORTURE_UTIL',
source='util_smb.c',
Expand Down Expand Up @@ -189,7 +189,7 @@ bld.SAMBA_MODULE('torture_rpc',
printer_driver
RPC_NDR_MDSSVC
mdssvc
''' % samba_net + ntvfs_specific['deps'],
''' % samba_net_join + ntvfs_specific['deps'],
internal_module=True,
enabled=bld.PYTHON_BUILD_IS_ENABLED())

Expand Down Expand Up @@ -284,7 +284,7 @@ bld.SAMBA_MODULE('TORTURE_NET',
autoproto='libnet/proto.h',
subsystem='smbtorture',
init_function='torture_net_init',
deps='%s torture_rpc %s' % (provision, samba_net),
deps='%s torture_rpc %s' % (provision, samba_net_join),
internal_module=True,
enabled=bld.PYTHON_BUILD_IS_ENABLED()
)
Expand Down

0 comments on commit 829b52f

Please sign in to comment.