summaryrefslogtreecommitdiff
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
* smbd: build smb_fname per file to delete in unlink_internals()Ralph Boehme2020-07-181-13/+23
| | | | | | | | | | | Make sure to pass fresh smb_fname's to do_unlink(). Needed for path-ref fsps in the future. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jul 18 07:21:11 UTC 2020 on sn-devel-184
* smbd: consolidate fsp allocation for open_directory() and open_file_ntcreate()Ralph Boehme2020-07-181-64/+31
| | | | | | | ...at one place in the caller create_file_unixpath(). Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: factor out fsp_bind_smb()Ralph Boehme2020-07-182-23/+38
| | | | | | | Needed for path-ref fsps in the future. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: don't mess with smb_dname->base_name in call_trans2findfirst()Ralph Boehme2020-07-181-4/+11
| | | | | | | | Create a fresh name instead. Needed to proper support for path-ref fsps in the future. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/lib: fsp_str_dbg() doesn't show a possible stream nameRalph Boehme2020-07-181-1/+6
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: use helper variable for fd in fd_open()Ralph Boehme2020-07-181-8/+7
| | | | | | | | No change in behaviour. Fwiw, no need to set fsp->fh->fd to -1 in the error case, as that is initialized to -1 in fsp_new(). Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: remove errno saving from fd_open()Ralph Boehme2020-07-181-8/+0
| | | | | | | This is not needed anymore since 97d061237b0f2e07ae9c8e893734e222e58cfa4e. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: remove a nested block in non_widelink_open()Ralph Boehme2020-07-181-12/+9
| | | | | | | No change in behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: use (global) POSIX pathname state in non_widelink_open()Ralph Boehme2020-07-181-1/+1
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: check for conn->cwd_fsp in fd_close()Ralph Boehme2020-07-181-0/+4
| | | | | | | This avoids doing the check in all callers. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: check for conn->cwd_fsp in file_free()Ralph Boehme2020-07-181-0/+4
| | | | | | | This avoids doing the check in all callers. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: use a helper variable in open_file()Ralph Boehme2020-07-181-0/+5
| | | | | | | No change in behaviour, this just prepares for changes to come. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: remove unused NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETERalph Boehme2020-07-182-4/+1
| | | | | | | The previous commit removed the only consumer of the flags. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: ensure we do a base open for internal stream deletesRalph Boehme2020-07-181-2/+2
| | | | | | | | | | Otherwise we're not opening the basefile so fsp->base_fsp remains NULL for fsp handles on streams. As there are some places that use the check (fsp->base_fsp != NULL) to check for stream handles, eg streams_xattr_fstat(), we must ensure it is set otherwise we open a pretty big window for undefined behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_posixacl: Remove unnecessary call to acl_set_permsetChristof Schmitt2020-07-171-1/+2
| | | | | | | | | | | | | After the initial acl_get_permset, the permset is alreadying pointing to the ACL entry and all changes are done on the ACL entry. There is no need to overwrite the permissions in the ACL entry again with the same value in the acl_set_permset call. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Fri Jul 17 18:33:41 UTC 2020 on sn-devel-184
* test_vfs_posixacl: Add unit test for Linux POSIX ACL mappingChristof Schmitt2020-07-173-0/+168
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: libsmb: Namecache. Fix bug missed by me in previous cleanup.Jeremy Allison2020-07-171-1/+1
| | | | | | | | | | | | | In ipstr_list_make() we need to look at the correct array entry to determine the ss_family for the sockaddr_storage. Otherwise we are always storing the type of the first entry. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Jul 17 05:54:31 UTC 2020 on sn-devel-184
* s3-libads: Pass timeout to open_socket_out in msIsaac Boukris2020-07-161-1/+3
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13124 Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Jul 16 10:41:40 UTC 2020 on sn-devel-184
* s3: libsmb: Cleanup - Make ipstr_list_make() talloc rather than malloc.Jeremy Allison2020-07-161-73/+60
| | | | | | | | | | | | | | | | | | Remove the excessive and unneeded ipstr_list_add() function, fold it into ipstr_list_make() to make it much clearer what we're doing. The only use of MALLOC now is in ipstr_list_parse() returned by namecache_fetch(). We need to fix the caller before we can move that to talloc. As that is used inside internal_resolve_name() which is designed to return a MALLOC'ed ip list from all name resolution mechanisms leave that fix for another day. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Jul 16 08:16:31 UTC 2020 on sn-devel-184
* s3: libsmb: Cleanup - Move DEBUG -> DBG_XXX() macros.Jeremy Allison2020-07-161-16/+12
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Cleanup - make namecache_status_record_key() use talloc.Jeremy Allison2020-07-161-12/+21
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Cleanup - make namecache_key() use talloc.Jeremy Allison2020-07-161-13/+14
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Cleanup - namecache_store() - use common out.Jeremy Allison2020-07-161-8/+7
| | | | | | | Prepare for moving malloc values to talloc. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Cleanup - namecache_store() initialize stack variables.Jeremy Allison2020-07-161-2/+3
| | | | | | | Preparing for common out: exit. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Cleanup - move talloc frame out of inner scope.Jeremy Allison2020-07-161-3/+6
| | | | | | | | Make it available thoughout the function. Prepare to use talloc for namecache_key(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: libsmb: Cleanup modern coding standards. 'True/False' -> 'true/false'.Jeremy Allison2020-07-161-12/+12
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: lib: Cleanup - make ipstr_list_make() and ipstr_list_parse() private to ↵Jeremy Allison2020-07-162-6/+2
| | | | | | | the only user. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: lib: Cleanup - nothing uses ipstr_list_free(). Remove it.Jeremy Allison2020-07-162-12/+0
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: lib: Cleanup - all the ipstr_XXX() functions are only used in namecache.c.Jeremy Allison2020-07-162-164/+164
| | | | | | | Move them there. Will remove from the global namespace next. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Remove code inside #ifdef HAVE_BROKEN_READDIR_NAMEChristof Schmitt2020-07-161-6/+0
| | | | | | | This is dead code, the define is never set. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* lib/util: Remove code inside #ifdef HAVE_BROKEN_READDIR_NAMEChristof Schmitt2020-07-161-5/+0
| | | | | | | This is dead code, the define is never set. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* lib/util: Remove code inside #ifdef NEXT2Christof Schmitt2020-07-161-5/+0
| | | | | | | This is dead code, the define is never set. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Remove code inside #ifdef NEXT2Christof Schmitt2020-07-161-5/+0
| | | | | | | This is dead code, the define is never set. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:smbd: stop accepting multichannel connections early in exit_server_common()Stefan Metzmacher2020-07-143-1/+23
| | | | | | | | | | | | | This is just a step in the correct direction, but there's still a possible race... BUG: https://bugzilla.samba.org/show_bug.cgi?id=14433 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Jul 14 14:59:19 UTC 2020 on sn-devel-184
* s3:smbd: move exit_firsttime checking to the start of exit_server_common()Stefan Metzmacher2020-07-141-3/+5
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14433 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* net: ignore possible SIGPIPE upon ldap_unbind when over TLSIsaac Boukris2020-07-131-0/+3
| | | | | | | | | | | | | | | | | | | | | From local tests with strace: socket(AF_UNIX, SOCK_STREAM, 0) = 12 write(2, "Connecting to 10.53.57.21 at por"..., 38) = 38 ... write(2, "ads_domain_func_level: 3\n", 25) = 25 write(12, "\27\3\3\0\37\0\0\0\0\0\0\0\16nl[\374\375i\325\334\25\227kxG@\326\311R\225x"..., 36) = 36 write(12, "\25\3\3\0\32\0\0\0\0\0\0\0\17Hh\304\254\244\17\342<\334\210L&\20_\177\307\232P", 31) = -1 EPIPE (Broken pipe) --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=12089, si_uid=1000} --- +++ killed by SIGPIPE +++ BUG: https://bugzilla.samba.org/show_bug.cgi?id=14439 Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Isaac Boukris <iboukris@samba.org> Autobuild-Date(master): Mon Jul 13 12:06:07 UTC 2020 on sn-devel-184
* ads: set sasl-wrapping to plain when over TLSIsaac Boukris2020-07-131-0/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14439 Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* Fix ads_set_sasl_wrap_flags to only change sasl flagsIsaac Boukris2020-07-132-3/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14439 Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* Decouple ldap-ssl-ads from ldap-ssl optionIsaac Boukris2020-07-135-8/+49
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14439 Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* winbind: Fix lookuprids cache problemVolker Lendecke2020-07-091-1/+2
| | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=14435 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Jul 9 21:40:52 UTC 2020 on sn-devel-184
* winbind: Add test for lookuprids cache problemVolker Lendecke2020-07-092-0/+26
| | | | | | | | | | | | | | | | | | | | When reading entries from gencache, wb_cache_rids_to_names() can return STATUS_SOME_UNMAPPED, which _wbint_LookupRids() does not handle correctly. This test enforces this situation by filling gencache with one wbinfo -R and then erasing the winbindd_cache.tdb. This forces winbind to enter the domain helper process, which will then read from gencache filled with the previous wbinfo -R. Without having the entries cached this does not happen because wb_cache_rids_to_names() via the do_query: path calls deep inside calls dcerpc_lsa_lookup_sids_noalloc(), which hides the STATUS_SOME_UNMAPPED that came in as lsa_LookupSids result value. Bug: https://bugzilla.samba.org/show_bug.cgi?id=14435 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* torture3: Align integer typesVolker Lendecke2020-07-091-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* torture3: Silence two signed/unsigned warningsVolker Lendecke2020-07-091-2/+2
| | | | | | | | | A longer fix would be to change the callbacks to use "int" instead of "unsigned". Arguably that might be cleaner, but as this is torture code I opted for the minimum necessary change. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3:smbd: skip ctdb public ips in fsctl_network_iface_info()Stefan Metzmacher2020-07-081-0/+28
| | | | | | | | | | | | | Multi-Channel clients should not connect to ctdb public ip addresses (which move between nodes). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11898 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Jul 8 17:16:40 UTC 2020 on sn-devel-184
* s3:smbd: disconnect the all client connections if a ctdb public ip droppedStefan Metzmacher2020-07-083-0/+36
| | | | | | | | | | | For now we keep it simple and any disconnect on a connection that used a ctdb public address, will disconnect all other remaining connections. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11898 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: make smbXsrv_client_connection_pass_loop() more robustStefan Metzmacher2020-07-081-9/+22
| | | | | | | | | Don't leak fds in the error paths. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11898 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: make sure smbXsrv_connection_disconnect_transport() closes the ↵Stefan Metzmacher2020-07-082-2/+7
| | | | | | | | | | | | socket fd I assumed that TALLOC_FREE(xconn->transport.fde) would close the socket, but until now we didn't use tevent_fd_set_auto_close(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11898 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: make sure we detect stale smbXsrv_connection pointers in ↵Stefan Metzmacher2020-07-082-0/+6
| | | | | | | | | | | | | | | | | | smbXsrv_session_auth0 Pointer values can be reused (yes, I hit that during my testing!). Introduce a channel_id to identify connections and also add some timestamps to make debugging easier. This makes smbXsrv_session_find_auth() much more robust. This is a similar change as 0cec96526bf4d3209caf36c4a19632ff5d5dd112: "smb2_server: make sure we detect stale smbXsrv_connection pointers in smbXsrv_channel_global" BUG: https://bugzilla.samba.org/show_bug.cgi?id=11898 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: fill in xconn->client early in smbd_add_connection()Stefan Metzmacher2020-07-081-2/+1
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11898 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3:smbd: handle NETWORK_ACCESS_DENIED in smbXsrv_client_connection_pass_loop()Stefan Metzmacher2020-07-081-0/+4
| | | | | | | | | | | | smbd_add_connection() may return a valid connection together with NT_STATUS_NETWORK_ACCESS_DENIED. We need additional cleanup for that case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11898 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>