Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2190)
a9ab0237
VERSION: Bump version up to 4.8.0pre1...
Jul 04, 2017
e317dfec
WHATSNEW: Start release notes for Samba 4.8.0pre1.
Jul 04, 2017
4ad58497
talloc: Use libraries from build dir for testsuite
Jul 04, 2017
9e1cbce2
talloc: Fix execution of test_magic_differs from tarball
Jul 04, 2017
d5d6d209
ldb: Use libraries from build dir for testsuite
Jul 04, 2017
31019d33
python: tests: Add test for tdb_copy function from tdb_util module.
Jul 05, 2017
a15953ae
auth/spnego: rename gensec_spnego_server_negTokenTarg() into gensec_spnego_server_response()
Jul 05, 2017
7ba307a4
auth/spnego: use a helper variable for spnego.negTokenInit.targetPrincipal
Jul 05, 2017
9d7a01de
auth/spnego: add a struct spnego_negTokenTarg *ta variable to make some lines shorter
Jul 05, 2017
b337d266
auth/spnego: don't pass 'in' to gensec_spnego_create_negTokenInit()
Jul 05, 2017
c0b2f85d
auth/spnego: set spnego_state->{state_position,expected_packet} gensec_spnego_create_negTokenInit()
Jul 05, 2017
1dfad27c
auth/spnego: move SERVER gensec_spnego_create_negTokenInit() handling to the top
Jul 05, 2017
f266b355
auth/spnego: remove useless indentation level for SPNEGO_SERVER_START
Jul 05, 2017
79faf301
auth/spnego: pass spnego_in to gensec_spnego_parse_negTokenInit()
Jul 05, 2017
2ab239be
Easily edit a users object in AD, as if using ldbedit.
Jul 05, 2017
3c03ac75
Add test for 'samba-tool user edit'
Jul 05, 2017
e3707c1b
Add code to run the tests for 'samba-tool user edit'
Jul 05, 2017
25ef27b2
waf: Only build unit tests with selftest enabled
Jul 05, 2017
5d18c5e5
unittests: Add missing stdint.h include
Jul 05, 2017
1de43903
unittests: Do not install the test_dummy rpc module
Jul 05, 2017
b6d6f67b
Add support for passing the max_referral_level into the cli call to get a DFS...
Jul 07, 2017
939576d9
notifyd: Only ask for messaging_ctdb_conn when clustering
Jul 07, 2017
d0a7bcca
notifyd: Consolidate two #ifdef CLUSTER into one
Jul 07, 2017
b8dccd11
notifyd: Avoid an if-expression
Jul 07, 2017
0c1e08b5
messaging: make messaging_rec_create public
Jul 07, 2017
b6079af1
notifyd: Use messaging_register for MSG_SMB_NOTIFY_REC_CHANGE
Jul 07, 2017
db15feb1
notifyd: Use messaging_register for MSG_SMB_NOTIFY_TRIGGER
Jul 07, 2017
dc39bb45
notifyd: Use messaging_register for MSG_SMB_NOTIFY_GET_DB
Jul 07, 2017
9430fab6
notifyd: Use messaging_register for MSG_SMB_NOTIFY_DB
Jul 07, 2017
197186a1
notifyd: Remove notifyd_handler_done
Jul 07, 2017
5eccc2fd
messaging: Remove messaging_handler_send
Jul 07, 2017
98e30cf4
waf: Do not install _ldb_text.py if we have system libldb
Jul 07, 2017
e9d33bf8
s3: client: Move struct file_list code to using talloc from malloc.
Jul 07, 2017
b6f484ae
s3: smbclient: Add new command deltree.
Jul 07, 2017
f2f9f51f
docs: Document new smbclient deltree command.
Jul 07, 2017
b21ee14e
s3: tests: Add test for new smbclient "deltree" command.
Jul 07, 2017
963d9f12
ldb: Fix index out of bound in ldb_msg_find_common_values
Jul 07, 2017
282410fa
ldb: avoid searching empty lists in ldb_msg_find_common_values
Jul 07, 2017
4b3de611
ldb/tests: more thoroughly test empty ldb_msg elements
Jul 07, 2017
b886a944
s3/smbd: let non_widelink_open() chdir() to directories directly
Jul 07, 2017
cc9ba98c
selftest: add a test for accessing previous version of directories with snapdirseverywhere
Jul 08, 2017
7dec1e1e
delete duplicate test
Jul 08, 2017
305eb1b6
vfs_fruit: fix a typo
Jul 10, 2017
77cbced5
s3:smbd: consistently use talloc_tos() memory for rpc_pipe_open_interface()
Jul 10, 2017
c9172c5a
s3/vfs: remove SMB_VFS_STRICT_UNLOCK
Jul 10, 2017
67466271
s3/vfs: rename SMB_VFS_STRICT_LOCK to SMB_VFS_STRICT_LOCK_CHECK
Jul 11, 2017
539714ef
ctdb-scripts: Fix inline comments in 10.interface
Jul 11, 2017
259e1706
vfs_fruit: add fruit:model = <modelname> parametric option
Jul 12, 2017
4a7ec5b7
selftest: add ad_member_idmap_ad server
Jul 12, 2017
b3d14dae
selftest: add some basic tests for idmap_ad
Jul 12, 2017
fe7020b0
idmap_ad: Retry query_user exactly once if we get TLDAP_SERVER_DOWN
Jul 12, 2017
2bce9cb7
ctdb: enable mutexes for volatile TDBs by default
Jul 12, 2017
a70be432
dbwrap: enable mutexes by default for volatile TDBs
Jul 12, 2017
6ae063a1
dbwrap: CTDB ignores tdb_flags passed to db attach controls
Jul 12, 2017
0077296c
ctdbd_conn: move CTDB_CONTROL_ENABLE_SEQNUM control to db_open_ctdb
Jul 12, 2017
b2b7e3b9
ctdbd_conn: pass persistent bool instead of tdb_flags
Jul 12, 2017
de9d2195
dbwrap: Ask CTDB for local tdb open flags
Jul 12, 2017
3799a32e
CVE-2017-11103: Orpheus' Lyre KDC-REP service name validation
Jul 12, 2017
9c68f996
spoolss: Fix CID 1414784 Uninitialized scalar variable
Jul 12, 2017
bebf90f7
libwbclient: Fix CID 1414781 Dereference null return value
Jul 12, 2017
3e85cbfd
ctdb-common: Set close-on-exec when creating PID file
Jul 13, 2017
4e68d377
ctdb-docs: Update documentation of ipreallocated event
Jul 13, 2017
df0db9d8
vfs_fruit: don't use MS NFS ACEs with Windows clients
Jul 13, 2017
a4c3ee67
s3:smbclient: Allow last dos attribute to be cleared
Jul 14, 2017
303a52d8
py3: Make sure to specify METH_VARARGS together with METH_KEYWORDS
Jul 14, 2017
0ed918ef
Build py3 versions of other rpc modules
Jul 14, 2017
85b10a63
s3: drop build_env
Jul 14, 2017
7f4e7cfd
s3/notifyd: ensure notifyd doesn't return from smbd_notifyd_init
Jul 15, 2017
5fe76a54
s3: smbd: Fix a read after free if a chained SMB1 call goes async.
Jul 15, 2017
4cced4da
s3:client: The smbspool krb5 wrapper needs negotiate for authentication
Jul 15, 2017
59f89515
Revert "s3:smbclient: Allow last dos attribute to be cleared"
Jul 18, 2017
f1cc79a4
s3: libsmb: Reverse sense of 'clear all attributes', ignore attribute change in SMB2 to match SMB1.
Jul 18, 2017
5facd045
s3: smbclient: Add a test for the setmode command.
Jul 18, 2017
bc951ae0
docs: Fix a typo in cifsdd.8
Jul 18, 2017
b594e0cd
s3:tests: Fix directory creation and deletion of test_local_symlinks()
Jul 19, 2017
bd7eab16
s3:tests: Fix directory creation and deletion of test_nosymlinks()
Jul 19, 2017
f7daa453
dbwrap_ctdb: Fix calculation of persistent flag
Jul 19, 2017
995aec51
examples: add gencache.stp
Jul 19, 2017
1b7b7a92
examples: add winbindd.stp and a shell script to generate it
Jul 19, 2017
0181fcc4
smbd: Fix a connection run-down race condition
Jul 19, 2017
e54adf51
ndr_compression: use MAX_WBITS constant
Jul 19, 2017
9a2180cd
librpc:ndr_cab: Cast data pointer correctly
Jul 19, 2017
3b5442e7
librpc/ndr: remove trailing whitespace from compression file.
Jul 19, 2017
a44bce6d
libndr/compression: pass down compressed length in ndr_pull_compression_start
Jul 19, 2017
aa33aa6e
librpc/ndr: add new ndr_compression_state
Jul 19, 2017
096efc93
librpc/ndr: add new MSZIP compression type for cabinet files
Jul 19, 2017
1edf1266
librpc/ndr: add helper functions to setup and free compression states.
Jul 19, 2017
466d5e81
librpc: use DATA_BLOB in CFDATA structure
Jul 19, 2017
9ec74a31
librpc/ndr: remove unused ndr_cab_get_compression() function
Jul 19, 2017
a2816122
librpc/ndr: Use MAX_WBITS zlib define and change memLevel in MSZIP code
Jul 19, 2017
7c20a870
librpc/ndr: Use correct value for max compression size
Jul 19, 2017
43a1952b
librpc/ndr: simplify cabinet file size calculation
Jul 19, 2017
c60ad394
librpc/ndr: add MSZIP compression for cabinet files
Jul 19, 2017
7313e7c1
s4-torture: point out why we cannot validate MSZIP compressed files
Jul 20, 2017
c57dcafb
s3/utils: smbcacls failed to detect DIRECTORIES using SMB2 (windows only)
Jul 20, 2017
ff7df3d3
build: fix ceph_statx check when configured with libcephfs_dir
Jul 20, 2017
4031b303
getncchanges: Do not segfault if somehow we get 0 results from an ldb_search with scope BASE
Jul 21, 2017
4e04f025
selftest: Add test for password change when NTLM is disabled
Jul 21, 2017
1dcacff0
vfs_ceph: fix cephwrap_chdir()
Jul 21, 2017
e3a151e2
winbindd: cache name-to-sid from PAC based on lookup domain
Jul 21, 2017
Expand all
Show whitespace changes
Inline
Side-by-side
Some changes are not shown.
For a faster browsing experience, only
20 of 1000+
files are shown.
.gitlab-ci.yml
0 → 100644
View file @
2aa475bf
# see https://docs.gitlab.com/ce/ci/yaml/README.html for all available options
before_script
:
-
echo "Build starting ..."
build_samba
:
stage
:
build
tags
:
-
autobuild
script
:
# this one takes about 4 hours to finish
-
python script/autobuild.py samba --verbose --tail --testbase /tmp/samba-testbase
build_samba_others
:
stage
:
build
tags
:
-
autobuild
script
:
-
python script/autobuild.py samba-nopython --verbose --tail --testbase /tmp/samba-testbase
-
python script/autobuild.py samba-systemkrb5 --verbose --tail --testbase /tmp/samba-testbase
-
python script/autobuild.py samba-xc --verbose --tail --testbase /tmp/samba-testbase
-
python script/autobuild.py samba-o3 --verbose --tail --testbase /tmp/samba-testbase
-
python script/autobuild.py samba-libs --verbose --tail --testbase /tmp/samba-testbase
-
python script/autobuild.py samba-static --verbose --tail --testbase /tmp/samba-testbase
build_ctdb
:
stage
:
build
tags
:
-
autobuild
script
:
-
python script/autobuild.py samba-ctdb --verbose --tail --testbase /tmp/samba-testbase
-
python script/autobuild.py ctdb --verbose --tail --testbase /tmp/samba-testbase
build_others
:
stage
:
build
tags
:
-
autobuild
script
:
-
python script/autobuild.py ldb --verbose --tail --testbase /tmp/samba-testbase
-
python script/autobuild.py pidl --verbose --tail --testbase /tmp/samba-testbase
-
python script/autobuild.py replace --verbose --tail --testbase /tmp/samba-testbase
-
python script/autobuild.py talloc --verbose --tail --testbase /tmp/samba-testbase
-
python script/autobuild.py tdb --verbose --tail --testbase /tmp/samba-testbase
-
python script/autobuild.py tevent --verbose --tail --testbase /tmp/samba-testbase
after_script
:
-
echo "Build finished!"
.travis.yml
View file @
2aa475bf
...
...
@@ -27,7 +27,7 @@ matrix:
before_install
:
-
sudo apt-get update -qq
-
sudo apt-get install --assume-yes acl attr autoconf bison build-essential debhelper dnsutils docbook-xml docbook-xsl flex gdb
git
krb5-user libacl1-dev libaio-dev libattr1-dev libblkid-dev libbsd-dev libcap-dev libcups2-dev libgnutls-dev libgpgme11-dev libldap2-dev libncurses5-dev libpam0g-dev libparse-yapp-perl libpopt-dev libreadline-dev perl perl-modules pkg-config python-crypto python-dev python-dnspython python
-gpgme python3-crypto
python3-
dev
python
3-dnspython python3-gpgme realpath screen
xsltproc zlib1g-dev
-
sudo apt-get install --assume-yes acl attr autoconf
bind9utils
bison build-essential debhelper dnsutils docbook-xml docbook-xsl flex gdb
libjansson-dev
krb5-user libacl1-dev libaio-dev
libarchive-dev
libattr1-dev libblkid-dev libbsd-dev libcap-dev libcups2-dev libgnutls-dev libgpgme11-dev
libjson-perl
libldap2-dev libncurses5-dev libpam0g-dev libparse-yapp-perl libpopt-dev libreadline-dev
nettle-dev
perl perl-modules pkg-config
python-all-dev
python-crypto
python-dbg
python-dev python-dnspython python
3-dnspython python-gpgme
python3-
gpgme
python
-markdown python3-markdown python3-dev
xsltproc zlib1g-dev
script
:
-
git fetch --unshallow
...
...
.ycm_extra_conf.py
View file @
2aa475bf
...
...
@@ -49,27 +49,159 @@ flags = [
'
-DHAVE_IPV6=1
'
,
'
-I/usr/local/include
'
,
'
-I.
'
,
'
-Iauth
'
,
'
-Iauth/credentials
'
,
'
-Iauth/gensec
'
,
'
-Iauth/kerberos
'
,
'
-Iauth/ntlmssp
'
,
'
-Ictdb
'
,
'
-Ictdb/include
'
,
'
-Idynconfig
'
,
'
-Iinclude
'
,
'
-Iinclude/public
'
,
'
-Ilib
'
,
'
-Ilib/addns
'
,
'
-Ilib/afs
'
,
'
-Ilib/async_req
'
,
'
-Ilib/compression
'
,
'
-Ilib/crypto
'
,
'
-Ilib/dbwrap
'
,
'
-Ilib/krb5_wrap
'
,
'
-Ilib/ldb
'
,
'
-Ilib/ldb-samba
'
,
'
-Ilib/ldb/include
'
,
'
-Ilib/param
'
,
'
-Ilib/pthreadpool
'
,
'
-Ilib/replace
'
,
'
-Ilib/smbconf
'
,
'
-Ilib/socket
'
,
'
-Ilib/talloc
'
,
'
-Ilib/tdb
'
,
'
-Ilib/tdb/include
'
,
'
-Ilib/tevent
'
,
'
-Ilib/tsocket
'
,
'
-Ilib/util/charset
'
,
'
-Ilibcli/auth
'
,
'
-Ilibcli/cldap
'
,
'
-Ilibcli/drsuapi
'
,
'
-Ilibcli/ldap
'
,
'
-Ilibcli/lsarpc
'
,
'
-Ilibcli/named_pipe_auth
'
,
'
-Ilibcli/nbt
'
,
'
-Ilibcli/netlogon
'
,
'
-Ilibcli/registry
'
,
'
-Ilibcli/security
'
,
'
-Ilibcli/smb
'
,
'
-Ilibcli/util
'
,
'
-Ilibds/common
'
,
'
-Ilibrpc
'
,
'
-Insswitch
'
,
'
-Insswitch/libwbclient
'
,
'
-Isource3
'
,
'
-Isource3/auth
'
,
'
-Isource3/include
'
,
'
-Isource3/lib
'
,
'
-Isource3/librpc
'
,
'
-Isource3/modules
'
,
'
-Isource3/param
'
,
'
-Isource3/rpc_server
'
,
'
-Isource3/smbd/notifyd
'
,
'
-Isource4
'
,
'
-Isource4/auth
'
,
'
-Isource4/auth/gensec
'
,
'
-Isource4/auth/kerberos
'
,
'
-Isource4/cluster
'
,
'
-Isource4/dsdb
'
,
'
-Isource4/include
'
,
'
-Isource4/lib
'
,
'
-Isource4/lib/events
'
,
'
-Isource4/lib/http
'
,
'
-Isource4/lib/messaging
'
,
'
-Isource4/lib/socket
'
,
'
-Isource4/lib/stream
'
,
'
-Isource4/lib/tls
'
,
'
-Isource4/libcli
'
,
'
-Isource4/libcli/ldap
'
,
'
-Isource4/librpc
'
,
'
-Isource4/param
'
,
'
-Ithird_party/zlib
'
,
'
-Ibin/default
'
,
'
-Ibin/default/auth
'
,
'
-Ibin/default/auth/credentials
'
,
'
-Ibin/default/auth/gensec
'
,
'
-Ibin/default/auth/kerberos
'
,
'
-Ibin/default/auth/ntlmssp
'
,
'
-Ibin/default/ctdb
'
,
'
-Ibin/default/ctdb/include
'
,
'
-Ibin/default/dynconfig
'
,
'
-Ibin/default/include
'
,
'
-Ibin/default/include/public
'
,
'
-Ibin/default/lib
'
,
'
-Ibin/default/lib/addns
'
,
'
-Ibin/default/lib/afs
'
,
'
-Ibin/default/lib/async_req
'
,
'
-Ibin/default/lib/compression
'
,
'
-Ibin/default/lib/crypto
'
,
'
-Ibin/default/lib/dbwrap
'
,
'
-Ibin/default/lib/krb5_wrap
'
,
'
-Ibin/default/lib/ldb
'
,
'
-Ibin/default/lib/ldb-samba
'
,
'
-Ibin/default/lib/ldb/include
'
,
'
-Ibin/default/lib/param
'
,
'
-Ibin/default/lib/pthreadpool
'
,
'
-Ibin/default/lib/replace
'
,
'
-Ibin/default/lib/smbconf
'
,
'
-Ibin/default/lib/socket
'
,
'
-Ibin/default/lib/talloc
'
,
'
-Ibin/default/lib/tdb
'
,
'
-Ibin/default/lib/tdb/include
'
,
'
-Ibin/default/lib/tevent
'
,
'
-Ibin/default/lib/tsocket
'
,
'
-Ibin/default/lib/util/charset
'
,
'
-Ibin/default/libcli/auth
'
,
'
-Ibin/default/libcli/cldap
'
,
'
-Ibin/default/libcli/drsuapi
'
,
'
-Ibin/default/libcli/ldap
'
,
'
-Ibin/default/libcli/lsarpc
'
,
'
-Ibin/default/libcli/named_pipe_auth
'
,
'
-Ibin/default/libcli/nbt
'
,
'
-Ibin/default/libcli/netlogon
'
,
'
-Ibin/default/libcli/registry
'
,
'
-Ibin/default/libcli/security
'
,
'
-Ibin/default/libcli/smb
'
,
'
-Ibin/default/libcli/util
'
,
'
-Ibin/default/libds/common
'
,
'
-Ibin/default/librpc
'
,
'
-Ibin/default/nsswitch
'
,
'
-Ibin/default/nsswitch/libwbclient
'
,
'
-Ibin/default/source3
'
,
'
-Ibin/default/source3/auth
'
,
'
-Ibin/default/source3/include
'
,
'
-Ibin/default/source3/lib
'
,
'
-Ibin/default/source3/librpc
'
,
'
-Ibin/default/source3/modules
'
,
'
-Ibin/default/source3/param
'
,
'
-Ibin/default/source3/rpc_server
'
,
'
-Ibin/default/source3/smbd/notifyd
'
,
'
-Ibin/default/source4
'
,
'
-Ibin/default/source4/auth
'
,
'
-Ibin/default/source4/auth/gensec
'
,
'
-Ibin/default/source4/auth/kerberos
'
,
'
-Ibin/default/source4/cluster
'
,
'
-Ibin/default/source4/dsdb
'
,
'
-Ibin/default/source4/include
'
,
'
-Ibin/default/source4/lib
'
,
'
-Ibin/default/source4/lib/events
'
,
'
-Ibin/default/source4/lib/http
'
,
'
-Ibin/default/source4/lib/messaging
'
,
'
-Ibin/default/source4/lib/socket
'
,
'
-Ibin/default/source4/lib/stream
'
,
'
-Ibin/default/source4/lib/tls
'
,
'
-Ibin/default/source4/libcli
'
,
'
-Ibin/default/source4/libcli/ldap
'
,
'
-Ibin/default/source4/librpc
'
,
'
-Ibin/default/source4/param
'
,
'
-Ibin/default/third_party/zlib
'
,
'
-Wall
'
,
'
-Wcast-align
'
,
'
-Wcast-qual
'
,
...
...
README.Coding
View file @
2aa475bf
...
...
@@ -445,6 +445,55 @@ The only exception is the test code that depends repeated use of calls
like CHECK_STATUS, CHECK_VAL and others.
Error and out logic
-------------------
Don't do this:
frame = talloc_stackframe();
if (ret == LDB_SUCCESS) {
if (result->count == 0) {
ret = LDB_ERR_NO_SUCH_OBJECT;
} else {
struct ldb_message *match =
get_best_match(dn, result);
if (match == NULL) {
TALLOC_FREE(frame);
return LDB_ERR_OPERATIONS_ERROR;
}
*msg = talloc_move(mem_ctx, &match);
}
}
TALLOC_FREE(frame);
return ret;
It should be:
frame = talloc_stackframe();
if (ret != LDB_SUCCESS) {
TALLOC_FREE(frame);
return ret;
}
if (result->count == 0) {
TALLOC_FREE(frame);
return LDB_ERR_NO_SUCH_OBJECT;
}
match = get_best_match(dn, result);
if (match == NULL) {
TALLOC_FREE(frame);
return LDB_ERR_OPERATIONS_ERROR;
}
*msg = talloc_move(mem_ctx, &match);
TALLOC_FREE(frame);
return LDB_SUCCESS;
DEBUG statements
----------------
...
...
VERSION
View file @
2aa475bf
...
...
@@ -24,8 +24,8 @@
# -> "3.0.0" #
########################################################
SAMBA_VERSION_MAJOR=4
SAMBA_VERSION_MINOR=
7
SAMBA_VERSION_RELEASE=
4
SAMBA_VERSION_MINOR=
8
SAMBA_VERSION_RELEASE=
0
########################################################
# If a official release has a serious bug #
...
...
WHATSNEW.txt
View file @
2aa475bf
This diff is collapsed.
Click to expand it.
auth/common_auth.h
View file @
2aa475bf
...
...
@@ -131,6 +131,16 @@ struct auth4_context {
uint8_t
*
pauthoritative
,
void
**
server_returned_info
,
DATA_BLOB
*
nt_session_key
,
DATA_BLOB
*
lm_session_key
);
struct
tevent_req
*
(
*
check_ntlm_password_send
)(
TALLOC_CTX
*
mem_ctx
,
struct
tevent_context
*
ev
,
struct
auth4_context
*
auth_ctx
,
const
struct
auth_usersupplied_info
*
user_info
);
NTSTATUS
(
*
check_ntlm_password_recv
)(
struct
tevent_req
*
req
,
TALLOC_CTX
*
mem_ctx
,
uint8_t
*
pauthoritative
,
void
**
server_returned_info
,
DATA_BLOB
*
nt_session_key
,
DATA_BLOB
*
lm_session_key
);
NTSTATUS
(
*
get_ntlm_challenge
)(
struct
auth4_context
*
auth_ctx
,
uint8_t
chal
[
8
]);
...
...
auth/credentials/credentials.c
View file @
2aa475bf
...
...
@@ -550,7 +550,7 @@ _PUBLIC_ struct samr_Password *cli_credentials_get_nt_hash(struct cli_credential
password
,
password_len
);
if
(
converted
!=
sizeof
(
nt_hash
->
hash
))
{
TALLOC_FREE
(
nt_hash
);
return
false
;
return
NULL
;
}
}
else
{
E_md4hash
(
password
,
nt_hash
->
hash
);
...
...
@@ -700,7 +700,7 @@ _PUBLIC_ const char *cli_credentials_get_realm(struct cli_credentials *cred)
/**
* Set the realm for this credentials context, and force it to
* uppercase for the sa
i
nity of our local kerberos libraries
* uppercase for the sanity of our local kerberos libraries
*/
_PUBLIC_
bool
cli_credentials_set_realm
(
struct
cli_credentials
*
cred
,
const
char
*
val
,
...
...
@@ -975,8 +975,9 @@ _PUBLIC_ void cli_credentials_guess(struct cli_credentials *cred,
* Attach NETLOGON credentials for use with SCHANNEL
*/
_PUBLIC_
void
cli_credentials_set_netlogon_creds
(
struct
cli_credentials
*
cred
,
struct
netlogon_creds_CredentialState
*
netlogon_creds
)
_PUBLIC_
void
cli_credentials_set_netlogon_creds
(
struct
cli_credentials
*
cred
,
const
struct
netlogon_creds_CredentialState
*
netlogon_creds
)
{
TALLOC_FREE
(
cred
->
netlogon_creds
);
if
(
netlogon_creds
==
NULL
)
{
...
...
auth/credentials/credentials.h
View file @
2aa475bf
...
...
@@ -158,8 +158,9 @@ void cli_credentials_set_secure_channel_type(struct cli_credentials *cred,
enum
netr_SchannelType
secure_channel_type
);
void
cli_credentials_set_password_last_changed_time
(
struct
cli_credentials
*
cred
,
time_t
last_change_time
);
void
cli_credentials_set_netlogon_creds
(
struct
cli_credentials
*
cred
,
struct
netlogon_creds_CredentialState
*
netlogon_creds
);
void
cli_credentials_set_netlogon_creds
(
struct
cli_credentials
*
cred
,
const
struct
netlogon_creds_CredentialState
*
netlogon_creds
);
NTSTATUS
cli_credentials_set_krb5_context
(
struct
cli_credentials
*
cred
,
struct
smb_krb5_context
*
smb_krb5_context
);
NTSTATUS
cli_credentials_set_stored_principal
(
struct
cli_credentials
*
cred
,
...
...
auth/credentials/credentials_krb5.c
View file @
2aa475bf
...
...
@@ -35,6 +35,9 @@
#include
"auth/kerberos/pac_utils.h"
#include
"param/param.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
static
void
cli_credentials_invalidate_client_gss_creds
(
struct
cli_credentials
*
cred
,
enum
credentials_obtained
obtained
);
...
...
@@ -1151,16 +1154,17 @@ _PUBLIC_ int cli_credentials_get_server_gss_creds(struct cli_credentials *cred,
}
if
(
ktc
->
password_based
||
obtained
<
CRED_SPECIFIED
)
{
/* This creates a GSSAPI cred_id_t for match-by-key with only the keytab set */
maj_stat
=
smb_gss_krb5_import_cred
(
&
min_stat
,
smb_krb5_context
->
krb5_context
,
NULL
,
NULL
,
ktc
->
keytab
,
&
gcc
->
creds
);
}
else
{
/* This creates a GSSAPI cred_id_t with the principal and keytab set, matching by name */
maj_stat
=
smb_gss_krb5_import_cred
(
&
min_stat
,
smb_krb5_context
->
krb5_context
,
NULL
,
princ
,
ktc
->
keytab
,
&
gcc
->
creds
);
/*
* This creates a GSSAPI cred_id_t for match-by-key with only
* the keytab set
*/
princ
=
NULL
;
}
maj_stat
=
smb_gss_krb5_import_cred
(
&
min_stat
,
smb_krb5_context
->
krb5_context
,
NULL
,
princ
,
ktc
->
keytab
,
&
gcc
->
creds
);
if
(
maj_stat
)
{
if
(
min_stat
)
{
ret
=
min_stat
;
...
...
auth/credentials/credentials_ntlm.c
View file @
2aa475bf
...
...
@@ -28,6 +28,9 @@
#include
"auth/credentials/credentials.h"
#include
"auth/credentials/credentials_internal.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
_PUBLIC_
NTSTATUS
cli_credentials_get_ntlm_response
(
struct
cli_credentials
*
cred
,
TALLOC_CTX
*
mem_ctx
,
int
*
flags
,
DATA_BLOB
challenge
,
...
...
auth/credentials/credentials_secrets.c
View file @
2aa475bf
...
...
@@ -41,6 +41,9 @@
#include
"lib/util/util_tdb.h"
#include
"libds/common/roles.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
/**
* Fill in credentials for the machine trust account, from the secrets database.
*
...
...
auth/credentials/pycredentials.c
View file @
2aa475bf
...
...
@@ -31,6 +31,8 @@
#include
<tevent.h>
#include
"libcli/auth/libcli_auth.h"
#include
"auth/credentials/credentials_internal.h"
#include
"system/kerberos.h"
#include
"auth/kerberos/kerberos.h"
void
initcredentials
(
void
);
...
...
@@ -526,7 +528,7 @@ static PyObject *PyCredentialCacheContainer_from_ccache_container(struct ccache_
static
PyObject
*
py_creds_get_named_ccache
(
PyObject
*
self
,
PyObject
*
args
)
{
PyObject
*
py_lp_ctx
=
Py_None
;
char
*
ccache_name
;
char
*
ccache_name
=
NULL
;
struct
loadparm_context
*
lp_ctx
;
struct
ccache_container
*
ccc
;
struct
tevent_context
*
event_ctx
;
...
...
@@ -569,6 +571,48 @@ static PyObject *py_creds_get_named_ccache(PyObject *self, PyObject *args)
return
NULL
;
}
static
PyObject
*
py_creds_set_named_ccache
(
PyObject
*
self
,
PyObject
*
args
)
{
struct
loadparm_context
*
lp_ctx
=
NULL
;
enum
credentials_obtained
obt
=
CRED_SPECIFIED
;
const
char
*
error_string
=
NULL
;
TALLOC_CTX
*
mem_ctx
=
NULL
;
char
*
newval
=
NULL
;
PyObject
*
py_lp_ctx
=
Py_None
;
int
_obt
=
obt
;
int
ret
;
if
(
!
PyArg_ParseTuple
(
args
,
"s|iO"
,
&
newval
,
&
_obt
,
&
py_lp_ctx
))
return
NULL
;
mem_ctx
=
talloc_new
(
NULL
);
if
(
mem_ctx
==
NULL
)
{
PyErr_NoMemory
();
return
NULL
;
}
lp_ctx
=
lpcfg_from_py_object
(
mem_ctx
,
py_lp_ctx
);
if
(
lp_ctx
==
NULL
)
{
talloc_free
(
mem_ctx
);
return
NULL
;
}
ret
=
cli_credentials_set_ccache
(
PyCredentials_AsCliCredentials
(
self
),
lp_ctx
,
newval
,
CRED_SPECIFIED
,
&
error_string
);
if
(
ret
!=
0
)
{
PyErr_SetString
(
PyExc_RuntimeError
,
error_string
!=
NULL
?
error_string
:
"NULL"
);
talloc_free
(
mem_ctx
);
return
NULL
;
}
talloc_free
(
mem_ctx
);
Py_RETURN_NONE
;
}
static
PyObject
*
py_creds_set_gensec_features
(
PyObject
*
self
,
PyObject
*
args
)
{
unsigned
int
gensec_features
;
...
...
@@ -754,6 +798,9 @@ static PyMethodDef py_creds_methods[] = {
{
"guess"
,
py_creds_guess
,
METH_VARARGS
,
NULL
},
{
"set_machine_account"
,
py_creds_set_machine_account
,
METH_VARARGS
,
NULL
},
{
"get_named_ccache"
,
py_creds_get_named_ccache
,
METH_VARARGS
,
NULL
},
{
"set_named_ccache"
,
py_creds_set_named_ccache
,
METH_VARARGS
,
"S.set_named_ccache(krb5_ccache_name, obtained, lp) -> None
\n
"
"Set credentials to KRB5 Credentials Cache (by name)."
},
{
"set_gensec_features"
,
py_creds_set_gensec_features
,
METH_VARARGS
,
NULL
},
{
"get_gensec_features"
,
py_creds_get_gensec_features
,
METH_NOARGS
,
NULL
},
{
"get_forced_sasl_mech"
,
py_creds_get_forced_sasl_mech
,
METH_NOARGS
,
...
...
@@ -793,10 +840,38 @@ PyTypeObject PyCredentials = {
.
tp_methods
=
py_creds_methods
,
};
static
PyObject
*
py_ccache_name
(
PyObject
*
self
,
PyObject
*
unused
)
{
struct
ccache_container
*
ccc
=
NULL
;
char
*
name
=
NULL
;
PyObject
*
py_name
=
NULL
;
int
ret
;
ccc
=
pytalloc_get_type
(
self
,
struct
ccache_container
);
ret
=
krb5_cc_get_full_name
(
ccc
->
smb_krb5_context
->
krb5_context
,
ccc
->
ccache
,
&
name
);
if
(
ret
==
0
)
{
py_name
=
PyString_FromStringOrNULL
(
name
);
SAFE_FREE
(
name
);
}
else
{
PyErr_SetString
(
PyExc_RuntimeError
,
"Failed to get ccache name"
);
return
NULL
;
}
return
py_name
;
}
static
PyMethodDef
py_ccache_container_methods
[]
=
{
{
"get_name"
,
py_ccache_name
,
METH_NOARGS
,
"S.get_name() -> name
\n
Obtain KRB5 credentials cache name."
},
{
NULL
}
};
PyTypeObject
PyCredentialCacheContainer
=
{
.
tp_name
=
"credentials.CredentialCacheContainer"
,
.
tp_flags
=
Py_TPFLAGS_DEFAULT
,
.
tp_methods
=
py_ccache_container_methods
,
};
MODULE_INIT_FUNC
(
credentials
)
...
...
auth/credentials/tests/bind.py
View file @
2aa475bf
...
...
@@ -43,6 +43,7 @@ creds_machine = copy.deepcopy(creds)
creds_user1
=
copy
.
deepcopy
(
creds
)
creds_user2
=
copy
.
deepcopy
(
creds
)
creds_user3
=
copy
.
deepcopy
(
creds
)
creds_user4
=
copy
.
deepcopy
(
creds
)
class
BindTests
(
samba
.
tests
.
TestCase
):
...
...
@@ -64,7 +65,7 @@ class BindTests(samba.tests.TestCase):
self
.
config_dn
=
self
.
info_dc
[
"
configurationNamingContext
"
][
0
]
self
.
computer_dn
=
"
CN=centos53,CN=Computers,%s
"
%
self
.
domain_dn
self
.
password
=
"
P@ssw0rd
"
self
.
username
=
"
BindTestUser
_
"
+
time
.
strftime
(
"
%s
"
,
time
.
gmtime
())
self
.
username
=
"
BindTestUser
"
def
tearDown
(
self
):
super
(
BindTests
,
self
).
tearDown
()
...
...
@@ -113,6 +114,7 @@ unicodePwd:: """ + base64.b64encode("\"P@ssw0rd\"".encode('utf-16-le')) + """
expression
=
"
(samAccountName=%s)
"
%
self
.
username
)
self
.
assertEquals
(
len
(
ldb_res
),
1
)
user_dn
=
ldb_res
[
0
][
"
dn
"
]
self
.
addCleanup
(
delete_force
,
self
.
ldb
,
user_dn
)
# do a simple bind and search with the user account in format user@realm
creds_user1
.
set_bind_dn
(
self
.
username
+
"
@
"
+
creds
.
get_realm
())
...
...
@@ -138,5 +140,27 @@ unicodePwd:: """ + base64.b64encode("\"P@ssw0rd\"".encode('utf-16-le')) + """
lp
=
lp
,
ldap_only
=
True
)
res
=
ldb_user3
.
search
(
base
=
""
,
expression
=
""
,
scope
=
SCOPE_BASE
,
attrs
=
[
"
*
"
])
def
test_user_account_bind_no_domain
(
self
):
# create user
self
.
ldb
.
newuser
(
username
=
self
.
username
,
password
=
self
.
password
)
ldb_res
=
self
.
ldb
.
search
(
base
=
self
.
domain_dn
,
scope
=
SCOPE_SUBTREE
,
expression
=
"
(samAccountName=%s)
"
%
self
.
username
)
self
.
assertEquals
(
len
(
ldb_res
),
1
)
user_dn
=
ldb_res
[
0
][
"
dn
"
]
self
.
addCleanup
(
delete_force
,
self
.
ldb
,
user_dn
)
creds_user4
.
set_username
(
self
.
username
)
creds_user4
.
set_password
(
self
.
password
)
creds_user4
.
set_domain
(
''
)
creds_user4
.
set_workstation
(
''
)
print
"
BindTest (no domain) with:
"
+
self
.
username
try
:
ldb_user4
=
samba
.
tests
.
connect_samdb
(
host
,
credentials
=
creds_user4
,
lp
=
lp
,
ldap_only
=
True
)
except
:
self
.
fail
(
"
Failed to connect without the domain set
"
)
res
=
ldb_user4
.
search
(
base
=
""
,
expression
=
""
,
scope
=
SCOPE_BASE
,
attrs
=
[
"
*
"
])
TestProgram
(
module
=
__name__
,
opts
=
subunitopts
)
auth/gensec/external.c
View file @
2aa475bf
...
...
@@ -28,6 +28,9 @@
#include
"auth/gensec/gensec_proto.h"
#include
"auth/gensec/gensec_toplevel_proto.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
/* SASL/EXTERNAL is essentially a no-op; it is only usable when the transport
* layer is already mutually authenticated.
*/
...
...
auth/gensec/gensec.c
View file @
2aa475bf
...
...
@@ -31,6 +31,9 @@
#include
"librpc/gen_ndr/dcerpc.h"
#include
"auth/common_auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
_PRIVATE_
NTSTATUS
gensec_may_reset_crypto
(
struct
gensec_security
*
gensec_security
,
bool
full_reset
)
{
...
...
@@ -319,24 +322,35 @@ static NTSTATUS gensec_verify_features(struct gensec_security *gensec_security)
return
NT_STATUS_OK
;
}
_PUBLIC_
NTSTATUS
gensec_update_ev
(
struct
gensec_security
*
gensec_security
,
/**
* Next state function for the GENSEC state machine
*
* @param gensec_security GENSEC State
* @param out_mem_ctx The TALLOC_CTX for *out to be allocated on
* @param in The request, as a DATA_BLOB
* @param out The reply, as an talloc()ed DATA_BLOB, on *out_mem_ctx
* @return Error, MORE_PROCESSING_REQUIRED if a reply is sent,
* or NT_STATUS_OK if the user is authenticated.
*/
_PUBLIC_
NTSTATUS
gensec_update
(
struct
gensec_security
*
gensec_security
,
TALLOC_CTX
*
out_mem_ctx
,
struct
tevent_context
*
ev
,
const
DATA_BLOB
in
,
DATA_BLOB
*
out
)
{
NTSTATUS
status
;
const
struct
gensec_security_ops
*
ops
=
gensec_security
->
ops
;
TALLOC_CTX
*
frame
=
NULL
;
struct
tevent_context
*
ev
=
NULL
;
struct
tevent_req
*
subreq
=
NULL
;
bool
ok
;
if
(
gensec_security
->
child_security
!=
NULL
)
{
return
NT_STATUS_INVALID_PARAMETER
;
if
(
gensec_security
->
subcontext
)
{
/*
* gensec modules are not allowed to call the sync version.
*/
return
NT_STATUS_INTERNAL_ERROR
;
}
frame
=
talloc_stackframe
();
if
(
ev
==
NULL
)
{
ev
=
samba_tevent_context_init
(
frame
);
if
(
ev
==
NULL
)
{
status
=
NT_STATUS_NO_MEMORY
;
...
...
@@ -348,9 +362,8 @@ _PUBLIC_ NTSTATUS gensec_update_ev(struct gensec_security *gensec_security,
* are fixed.
*/
tevent_loop_allow_nesting
(
ev
);
}
subreq
=
ops
->
update_send
(
frame
,
ev
,
gensec_security
,
in
);
subreq
=
gensec_
update_send
(
frame
,
ev
,
gensec_security
,
in
);
if
(
subreq
==
NULL
)
{
status
=
NT_STATUS_NO_MEMORY
;
goto
fail
;
...
...
@@ -359,43 +372,12 @@ _PUBLIC_ NTSTATUS gensec_update_ev(struct gensec_security *gensec_security,
if
(
!
ok
)
{
goto
fail
;
}
status
=
ops
->
update_recv
(
subreq
,
out_mem_ctx
,
out
);
if
(
!
NT_STATUS_IS_OK
(
status
))
{
goto
fail
;
}
/*
* Because callers using the
* gensec_start_mech_by_auth_type() never call
* gensec_want_feature(), it isn't sensible for them
* to have to call gensec_have_feature() manually, and
* these are not points of negotiation, but are
* asserted by the client
*/
status
=
gensec_verify_features
(
gensec_security
);
status
=
gensec_update_recv
(
subreq
,
out_mem_ctx
,
out
);
fail:
TALLOC_FREE
(
frame
);
return
status
;
}
/**
* Next state function for the GENSEC state machine
*
* @param gensec_security GENSEC State
* @param out_mem_ctx The TALLOC_CTX for *out to be allocated on
* @param in The request, as a DATA_BLOB
* @param out The reply, as an talloc()ed DATA_BLOB, on *out_mem_ctx
* @return Error, MORE_PROCESSING_REQUIRED if a reply is sent,
* or NT_STATUS_OK if the user is authenticated.
*/
_PUBLIC_
NTSTATUS
gensec_update
(
struct
gensec_security
*
gensec_security
,
TALLOC_CTX
*
out_mem_ctx
,
const
DATA_BLOB
in
,
DATA_BLOB
*
out
)
{
return
gensec_update_ev
(
gensec_security
,
out_mem_ctx
,
NULL
,
in
,
out
);
}
struct
gensec_update_state
{
const
struct
gensec_security_ops
*
ops
;
struct
gensec_security
*
gensec_security
;
...
...
@@ -454,6 +436,9 @@ _PUBLIC_ struct tevent_req *gensec_update_send(TALLOC_CTX *mem_ctx,
}
tevent_req_set_callback
(
subreq
,
gensec_update_done
,
req
);
DBG_DEBUG
(
"%s[%p]: subreq: %p
\n
"
,
state
->
ops
->
name
,
state
->
gensec_security
,
subreq
);
return
req
;
}
...
...
@@ -484,15 +469,35 @@ static void gensec_update_done(struct tevent_req *subreq)
tevent_req_data
(
req
,
struct
gensec_update_state
);
NTSTATUS
status
;
const
char
*
debug_subreq
=
NULL
;
if
(
CHECK_DEBUGLVL
(
DBGLVL_DEBUG
))
{
/*
* We need to call tevent_req_print()
* before calling the _recv function,
* before tevent_req_received() was called.
* in order to print the pointer value of
* the subreq state.
*/
debug_subreq
=
tevent_req_print
(
state
,
subreq
);
}
status
=
state
->
ops
->
update_recv
(
subreq
,
state
,
&
state
->
out
);
TALLOC_FREE
(
subreq
);
state
->
status
=
status
;
if
(
NT_STATUS_EQUAL
(
status
,
NT_STATUS_MORE_PROCESSING_REQUIRED
))
{
tevent_req_done
(
req
);
if
(
GENSEC_UPDATE_IS_NTERROR
(
status
))
{
DBG_INFO
(
"%s[%p]: %s%s%s
\n
"
,
state
->
ops
->
name
,
state
->
gensec_security
,
nt_errstr
(
status
),
debug_subreq
?
" "
:
""
,
debug_subreq
?
debug_subreq
:
""
);
tevent_req_nterror
(
req
,
status
);
return
;
}
if
(
tevent_req_nterror
(
req
,
status
))
{
DBG_DEBUG
(
"%s[%p]: %s %s
\n
"
,
state
->
ops
->
name
,
state
->
gensec_security
,
nt_errstr
(
status
),
debug_subreq
);
if
(
NT_STATUS_EQUAL
(
status
,
NT_STATUS_MORE_PROCESSING_REQUIRED
))
{
tevent_req_done
(
req
);
return
;
}
...
...
auth/gensec/gensec.h
View file @
2aa475bf
...
...
@@ -138,10 +138,6 @@ size_t gensec_max_update_size(struct gensec_security *gensec_security);
NTSTATUS
gensec_update
(
struct
gensec_security
*
gensec_security
,
TALLOC_CTX
*
out_mem_ctx
,
const
DATA_BLOB
in
,
DATA_BLOB
*
out
);
NTSTATUS
gensec_update_ev
(
struct
gensec_security
*
gensec_security
,
TALLOC_CTX
*
out_mem_ctx
,
struct
tevent_context
*
ev
,
const
DATA_BLOB
in
,
DATA_BLOB
*
out
);
struct
tevent_req
*
gensec_update_send
(
TALLOC_CTX
*
mem_ctx
,
struct
tevent_context
*
ev
,
struct
gensec_security
*
gensec_security
,
...
...
auth/gensec/gensec_internal.h
View file @
2aa475bf
...
...
@@ -86,6 +86,7 @@ struct gensec_security_ops {
bool
enabled
;
bool
kerberos
;
enum
gensec_priority
priority
;
bool
glue
;
};
struct
gensec_security_ops_wrapper
{
...
...
auth/gensec/gensec_start.c
View file @
2aa475bf
...
...
@@ -33,6 +33,9 @@
#include
"lib/util/samba_modules.h"
#include
"lib/util/base64.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
/* the list of currently registered GENSEC backends */
static
const
struct
gensec_security_ops
**
generic_security_ops
;
static
int
gensec_num_backends
;
...
...
@@ -98,15 +101,12 @@ _PUBLIC_ const struct gensec_security_ops **gensec_use_kerberos_mechs(TALLOC_CTX
j
=
0
;
for
(
i
=
0
;
old_gensec_list
&&
old_gensec_list
[
i
];
i
++
)
{
int
oid_idx
;
bool
keep
=
false
;
for
(
oid_idx
=
0
;
old_gensec_list
[
i
]
->
oid
&&
old_gensec_list
[
i
]
->
oid
[
oid_idx
];
oid_idx
++
)
{
if
(
strcmp
(
old_gensec_list
[
i
]
->
oid
[
oid_idx
],
GENSEC_OID_SPNEGO
)
==
0
)
{
keep
=
true
;
break
;
}
}
/*
* We want to keep SPNGEO and other backends
*/
keep
=
old_gensec_list
[
i
]
->
glue
;
if
(
old_gensec_list
[
i
]
->
auth_type
==
DCERPC_AUTH_TYPE_SCHANNEL
)
{
keep
=
keep_schannel
;
...
...
auth/gensec/gensec_util.c
View file @
2aa475bf
...
...
@@ -26,6 +26,9 @@
#include
"auth/common_auth.h"
#include
"../lib/util/asn1.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
NTSTATUS
gensec_generate_session_info_pac
(
TALLOC_CTX
*
mem_ctx
,
struct
gensec_security
*
gensec_security
,
struct
smb_krb5_context
*
smb_krb5_context
,
...
...
Prev
1
2
3
4
5
…
50
Next