1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

47341 Commits

Author SHA1 Message Date
Ralph Boehme
c0aa94ece0 s3:smbd: add expected_seq_low arg to smbd_initialize_smb2
This is in preparation of connection passing for multichannel where we
have to set seq_low to the mid of the passed negprot.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-10-06 21:53:19 +02:00
Ralph Boehme
5d7eaf959a vfs_fruit: return value of ad_pack in vfs_fruit.c
ad_pack() in vfs_fruit.c returns false on failure and 0 on success -
i.e. return value is interpreted as success even when it fails.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Tue Oct  6 16:14:42 CEST 2015 on sn-devel-104
2015-10-06 16:14:42 +02:00
Volker Lendecke
cc93469a04 lib: Fix CID 1128553 Unchecked return value from library
At the same time, avoid chmod in favor of fchmod

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Oct  6 13:12:48 CEST 2015 on sn-devel-104
2015-10-06 13:12:48 +02:00
Volker Lendecke
0db470df91 lib: Fix CID 1325733 Uninitialized scalar variable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-10-06 10:10:16 +02:00
Stefan Metzmacher
70dbba96e3 s3:ctdbd_conn: make sure we destroy tevent_fd before closing the socket
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2015-10-06 10:10:16 +02:00
Volker Lendecke
97bb100a76 lib: Pass sockname and timeout to ctdbd_probe()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Oct  3 03:04:39 CEST 2015 on sn-devel-104
2015-10-03 03:04:39 +02:00
Volker Lendecke
770b0e40d2 lib: Pass sockname and timeout to ctdbd_messaging_connection
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-03 00:01:11 +02:00
Volker Lendecke
025fb48360 lib: Move lp_ctdbd_socket() to cluster_support.c
There we have a #ifdef CTDB_SOCKET anyway

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-03 00:01:11 +02:00
Volker Lendecke
ccd31e0c18 lib: Pass parameters to ctdbd_init_connection()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-03 00:01:11 +02:00
Volker Lendecke
0bc244ee58 lib: Store sockname in ctdbd_connection
We'll need it in ctdbd_traverse()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-03 00:01:11 +02:00
Volker Lendecke
6c86062453 lib: Remove temporary ctdb_connection in ctdb_control
I can just assume this is a bad hack for a condition that should have been
fixed in a different way. Today we pretty much expect a messaging_context to be
properly initialized everywhere, and this includes a ctdb connection.

If something later fails due to this commit, we need to do a
messaging_init before the offending call

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-03 00:01:11 +02:00
Volker Lendecke
2aedb2d085 lib: Store ctdb_timeout in ctdb_connection
This lifts the call to lp_ctdb_timeout() up

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-03 00:01:11 +02:00
Volker Lendecke
54c7b05283 lib: Lift lp_ctdbd_socket() call up one level
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-03 00:01:11 +02:00
Günther Deschner
6755376ced kerberos: make sure we only use prompter type when available.
We also verified that we cannot simply remove the prompter as several older
versions of Heimdal would crash.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Oct  2 07:29:43 CEST 2015 on sn-devel-104
2015-10-02 07:29:43 +02:00
Volker Lendecke
e524ab9f7e winbind: Fix 100% loop
Thanks to "L.P.H. van Belle" <belle@bazuin.nl>
for help in reproducing the issue.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11038

From the bug report:

"With e551cdb37d re-applied the problem is gone with
and without kerberos. Moreover, if correctly configured,
sshd requests you to change your password at logon time,
which then succeeds.

The problem why I had this reverted was because I had not
gone through the pain to correctly configure all the PAM
services (in particular the "account" section), leading
to sshd letting the user in when the password had to be
changed."

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

(cherry picked from commit e551cdb37d)

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct  2 00:16:29 CEST 2015 on sn-devel-104
2015-10-02 00:16:29 +02:00
Jeremy Allison
f9ceaf4439 s3: smbd: Fix NULL pointer bug introduced by previous 'raw' stream fix (bug #11522).
Ensure dirpath can never be NULL.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11535

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Oct  1 08:58:36 CEST 2015 on sn-devel-104
2015-10-01 08:58:36 +02:00
Ralph Boehme
bec685fb13 s3: smbd: fix a crash in unix_convert()
Some error code paths may result in dirpath being NULL.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11535

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-01 05:56:10 +02:00
Volker Lendecke
00954a975b lib: We can do ACCRIGHTS style fdpassing
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11053

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Oct  1 05:55:42 CEST 2015 on sn-devel-104
2015-10-01 05:55:42 +02:00
Volker Lendecke
0499cee903 lib: Support fd passing using the 4.3BSD way
This is required on Solaris

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11053

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-10-01 02:55:21 +02:00
Volker Lendecke
f4e06a9bce lib: Move some routines around in msghdr.c
This way we only need one #ifdef for ACCRIGHTS

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11053

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-10-01 02:55:21 +02:00
Volker Lendecke
2c675aad40 lib: We only need the fd-passing check once
unix_dgram_send will tell us as well

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11053

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-10-01 02:55:21 +02:00
Volker Lendecke
620b7467ad lib: Remove ctdb_serverids_exist
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Volker Lendecke
103658ddd0 lib: Remove serverids_exist
The only reason for this complex monster was an overload of ctdbd.
When opening files, we unconditionally checked all share modes for
validity. This meant thousands of serverid_exists calls per second
for popular directories. This has long gone, now we only check for
validity if a conflict happens.

The only remaining caller is net serverid wipedbs, an administrative
command. If that loads ctdbd, so be it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Volker Lendecke
b542ce7db3 lib: Use messaging_dgm_get_unique in serverid_exists
This is a relevant change: I was experimenting with
server_id_db_set_exclusive() in "net" and got failures all over the
place. The main reason was that "net" by default does not do a
serverid_register. With messaging_dgm we have the process' unique
id available via the lockfile contents. Using open/read/close is a
bit slower than local tdb access, but this version is safe for all
processes which have done messaging_init()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Volker Lendecke
c793fb8a66 lib: Use serverid_exists in server_id_db_check_exclusive
If there's another process around there will typically be at most
one process. So there is no real need to run the plural version of
serverid_exists.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Volker Lendecke
37f01c869d messages_dgm: Add messaging_dgm_get_unique
To be able to read, we need to open the lockfile O_RDWR instead of O_WRONLY

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Volker Lendecke
beb7c6b941 net: Add "serverid exists"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Volker Lendecke
e119f95532 net: Fix some tiny memleaks
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Michael Adam
348dd41871 s3:lib:interface: break an overly long line
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:12 +02:00
Volker Lendecke
edd18f7a1d messages_dgm: Fix an incorrect cast
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Sep 30 17:36:32 CEST 2015 on sn-devel-104
2015-09-30 17:36:32 +02:00
Volker Lendecke
cfca46a565 messages_dgm: No includes.h necessary
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 14:35:20 +02:00
Günther Deschner
6ef2d288a7 s3-rpcclient: protect against empty witness async notify messages.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-09-29 11:59:20 +02:00
Thomas Nagy
71a168eb2b build:wafsamba: Set the default installation prefix for Waf 1.8
These changes enable the default installation prefix settings to
take effect in both Waf 1.5 and 1.8 with no additional code changes.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-09-29 11:59:20 +02:00
Uri Simchoni
e224e62297 net: fix a crash with net ads keytab create
Fix a crash that happens when executing "net ads keytab create"
and the machine account in AD does not have setvice principal names
attached to it.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11528

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-09-25 05:19:23 +02:00
Christof Schmitt
2266e24008 smbd: Set process name for notifyd process
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Sep 24 11:02:44 CEST 2015 on sn-devel-104
2015-09-24 11:02:44 +02:00
Christof Schmitt
0b455a5c2d smbd: Set process name for async echo handler
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-09-24 08:00:16 +02:00
Christof Schmitt
96c48b3c06 s3: Move call to prctl_set_comment to reinit_after_fork
This save a few lines of code.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-09-24 08:00:16 +02:00
Jeremy Allison
b1c823dc8c s3: smbd: Fix mkdir race condition.
Found by Max of LoadDynamix <adx.forum@gmail.com>

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11486

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-09-24 03:12:21 +02:00
Volker Lendecke
a1187bb873 dbwrap: Remove talloc from dbwrap_watch_record_stored()
This happens on every store to locking.tdb for example, so we should
make it cheap.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Sep 22 07:50:58 CEST 2015 on sn-devel-104
2015-09-22 07:50:57 +02:00
Volker Lendecke
1a8750a2c6 dbwrap: Convert dbwrap_record_watchers_key to not use talloc
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-09-22 04:51:16 +02:00
Volker Lendecke
2e0e06c3c5 dbwrap: Simplify dbwrap_record_watchers_key()
It took a bit for me to figure out what the rec_key parameter to
dbwrap_record_watchers_key does. I think it's simpler to parse the watcher key
in dbwrap_record_watch_recv to retrieve the watched record key than to store it

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-09-22 04:51:16 +02:00
Volker Lendecke
9964d60e3e dbwrap: Make dbwrap_db_id return size_t
This will make an on-stack db-id easier

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-09-22 04:51:16 +02:00
Thomas Nagy
8262ecb988 build:wafsamba: Use the samba-provided CHECK_CFG method in configuration tests
This is for forward compatibility with waf 1.8. All other tests
use CHECK_CFG, but check_cfg was re-introduced for some reason.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-09-21 01:50:15 +02:00
Jeremy Allison
6ce3643e45 s3: tests: smbclient test to ensure we can create and see a :foobar stream on the top level directory in a share.
Regression test for:

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11522

Remember to remove the ARCHIVE attribute from the toplevel
share when done (can only be done over SMB2+).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Sep 18 11:00:44 CEST 2015 on sn-devel-104
2015-09-18 11:00:44 +02:00
Jeremy Allison
74fd4f93ef s3: smbd: Fix opening/creating :stream files on the root share directory.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11522

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-09-18 07:58:16 +02:00
Jeremy Allison
94e7e70778 s3: smbd: Remove unused parameter from build_stream_path().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-09-18 07:58:16 +02:00
Jeremy Allison
a47012d542 s3: smbclient: Move cmd_setmode out of clitar.c and back into client.c
setmode <file> attribute is a valid smbclient command even if libarchive
isn't on the system and tarmode isn't compiled in.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-09-18 07:58:15 +02:00
Stefan Metzmacher
1aabd9298d s3:lib/messages: use 'msg.lock' and 'msg.sock' for messaging related subdirs
In Samba 4.2, we used lock_path("msg") (with 0700) for the socket directory,
while we use lock_path("msg") (with 0755) for the lock file directory.

This generates a conflict that prevents samba, smbd, nmbd and winbindd
from starting after an upgrade.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11515

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-09-17 06:03:17 +02:00
Stefan Metzmacher
b0fa8316be s3:lib/messages: add missing allocation check for priv_path
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11515

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-09-17 06:03:17 +02:00
Har Gagan Sahai
12153af85d s3: dfs: Fix a crash when the dfs targets are disabled.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11509

Signed-off-by: Har Gagan Sahai <SHarGagan@novell.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@wakeful.net>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep 11 06:39:19 CEST 2015 on sn-devel-104
2015-09-11 06:39:19 +02:00
Stefan Metzmacher
b7eb725292 smbXsrv_session: factor smbXsrv_session_add_channel() out of smbXsrv_session_create()
This allows to create more than one channel.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 10 21:33:47 CEST 2015 on sn-devel-104
2015-09-10 21:33:47 +02:00
Stefan Metzmacher
57053c5cb9 s3:smb2_sesssetup: let smbd_smb2_reauth_generic_return() cope with channels
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-10 18:32:15 +02:00
Michael Adam
69d2af10d4 s3:smb2_sesssetup: let smbd_smb2_auth_generic_return() cope with channels
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-10 18:32:15 +02:00
Michael Adam
6f95bc5025 s3:smb2_sesssetup: change talloc hierarchy in smbd_smb2_session_setup_gensec_done
Only put session_info to the session->global context if we use it.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-10 18:32:15 +02:00
Michael Adam
36830db46a net: reformat usage text for 'net ads join'
Make the items nicely aligned again and do not exceed 80 columns.
A few typos are fixed along the way.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-09-09 21:34:16 +02:00
Michael Adam
ae81a40b11 net: add option --no-dns-updates for net ads join
If called with this option, 'net ads join' will not attempt
to perform dns updates.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-09-09 21:34:15 +02:00
Anoop C S
a44a0c47cb libsmb: Fix CID 1034606 Incorrect pointer comparison
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Sep  9 21:33:49 CEST 2015 on sn-devel-104
2015-09-09 21:33:49 +02:00
Anoop C S
b63b53c842 libsmb: Fix CID 1034605 Incorrect pointer comparison
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-09-09 18:33:08 +02:00
Anoop C S
736397ec49 winbindd: Fix CID 1273310 Remove structurally dead code
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-09-09 18:33:07 +02:00
Michael Adam
76ef9c17d3 build: line-break deps for 'param' subsystem
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Sep  9 13:12:43 CEST 2015 on sn-devel-104
2015-09-09 13:12:43 +02:00
Michael Adam
123e6584ae build: fix quotation of deps for 'param' subsystem.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-09-09 10:12:21 +02:00
Volker Lendecke
48d4aac563 fruit: Fix CID 1323186 Dereference before null check
In all other "goto fail;" paths we had already dereferenced fsp,
so the if-statement checking for fsp!=NULL was unnecessary. This
fix gives us an additional error message in case check_aapl fails.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Sep  8 13:47:01 CEST 2015 on sn-devel-104
2015-09-08 13:47:01 +02:00
Timur Bakeyev
6b44ce6424 configure: Fix aio_suspend detection
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11494

Signed-off-by: Timur Bakeyev <timur@FreeBSD.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-09-08 10:45:15 +02:00
Volker Lendecke
2a8b21e5ae vfs_gpfs: Avoid calling gpfs_is_offline on every i/o
Asks gpfs as long as a file is offline. Once it was reported online once,
we'll not ask anymore.  This assumes that while we have a file open it
won't be migrated away. This might not *always* be true, but probably
close enough. And as long as we don't have a proper notification mechanism
and as long as polling is too expensive, this seems like a good strategy.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Sat Sep  5 01:50:09 CEST 2015 on sn-devel-104
2015-09-05 01:50:09 +02:00
Volker Lendecke
53a8cc7c0d vfs_gpfs: Introduce vfs_gpfs_fsp_is_offline
This consolidates a few common calls

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2015-09-04 22:51:06 +02:00
Jeremy Allison
0fb8ea7652 winbind: Don't delete an existing krb5 ticket on cached logon.
Cached logon doesn't mean the ticket is bad, wait until we go
online again to determine that.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11198

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep  4 01:35:16 CEST 2015 on sn-devel-104
2015-09-04 01:35:16 +02:00
Ralph Boehme
6263495b5b vfs_fruit: delete ._ file when deleting the basefile
0 byte resource fork streams are not listed by vfs_streaminfo, as a
result stream cleanup/deletion of file deletion doesn't remove the
resourcefork stream.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11467

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-02 03:50:21 +02:00
Ralph Boehme
db1c074435 vfs_fruit: split and simplify fruit_ftruncate
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11467

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-02 03:50:21 +02:00
Ralph Boehme
34759c8e7c vfs_fruit: handling of empty resource fork
Opening the resource fork stream with O_CREAT mustn't create a visible
node in the filesystem, only create a file handle. As long as the
creator didn't write into the stream, other openers withour O_CREAT
MUST get an ENOENT error. This is way OS X SMB server implements it.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11467

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-02 03:50:21 +02:00
Volker Lendecke
b3f906f932 Revert "winbind: Fix 100% loop"
This reverts commit e551cdb37d.

Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Sep  1 20:47:50 CEST 2015 on sn-devel-104
2015-09-01 20:47:50 +02:00
Garming Sam
88b27ebcc9 spoolss: handle SetPrinter for info level 4
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10770

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep  1 03:33:13 CEST 2015 on sn-devel-104
2015-09-01 03:33:13 +02:00
Ralph Boehme
770fb8cd07 selftest: add a check for disabled change notify
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11444

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Aug 31 15:50:49 CEST 2015 on sn-devel-104
2015-08-31 15:50:49 +02:00
Ralph Boehme
098b8a5110 notify: check for valid notify_ctx in notify_remove
notify_ctx will be NULL when "change notify = no" is set in smb.conf.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11444

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-31 12:50:13 +02:00
Ralph Wuerthner
e139f19327 s3: add suport for SMB3_10 and SMB3_11 protocols in smbstatus
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11472

Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Aug 29 07:05:10 CEST 2015 on sn-devel-104
2015-08-29 07:05:10 +02:00
Volker Lendecke
e551cdb37d winbind: Fix 100% loop
Thanks to "L.P.H. van Belle" <belle@bazuin.nl>
for help in reproducing the issue.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11038

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 28 22:03:31 CEST 2015 on sn-devel-104
2015-08-28 22:03:31 +02:00
Stefan Metzmacher
16c14aef2a s3:smb2_create: #if 0 unused variable
This fixes the build on ubuntu 14.04, which failed like this:

   [2852/3952] Compiling source3/smbd/smb2_create.c
   ../source3/smbd/smb2_create.c: In function ‘smbd_smb2_create_send’:
   ../source3/smbd/smb2_create.c:678:28: error: variable ‘svhdx’ set but not used [-Werror=unused-but-set-variable]
          struct smb2_create_blob *svhdx = NULL;

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-28 19:03:14 +02:00
Richard Sharpe
e6c234d31a Move the error handling for svhdx to vfswrap_create to give VFS module writers a chance to handle RSVD opens if they want to.
Also handle a review comment by Metze.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 28 03:19:36 CEST 2015 on sn-devel-104
2015-08-28 03:19:35 +02:00
Stefan Metzmacher
64c6cc34d7 s3:vfs_smb_traffic_analyzer: remove samba_ prefix from AES_* function calls
This should be an implementation detail in lib/crypto/aes.h.

In future we may add support for other implementations.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-27 20:23:20 +02:00
Volker Lendecke
c9d97e3a2e lib: Make sid_linearize take a uint8_t
We marshall into a binary buffer, uint8_t better reflects that.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Aug 27 00:40:58 CEST 2015 on sn-devel-104
2015-08-27 00:40:58 +02:00
Volker Lendecke
4a442e2eb7 lib: Make sid_parse take a uint8_t
sid_parse takes a binary blob, uint8_t reflects this a bit
better than char * does

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-26 21:41:12 +02:00
Roel van Meer
4e178ed498 s3-util: Compare the maximum allowed length of a NetBIOS name
This fixes a problem where is_myname() returns true if one of our names
is a substring of the specified name.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11427

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-08-25 18:43:14 +02:00
Volker Lendecke
617bc3fe61 winbind: Remove "have_idmap_config" from winbindd_domain
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Aug 24 19:19:31 CEST 2015 on sn-devel-104
2015-08-24 19:19:31 +02:00
Volker Lendecke
b62c7e26b4 winbind: Do not look for the domain in wb_gid2sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:12 +02:00
Volker Lendecke
2387d03b8a winbind: Do not look for the domain in wb_uid2sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:12 +02:00
Volker Lendecke
8856555af4 idmap: Remove dom_name from wbint_Gid2Sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:12 +02:00
Volker Lendecke
d4730474da idmap: Remove dom_name from wbint_Uid2Sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:12 +02:00
Volker Lendecke
2f4dad52c7 idmap: Remove "domname" from idmap_gid_to_sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:12 +02:00
Volker Lendecke
0f8c9b8d7f idmap: Remove "domname" from idmap_uid_to_sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:11 +02:00
Volker Lendecke
ac4cc24377 idmap: Remove "domname" from idmap_backends_unixid_to_sid
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:11 +02:00
Volker Lendecke
ad626b9e6b idmap: Use a range search in idmap_backends_unixid_to_sid
This obsoletes the domain name in the xid2sid calls

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:11 +02:00
Volker Lendecke
ef0c911955 idmap: Initialize all idmap domains at startup
So far we have initialized idmap domains on demand indexed by name.
For sid2xid this works okay, because we could do lookupsids before
and thus get the name. For xid2sid this is more problematic. We
have to rely on enumtrustdoms to work completely, and we have to
look at the list of winbind domains in the parent to get the domain
name. Relying on domain->have_idmap_config is not particularly nice.

This patch re-works initialization of idmap domains by scanning all
parametric parameters, scanning for :backend configuration settings.
This way we get a complete list of :range definitions. This means
we can rely on the idmap domain array to be complete. This in turn
means we can live without the domain name to find a domain, we can
do a range search by uid or gid.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:11 +02:00
Volker Lendecke
d36de86639 idmap: Move idmap_init() under the static vars
Just moving code, idmap_init will need to reference the variables

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:11 +02:00
Volker Lendecke
443dd9bbbc loadparm3: Add lp_wi_scan_global_parametrics()
This routine takes a regex and goes through all parametric parameters
in [global], matching the regex. It can easily be extended to also
look at shares, but right now it will only be used to list all idmap
config domain names.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464
2015-08-24 16:16:11 +02:00
Andreas Schneider
6363c0232c s3-auth: Fix a memory leak in make_server_info_info3()
We call make_server_info(NULL) and it is possible that we do not free
it, because server_info is not allocated on the memory context we pass
to the function.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9862

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-08-21 14:46:15 +02:00
Andreas Schneider
e8c76932e4 s3-auth: Pass nt_username to check_account()
We set nt_username above but do not use it in this function.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=9862

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-08-21 14:46:15 +02:00
Andreas Schneider
34965d4d98 s3-auth: Fix 'map to guest = Bad Uid' support
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9862

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-08-21 14:46:15 +02:00
Robin Hack
59e955bfd1 vfs_scannedonly: Remove vfs_scannedonly from samba source tree.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11459
Signed-off-by: Robin Hack <hack.robin@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 21 07:17:35 CEST 2015 on sn-devel-104
2015-08-21 07:17:35 +02:00
Stefan Metzmacher
43d1c92e62 s3:wscript: make --with-{static,shared}-modules options more flexible
'!module' disables a non-required module for a static/shared build.
'!DEFAULT' disables all modules defaulting to a static/shared build.
'!FORCED' disables all (non-required) modules forced to a static/shared build.
'ALL' switches the default for all non forced modules from static to shared
or from shared to static.
The most specific specification wins
e.g.
--with-static-modules='!FORCED,!DEFAULT' --with-shared-modules='!FORCED,!DEFAULT' will only
build modules which are required for the compilation. Might be useful
if someone only wants to use client utils.

--with-static-modules=ALL will build all modules statically linked.

--with-static-modules='!DEFAULT,ALL' --with-shared-modules='!DEFAULT,ALL'
might be useful for testing, it reverses the default build for all modules
which can be build shared or static.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-20 16:06:21 +02:00
Stefan Metzmacher
d830cecd03 s3:wscript: simplify ABI matching for pdb_*_init()
The init functions of all static modules should be ignored.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-20 16:06:21 +02:00
Stefan Metzmacher
bbd82b0fee s3:winbindd/idmap_*: make function prototypes available via static_decl_idmap;
This allows the static build of the modules.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-20 16:06:21 +02:00
Stefan Metzmacher
7b2ff4cbd3 s3:modules/perfcount_*: make function prototypes available via static_decl_perfcount;
This allows the static build of the modules.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-20 16:06:21 +02:00
Stefan Metzmacher
37b2677648 s3:modules/vfs_*: make function prototypes available via static_decl_vfs;
This allows the static build of the modules.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-20 16:06:21 +02:00
Stefan Metzmacher
72e0885413 s3:wscript: remove leftover from vfs_notify_fam
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-20 16:06:20 +02:00
Stefan Metzmacher
a184951673 s3:idmap: we need to allow undefined symbols in idmap_tdb
When idmap_tdb is build as shared module we need to allow undefined symbols
which callback into winbindd code.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-20 16:06:20 +02:00
Stefan Metzmacher
5134d29cbb s3:wscript: fix the build without any idmap module
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-20 16:06:20 +02:00
Volker Lendecke
345ef6b2ad smbd: Remove an unnecessary else branch
"goto out;" is sufficient before

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Aug 20 15:52:20 CEST 2015 on sn-devel-104
2015-08-20 15:52:20 +02:00
Volker Lendecke
22e1fb3466 vfs: Add some {}
The "mode = " from a very casual view looked as if it was part of the
if-condition

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
2015-08-20 12:49:22 +02:00
Stefan Metzmacher
bd0ec51cfc s3:smb2_negprot: prefer AES128_CCM if the client supports it
Callgrind showed that we use 28,165,720,719 cpu cycles to send
a 100MB file to a client using aes-ccm.

With aes-gcm this is raises up to 723,094,413,831 cpu cycles.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11451

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-08-17 17:43:36 +02:00
Stefan Metzmacher
ce3c77fb45 s3:lib: fix some corner cases of open_socket_out_cleanup()
In case of timeouts we retry the async_connect_send() and forgot
to remember it, this results in an abort() in async_connect_cleanup()
as the fd is already closed when calling fcntl(F_SETFL).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-08-17 17:43:36 +02:00
Volker Lendecke
f85c2a6852 smbd: Use a struct initializer
Saves a few bytes of .text

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-08-14 07:46:12 +02:00
Volker Lendecke
ba116fa7cd smbd: Remove a confusing comment
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-08-14 07:46:12 +02:00
Volker Lendecke
b5ce90e609 nfs4acls: Remove type_name param from smbacl4_get_vfs_params
It is kindof unexpected that we get params for something else but
"nfs4:"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Aug 13 17:45:31 CEST 2015 on sn-devel-104
2015-08-13 17:45:31 +02:00
Volker Lendecke
173dca482b nfs4acls: Fix a small memleak
We don't need the nt_ace_list beyond this function, make_sec_acl makes
a copy and make_sec_desc makes another one

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:16 +02:00
Volker Lendecke
9287b6788d nfs4acls: Introduce a helper variable
... triggered by removing a "==false" condition

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:16 +02:00
Volker Lendecke
5caaf00e7b nfs4acls: Remove a few unnecessary casts
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:16 +02:00
Volker Lendecke
fafd0a0c69 nfs4acls: Use talloc_realloc()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:16 +02:00
Volker Lendecke
7e630c32da nfs4acls: Use talloc_zero_array()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:16 +02:00
Volker Lendecke
68c64c7b30 nfs4acls: Use talloc_zero()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:16 +02:00
Volker Lendecke
8125503339 nfs4acls: Use talloc_zero()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:16 +02:00
Volker Lendecke
1ba9bbd4f3 nfs4acls: Remove get_validated_aceint
With the anonymous struct SMB4ACE_T we can rely on the compiler
to warn us

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
aeef82192d nfs4acls: Remove get_validated_aclint
With the anonymous struct SMB4ACL_T we can rely on the compiler
to warn us

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
45e1ef07b9 nfs4acls: Remove the SMB_ACE4_INT_T typedef
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
1d30e86a7e nfs4acls: Remove the SMB_ACL4_INT_T typedef
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
33147171d3 nfs4acls: Use SMB4ACE_T instead of _SMB_ACE4_INT_T
We can make the _INT_ structure now be the representation of the
published anonymous struct

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
5a7997f43f nfs4acls: Use SMB4ACL_T instead of _SMB_ACL4_INT_T
We can make the _INT_ structure now be the representation of the
published anonymous struct

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
cf97ec56d2 nfs4acls: Remove an obsolete comment
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
157711cb47 nfs4acls: Use an anon struct for SMB4ACE_T
-typedef struct _SMB4ACE_T {char dontuse;} SMB4ACE_T;
+struct SMB4ACE_T;

Same as for ACL_T

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
f15ad38d14 nfs4acls: Use an anon struct for SMB4ACL_T
The relevant change:

-typedef struct _SMB4ACL_T {char dontuse;} SMB4ACL_T;
+struct SMB4ACL_T;

We can use anonymous structs to prevent direct use. This patch will
trigger a set of simplifications in the next patches

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Volker Lendecke
9db523b169 nfs4acls: Use ZERO_STRUCTP
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-13 14:40:15 +02:00
Ralph Boehme
1db11998bf vfs_catia: run translation on stream names
With vfs_fruit option "fruit:encoding = native" we're already converting
stream names that contain illegal NTFS characters from their on-the-wire
Unicode Private Range encoding to their native ASCII representation.

Unfortunately the reverse mapping for stream names was not perfomed.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11278

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-07 09:52:12 +02:00
Ralph Boehme
fb9a64ea37 vfs_streams_xattr: stream names may contain colons
With vfs_fruit option "fruit:encoding = native" we're already converting
stream names that contain illegal NTFS characters from their on-the-wire
Unicode Private Range encoding to their native ASCII representation.

As as result the name of xattrs storing the streams (via
vfs_streams_xattr) may contain a colon, so we have to use strrchr_m()
instead of strchr_m() for matching the stream type suffix.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11278

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-07 09:52:12 +02:00
Anoop C S
e45b0d49be source3/rpc_client: Fix CID 1273041 Condition is redundant
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Aug  7 01:31:23 CEST 2015 on sn-devel-104
2015-08-07 01:31:23 +02:00
Christof Schmitt
9ae65b2546 smbd: Log smb2 requests returning !OK with higher log level
This can be useful for narrowing down problems without taking a full
level 10 trace.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-08-06 22:27:20 +02:00
Günther Deschner
321fe41e55 s3-rpcclient: add client for create enum ex.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: José A. Rivera <jarrpa@samba.org>
2015-08-04 19:11:18 +02:00
Ralph Boehme
95eb6db580 s3-net: use talloc array in share allowedusers
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11426

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Aug  4 16:48:36 CEST 2015 on sn-devel-104
2015-08-04 16:48:36 +02:00
Christof Schmitt
c64e3a8ff3 net: Print time of last password change in 'net ads info'
This is useful for debugging overwritten machine accounts, e.g. a
second machine is joined to a domain with the same name as the
first one.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-01 10:55:21 +02:00
Christof Schmitt
487119d741 secrets: Add function to fetch only password change timestamp
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-08-01 10:55:21 +02:00
Michael Adam
8c0217c2a2 param: rename szIdmapBackend -> idmap_backend
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:31 +02:00
Michael Adam
6b1d1a471c param: rename szInclude -> include
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:31 +02:00
Michael Adam
bd92bc0417 param: rename szCopy -> copy
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:31 +02:00
Michael Adam
5820c31a7d param: rename bAvailable -> available
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:31 +02:00
Michael Adam
4ae289c271 param: turn 'cups encrypt' into a generated function
Move the special stuff of the hand-written lp_cups_encrypt()
function into a handler that is called once at load time.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
5c18d00135 param: rename CupsEncrypt -> cups_encrypt
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
496f275a4b param: make 'winbind max domain connections' a generated function.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
78e276a35d param: rename winbindMaxDomainConnections -> _winbind_max_domain_connections
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
866fd3b889 param: turn 'wide links' into a generated funcion
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
b7172b8f7c param: rename bWidelinks -> wide_links
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
44619ad261 param: turn 'smb2 max credits' into generated option
This is achieved by moving the special treatment from
the lp_smb2_max_credits() function in the the special
handler that is called only once upon lp_load().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
ea6d35ccdd param: treat negative values of 'smb2 max credits' as default.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
a6e387d689 param: turn 'printcap name' into a generated function
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
3732456805 param: rename szPrintcapName -> printcap_name
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
b68d13ed7b param: turn 'min receivefile size' into a generated function
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
863f7b9360 param: rename iminreceivefile -> min_receivefile_size
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
217ce6d93b param: turn 'preferred master' into a generated function
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
20c84b8d03 param: rename iPreferredMaster -> _preferred_master
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
c377f63026 param: use lp[cfg]_max_print_jobs() in lp[cfg]_maxprintjobs()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
521468edb6 param: rename variable of 'max print jobs' to default.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
614a0b9eff param: rename szLdapMachineSuffix -> _ldap_machine_suffix
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:30 +02:00
Michael Adam
bbe74ae458 param: rename szLdapIdmapSuffix -> _ldap_sz_idmap_suffix
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:29 +02:00
Michael Adam
10b36db706 param: rename szLdapUserSuffix -> _ldap_user_suffix
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:29 +02:00
Michael Adam
cd0016d88c param: rename szLdapGroupSuffix -> _ldap_group_suffix
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:29 +02:00
Michael Adam
a4aaea6910 s3:lib: remove unused dummyparam.c
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:29 +02:00
Douglas Bagnall
38136c151b source3 torture: don't segfault if filename query fails
If the query return status is not OK, the query answer pointer could
be uninitialised.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
2015-07-31 01:55:27 +02:00
Michael Adam
86dd7b941c smbXsrv_session:idl: remove the preauth and gensec members
They are now taken from the pending_auth member (smbXsrv_session_auth0).

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jul 31 01:03:13 CEST 2015 on sn-devel-104
2015-07-31 01:03:13 +02:00
Michael Adam
321862d4ac s3:sesssetup: use session->pending_auth in smb1 session setup
(instead of session->gensec)

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-30 21:58:14 +02:00
Stefan Metzmacher
d391f6daea s3:smb2_sesssetup: use session->pending_auth
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-07-30 21:58:14 +02:00
Stefan Metzmacher
2c39036806 smbXsrv_session: add smbXsrv_session_create_auth()
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-07-30 21:58:14 +02:00
Stefan Metzmacher
e9885cfd0e smbXsrv_session: add smbXsrv_session_find_auth()
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-07-30 21:58:14 +02:00
Michael Adam
5e463b553b smbXsrv_session:idl: add smbXsrv_session_auth0
This contains various auth related items for a session,
in particular preauth. This is in preparation to take
the direct member preauth from smbXsrv_session and have
all session auth code operate on session->pending_auth
instead of session->preauth and friends.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-30 21:58:14 +02:00
Michael Adam
a51ee19dc9 s3:smb2_sesssetup: remove now unneeded declaration of smb2srv_session_lookup_raw
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-30 16:22:12 +02:00
Jeremy Allison
3c0f9340e6 tests: Add regression test for s3-passdb: Respect LOOKUP_NAME_GROUP flag in sid lookup.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11320

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul 30 00:36:14 CEST 2015 on sn-devel-104
2015-07-30 00:36:14 +02:00
Michael Adam
8c41cbbf9e s3:smb2_server: defer channel/session validation to the session setup code.
For session bind, and the channel is only to be bound to the given
session just now, so it is not valid. The early request validation
code can hence not check it, and hence validation is defered to the
actual session setup code, which can look at the session binding flags.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Jul 29 21:31:09 CEST 2015 on sn-devel-104
2015-07-29 21:31:09 +02:00
Michael Adam
8ab4b05d33 s3:smb2_sesssetup: check that the connection belongs to the session in sess.setup
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-07-29 18:26:07 +02:00
Michael Adam
19ec5f3474 smbXsrv: use smb2srv_session_lookup_client in smbXsrv_session_close_loop
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-29 18:26:07 +02:00
Michael Adam
f6816ae5bd smbXsrv: add smb2srv_session_lookup_client().
This is a variant of smb2srv_session_lookup_conn() that does
not verify the session on the channel.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-29 18:26:07 +02:00
Michael Adam
d6acf950e4 smbXsrv: rename smb2srv_session_lookup -> smb2srv_session_lookup_conn
This is in preparation of adding a variant that operates
on the client and does in particular not verify that the
connection belongs to a session as a channel.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-29 18:26:07 +02:00
Michael Adam
c765d11347 smbXsrv: add a smbXsrv_connection argument to smb2srv_session_lookup_raw
This way, we can verify that the session is valid on a channel.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-07-29 18:26:07 +02:00
Stefan Metzmacher
66bf0e51bc smbXsrv: add a smbXsrv_connection argument to smbXsrv_session_local_lookup()
This way, we can verify that a session is valid on the channel.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2015-07-29 18:26:07 +02:00
Björn Baumbach
cef8897f45 s3:wscript: fix indentation
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-07-29 10:33:29 +02:00
Justin Maggard
dc99d451bf s3-passdb: Respect LOOKUP_NAME_GROUP flag in sid lookup.
Somewhere along the line, a config line like "valid users = @foo"
broke when "foo" also exists as a user.

user_ok_token() already does the right thing by adding the LOOKUP_NAME_GROUP
flag; but lookup_name() was not respecting that flag, and went ahead and looked
for users anyway.

Regression test to follow.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11320

Signed-off-by: Justin Maggard <jmaggard@netgear.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Marc Muehlfeld <mmuehlfeld@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jul 28 21:35:58 CEST 2015 on sn-devel-104
2015-07-28 21:35:58 +02:00
Günther Deschner
3d0b23dbd4 vfs: fix build warning in smb traffic analyzer.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-07-24 13:39:31 +02:00
Volker Lendecke
45e3b05966 vfs: Fix CID 1312072 Failure to restore non-local value
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul 22 09:06:29 CEST 2015 on sn-devel-104
2015-07-22 09:06:29 +02:00
Volker Lendecke
d7a33d8b3d vfs: Fix CID 1312073 Argument cannot be negative
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-22 06:01:28 +02:00
Volker Lendecke
da3df2e1bb pdb_tdb: Use fstr_sprintf
Saves 160 bytes of .text

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-21 19:04:14 +02:00
Douglas Bagnall
d61ba23c36 Use uintptr_t for pointer int cast in SMBC_getdents_ctx()
On i386, unsigned long long is 64 bit while the pointer is 32, and
this fails under autobuild with -WError.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jul 21 05:14:20 CEST 2015 on sn-devel-104
2015-07-21 05:14:20 +02:00
Andrew Bartlett
06f378fa65 lib/tls: Change default supported TLS versions.
The new default is to disable SSLv3, as this is no longer considered
secure after CVE-2014-3566.  Newer GnuTLS versions already disable SSLv3.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
2015-07-20 03:08:26 +02:00
Andrew Bartlett
374d73617d lib/tls: Add new 'tls priority' option
This adds a new option to the smb.conf to allow administrators to disable
TLS protocols in GnuTLS without changing the code.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11076
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2015-07-20 03:08:26 +02:00
Andreas Schneider
1f90bb6049 selftest: Add test for the dfree command
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jul 17 22:09:34 CEST 2015 on sn-devel-104
2015-07-17 22:09:33 +02:00
Andreas Schneider
f1f30286d5 s3-smbd: Remove the global dfree_broken variable
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-17 19:07:23 +02:00
Andreas Schneider
48a4d5a407 s3-smbd: Leave sys_disk_free() if dfree command is used
If we have a broken system which reports incorrect sizes we provide the
'dfree command'. This command makes sure Samba gets the correct values.
However after that we call the quota command which then reports the
broken values. The dfree command should take care to provide the correct
values and in case of quota's it should also calculate the quote
correctly.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11403

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-17 19:07:23 +02:00
Stefan Metzmacher
323e4f89fc s3:winbindd: initialize dst->primary_gid with (gid_t)-1
We should not leave this uninitialized.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jul 17 19:06:08 CEST 2015 on sn-devel-104
2015-07-17 19:06:08 +02:00
Stefan Metzmacher
a7d582954d s3:winbindd: initialize acct_desc fields in rpc_enum_{dom,local}_groups()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-07-17 16:01:14 +02:00
Stefan Metzmacher
e5d309d432 s3:winbindd: initialize an [in,out] variable in rpc_try_lookup_sids3()
The input value of count is ignored by the server,
but we should not send an uninitialized value.

Found by valgrind.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-07-17 16:01:14 +02:00
Andreas Schneider
109ff388fd s3-auth: Fix a possible null pointer dereference
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11404

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jul 17 14:04:01 CEST 2015 on sn-devel-104
2015-07-17 14:04:01 +02:00
Uri Simchoni
42468bcb40 fssd: include config.h before any glibc headers
config.h may have some flags which affect glibc behavior, e.g.
_FILE_OFFSET_BITS=64. To make sure these flags have the desired
effect, config.h must be included before any glibc header files.

This commit does not fix a specific known bug. It changes the code to
comply with coding conventions.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: "Stefan Metzmacher" <metze@samba.org>
2015-07-17 01:38:16 +02:00
Uri Simchoni
102a4503b3 source3/lib: include config.h before any glibc headers
config.h may have some flags which affect glibc behavior, e.g.
_FILE_OFFSET_BITS=64. To make sure these flags have the desired
effect, config.h must be included before any glibc header files.

This commit does not fix a specific known bug. It changes the code to
comply with coding conventions.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: "Stefan Metzmacher" <metze@samba.org>
2015-07-17 01:38:15 +02:00
Uri Simchoni
c404793a38 libads: disable dns_lookup_realm in auto-generated krb5.conf files
This patch sets dns_lookup_realm=false in samba-generated krb5.conf.

Disabling dns_lookup_realm in krb5.conf is the recommended practice for
Kerberos usage in Active Directory environment. dns_lookup_realm is enabled
by default, at least in Heimdal.

When used by samba, Kerberos libraries operate based on either the system
krb5.conf, or a private krb5.conf generated specifically for the domain by
samba code. In the former case, it's the responsibility of the administrator
to set dns_lookup_realm=false. In the latter case, it's the responsibility
of samba - which is what this patch does.

In many usage scenarios the value of this variable is of no consequence
since samba knows the realm in which it is operating, and knows how to
generate service principal names. However, there are some scenarios
in which samba calls kerberos_get_principal_from_service_hostname(),
and here samba consults the Kerberos libraries and this parameter comes
into play. One primary example is cli_full_connection() function.

Not setting dns_lookup_realm leads to a series of DNS TXT record lookups.
This can be observed by running "net ads join -k -U <user>".

In AD environments, the TXT queries  typically fail quickly, but test setups
or misconfigured DNS may lead to large timeouts (for example, if the domain
is dept.example.com but there's no parent example.com domain and no DNS
zones for example.com). At the very least we want to avoid those lookups
because they are hardly documented and lead to confusion.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-17 01:38:15 +02:00
Volker Lendecke
fec300b0c1 vfs: Consolidate failure paths in vfswrap_init_asys_ctx
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 17 01:35:33 CEST 2015 on sn-devel-104
2015-07-17 01:35:33 +02:00
Volker Lendecke
93af8a1a23 vfs: Fix CID 1035384 Unchecked return value from library
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-16 22:32:24 +02:00
Ralph Boehme
f58ecfdbfc s3:smbd: change a loglevel from 0 to 1 when SMB_VFS_CONNECT fails
Logging at level 0 may result in log flooding. Additionally log the
share name that failed in SMB_VFS_CONNECT.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Jul 16 20:24:47 CEST 2015 on sn-devel-104
2015-07-16 20:24:47 +02:00
Ralph Boehme
5b3ed904ca vfs_shadow_copy2: change log level from 0 to 1 and log share path
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-16 17:19:19 +02:00
Uri Simchoni
2c1c567ee1 winbindd: shorten client list scan
Counting on the client list being sorted by last access time,
the list scan for removing timed-out clients is shortened - once
the list is scanned oldest to newest, and once a non-timed-out
client is found, the scan can stop.

Also, finding the oldest idle client for removing an idle client
is simplified - oldest idle client is last idle client.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11397

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul 16 01:45:20 CEST 2015 on sn-devel-104
2015-07-16 01:45:19 +02:00
Uri Simchoni
c10e24e1c7 winbindd: keep client list sorted by access time
Keep client list sorted by last access time, newest
to oldest.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11397

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-15 22:41:13 +02:00
Uri Simchoni
f065100639 winbindd: add service routines to support a sorted client list
Add some routines that support keeping the client list sorted
(by last access time) and traversing the list from oldest to
newest

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11397

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-15 22:41:13 +02:00
Uri Simchoni
33814c39b4 winbindd: periodically remove timed out clients
Periodically scan winbind client list and close connections
in which either the client is idle, or the request is taking
too long to complete.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11397

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-15 22:41:13 +02:00
Uri Simchoni
2a13740492 winbindd: verify that client has closed the connection
A recent change was to remove a client if the client socket
has become readable. In this change, a check is added to
determine the source of the readbility (actual readability,
closed connection, or some other error), and a suitable
debug message is printed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11397

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-15 22:41:13 +02:00
Uri Simchoni
0c6dc1ecf9 async_req: check for errors when monitoring socket for readability
Add an option to wait_for_read_send(), so that the request, upon
calling back, report whether the socket actually contains data
or is in EOF/error state. EOF is signalled via the EPIPE error.

This is useful for clients which do not expect data to arrive but
wait for readability to detect a closed socket (i.e. they do not
intend to actually read the socket when it's readable). Actual data
arrival would indicate a bug in this case, so the check can
be used to print an error message.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11397

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-15 22:41:13 +02:00
Uri Simchoni
28e1cae491 winbindd: cleanup client connection if the client closes the connection
This patch allows for early cleanup of client connections if the client
has given up.
Before this patch, any received request would be processed, and then only
upon transmitting the result to the client would winbindd find out the
client is no longer with us, possibly leading to a situation where the
same client tries over and over and increases the number of client
connections.

This patch monitors the client socket for readability while the request
is being processed, and closes the client connection if the socket
becomes readable. The client is not supposed to be writing anything to
the socket while it is waiting, so readability means either that the client
has closed the connection, or that it has broken the protocol.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11397

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-15 22:41:13 +02:00
Uri Simchoni
6da042d7c6 winbindd: set file descriptor limit according to configuration
Set the winbindd process file descriptor limit according to
the values that affect it in the configuration:
- Maximum number of clients
- Number of outgoing connections per domain

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11397

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-15 22:41:13 +02:00
Andreas Schneider
2bfe12e96e CID 1311771: Fix a null pointer dereference
We check for dir == NULL but dereference it during variable declaration.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-15 01:47:21 +02:00
Andreas Schneider
7680cf881a CID 1311763: Fix incorrect return value
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-15 01:47:20 +02:00
Günther Deschner
6f08d8ab23 s3-rpcclient: add cmd_clusapi_get_cluster_version2.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>
2015-07-14 21:21:21 +02:00
Jeremy Allison
5147ff54e3 s3: tests: Add blackbox test for scopy.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Jul 14 16:10:44 CEST 2015 on sn-devel-104
2015-07-14 16:10:44 +02:00
Anubhav Rakshit
cebcf0e4da s3:client: Add "scopy" cmd to perform Server Side copy using smbclient.
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-14 13:04:17 +02:00
Volker Lendecke
539125c99d ctdbd_conn: Move release_ip handling into process.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jul 14 09:56:25 CEST 2015 on sn-devel-104
2015-07-14 09:56:25 +02:00
Volker Lendecke
55233940c6 ctdbd_conn: Do an early return from ctdb_read_req
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-14 06:51:21 +02:00
Volker Lendecke
41b413916b ctdbd_conn: Return early from ctdbd_msg_call_back
... if the callback returns != 0

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-14 06:51:21 +02:00
Volker Lendecke
db1bee97f2 ctdbd_conn: Make register_with_ctdbd use an int-returning callback
This will allow an early return from ctdbd_msg_call_back so that we can also
handle CTDB_SRVID_RELEASE_IP via register_with_ctdbd.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-14 06:51:21 +02:00
Volker Lendecke
eca508f3c8 ctdbd_conn: Convert ctdb_read_req to return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-14 06:51:21 +02:00
Volker Lendecke
177b6a4571 ctdbd_conn: Convert ctdb_handle_message to return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-14 06:51:21 +02:00
Volker Lendecke
9bb10caff8 ctdbd_conn: Make ctdb_read_packet return 0/errno
A little less dependencies

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-14 06:51:21 +02:00
Volker Lendecke
0b9a8a042f ctdbd_conn: Rename "ret"->"ok"
We'll need "ret" soon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-14 06:51:21 +02:00
Volker Lendecke
44968456cb ctdbd_conn: Fix a memleak
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-14 06:51:21 +02:00
Volker Lendecke
40bcdb364b vfs_fruit: Fix the 32-bit build
"z" is only for size_t, here we have off_t

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jul 13 11:53:47 CEST 2015 on sn-devel-104
2015-07-13 11:53:47 +02:00
Volker Lendecke
8a58a48f86 libsmb: Implement smbc_notify
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 10 09:35:13 CEST 2015 on sn-devel-104
2015-07-10 09:35:13 +02:00
Robin McCorkell
936a799d32 Replace random() and related calls with generate_random_buffer()
Result: better seeded random numbers that are cryptographically secure
(not that it matters in this case)

Please let it be right this time...

Signed-off-by: Robin McCorkell <rmccorkell@karoshi.org.uk>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-10 06:33:07 +02:00
Christof Schmitt
57e2c0dfa6 smbcontrol: Set internal log level to 0
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-10 06:33:07 +02:00
Christof Schmitt
5f20813531 smbstatus: Set internal log level to 0
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-10 06:33:07 +02:00
Christof Schmitt
3d920b9525 rpcclient: Set internal log level to 0
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-10 06:33:07 +02:00
Volker Lendecke
fdea2febee rpc_server: Fix CID 1311342 Null pointer dereferences (REVERSE_INULL)
elem was dereferenced already a few lines above

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Jul 10 01:01:36 CEST 2015 on sn-devel-104
2015-07-10 01:01:36 +02:00
Volker Lendecke
fc372110c2 rpc_server: Fix CID 1311341 Integer handling issues (OVERFLOW_BEFORE_WIDEN)
Quoting the full message:

Potentially overflowing expression "total_octets * 8U" with type "unsigned int"
(32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a
context that expects an expression of type "uint64_t" (64 bits, unsigned).

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
3387969a1f rpc_server: Fix CID 1311340 Null pointer dereferences (NULL_RETURNS)
In practice this might not be relevant, but better be safe.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
a7c215548a rpc_server: Fix CID 1311339 Error handling issues (CHECKED_RETURN)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
94288f153d smbd: Fix CID 1311338 Error handling issues (CHECKED_RETURN)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
080e654ca5 smbd: Fix CID 1311337 Error handling issues (CHECKED_RETURN)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
ea55b1350b dalloc: Fix CID 1097369 API usage errors (VARARGS)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Volker Lendecke
784b6a79b8 dalloc: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-07-09 21:59:20 +02:00
Christof Schmitt
540899a2d9 dosmode: Change message of result to informational
Logging the returned mode bits should be only "informational" (level 5).

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jul  9 15:36:30 CEST 2015 on sn-devel-104
2015-07-09 15:36:30 +02:00
Christof Schmitt
a7fba97f98 vfs: Change final message in check_reduce_name to "info"
"Informational" is a better description for this message; change the log
level accordingly (level 5).

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 12:33:25 +02:00
Christof Schmitt
df561a9b66 vfs: Make entry message for check_reduced_name a debug message
The interesting information is already logged later; having an
additional message when entering the function should be only done as
debug message (level 10).

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 12:33:25 +02:00
Uri Simchoni
ed2ed1ad69 net: fix the order of DC lookup methods when joining a domain
The dsgetdcname() function is able to try just DNS lookup, just NetBIOS,
or start with DNS and fall back to NetBIOS. For "net ads join", we know
most of the time whether the name of the domain we're joining is a DNS
name or a NetBIOS name. In that case, it makes no sense to try both lookup
methods, especially that DNS may fail and we want to fall back from site-aware
DNS lookup to site-less DNS lookup, with no NetBIOS lookup in between.

This change lets "net ads join" tell libnet what is the type of the domain
name, if it is known.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 12:33:25 +02:00
Douglas Bagnall
4e935c5951 Fix format size errors for i386 in source3/librpc/crypto/gse.c
Again, sizeof(size_t) != sizeof(uintmax_t).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09 00:42:15 +02:00
Stefan Metzmacher
c123274423 s3:winbindd: add wb_irpc_GetForestTrustInformation()
This allows the netlogon server to forward netr_DrsGetForestTrustInformation()
to winbindd in order to do the work.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
8e196b428b s3:winbindd: implement winbind_GetForestTrustInformation()
We use in internal connection to our local LSA server
in order to update the local msDS-TrustForestTrustInfo attribute.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
56c7f885a5 librpc/idl: add winbind_GetForestTrustInformation()
This will be used by the netr_DrsGetForestTrustInformation()
in order to contact remote domains via winbindd.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
6f859f40b8 s3:winbindd: add wb_irpc_LogonControl()
This can be called by the netlogon server to pass netr_LogonControl*()
to a winbindd child process in order to do the real work.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
03e846bc27 s3:winbindd: implement _winbind_LogonControl*()
This implements NETLOGON_CONTROL_{REDISCOVER,TC_QUERY,TC_VERIFY,CHANGE_PASSWORD}.
These are triggered by the netlogon server (currently only as AD DC) via IRPC.

While NETLOGON_CONTROL_REDISCOVER ignores an optional '\dcname' at the end of
the specified domain name for now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
ee5e25b5b3 librpc/idl: add winbind_LogonControl()
This will be used by the netr_LogonControl()
in order to contact remote domains via winbindd.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
347d54047f s3:pdb_samba_dsdb: make use of dsdb_trust_search_tdo()
dsdb_trust_search_tdo() is almost the same as sam_get_results_trust(),
so we can remove sam_get_results_trust() later.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:21 +02:00
Paul Wayper
ac0e575b95 Spelling correction: exlusive -> exclusive
Signed-off-by: Paul Wayper <paulway@redhat.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-08 12:51:17 +02:00
Stefan Metzmacher
acb8182325 s3:wscript_build: fix the build using dmapi and fam together
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Jul  8 11:54:24 CEST 2015 on sn-devel-104
2015-07-08 11:54:24 +02:00
Christof Schmitt
2d62b9ab7d vfs_gpfs: Use C99 initializers instead of ZERO_STRUCT
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-08 02:54:26 +02:00
Christof Schmitt
4099bdfae8 vfs_gpfs: Use ACL defines from GPFS 3.5 header files
GPFS 3.5 is now the oldest support version. Cleanup the ACL code by
using the defines and structs from the 3.5 header file.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-08 02:54:26 +02:00
Volker Lendecke
93c91bddd8 Remove ctdb_conn.[ch]
This was only used in notify_internal.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul  8 02:53:33 CEST 2015 on sn-devel-104
2015-07-08 02:53:32 +02:00
Volker Lendecke
4e8e76dd59 notifyd: Add notifydd
A little standalone notify daemon to play around with.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
b4d6aee15e utils: add net notify
A little tool to play with the notify daemon

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
14b426ce07 notify: Remove two now unused stubs
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
70283ffd38 smbd: Remove SMB_VFS_NOTIFY_WATCH
No longer needed

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
c118c301c9 notify: Re-add notify_walk()
This used to be a tdb traverse wrapper. Now we get the notify db from
notifyd via messages.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
0deb657ba6 notifyd: Add notifyd_parse_db()
The database format notifyd is "private" to it. This makes it
possible for smbcontrol and others to query notifyd's database with
MSG_SMB_NOTIFY_GET_DB and inspect it without having to know exactly what
format it uses.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
730b025d7b smbd: Remove the notify_fam module
This has been moved to main smbd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
ce26c64272 smbd: Kernel change notify is done by notifyd
smbd itself does not need to call VFS_NOTIFY_WATCH anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
b434eb5077 smbd: Replace the tdb-based notify_internal with notify_msg
For the moment, this removes smbstatus -N output. It will come back with
the next commits.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
96a256baf2 smbd: Don't start the notify cleanup anymore
We don't have a database to clean up anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
72a8fcf0ca smbd: Start the notify daemon
For this we need the kernel change notify stuff to be global: There's only one
notifyd and we have to pass over the kernel change notify watch function

Signed-off-by: Volker Lendecke <vl@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
802b282a8f smbd: Add the notify daemon
This adds the notify daemon listening on MSG_SMB_NOTIFY_REC_CHANGE
and MSG_SMB_NOTIFY_TRIGGER messages. It relies on ctdbd to distribute
the notify database and events in a cluster.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
45a2c2ee3f smbd: Add direct notify_fam support
notifyd won't have the VFS around, it is a systemwide daemon without
a connection to specific shares. To continue FAM support, notifyd
needs to be able to link it directly. This adds code to make fam
equivalent to inotify.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
a24f0379ac param: Make "kernel change notify" global
With a central notifyd, we can't do this per share anymore. Notifyd will
only look at absolute paths, not shares.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:24 +02:00
Volker Lendecke
e5895c3c37 param: Make "change notify" global
With a central notifyd, we can't do this per share anymore. Notifyd will
only look at absolute paths, not shares.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:23 +02:00
Volker Lendecke
e749174dd8 lib: Add server_id_db_set_exclusive
This is used for server names where only one instance can exist.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07 23:51:23 +02:00
Michael Adam
76f8d0fbad smbd:trans2: treat new SMB_SIGNING_DESIRED in case
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 20:36:26 +02:00
Ralph Boehme
480cc511ff s3-mdssvc: add mdssd RPC service daemon for mdssvc
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
4b0ee5d209 s3-mdssvc: lexer and parser for Spotlight queries
Add a lexer and parser for translating Spotlight query strings to
SPARQL.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
c2c5621380 s3-mdssvc: main Spotlight code
Implement all Spotlight RPC commands with the Tracker SPARQL async query
API.

Tracker uses glib for implemeting async tasks, we thus have to use a
glib mainloop for processing sheduled tasks in threads.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
0de03ce4a4 s3-mdssvc: Spotlight attribute mappings
Add mappings for metadata attribute between Spotlight and NEPOMUK for
use with Tracker.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
5d4eceae15 s3-mdssvc: (un)marshalling Spotlight RPC blob
Add code for marshalling and unmarshalling Spotlight RPC blobs
from/into a dalloc object store.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
222e863d4e s3-mdssvc: dalloc: dynamic object store based on talloc
dalloc is a hack with a bizarre API, but it does its job: it's a
simple object store that allows for storing simple and complex data
types.

We'll use it for storing Spotlight query data.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
25f56f5f40 s3-mdssvc: add new option 'spotlight'
Per share option: it reflects whether a share is indexed by Tracker or
not. The global switch that controls whether Spotlight is enabled or
not, are the mdsvc RPC switches.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
63dd793cde s3-mdssvc: add Spotlight RPC stubs
'mdssvc' aka 'Metadata Search Service' is an RPC service used by Apple
for passing marshalled Spotlight search queries and results between
client to server.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Ralph Boehme
6e332abc3c s3-mdssvc: add configure option --enable-spotlight
configure check with pkg-config for libtracker-sparql, default is
disabled.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-07 17:34:28 +02:00
Michael Adam
14357700fd smbd:smb2: use encryption_desired in send_break
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11372

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:28 +02:00
Michael Adam
41cb881e77 smbd:smb2: only enable encryption in tcon if desired
Don't enforce it but only announce DATA_ENCRYPT,
making use of encryption_desired in tcon.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11372

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:27 +02:00
Michael Adam
fc228025d7 smbd:smb2: only enable encryption in session if desired
Don't enforce it but only announce ENCRYPT_DATA, using the
encryption_desired flag in session setup.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11372

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:27 +02:00
Michael Adam
3bb2999443 smbd:smb2: separate between encryption required and enc desired
this means we:
- accept unencrypted requests if encryption only desired
  and not required,
- but we always send encrypted responses in the desired
  case, not only when the request was encrypted.

For this purpose, the do_encryption in the request
structure is separated into was_encrypted and do_encryption.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11372

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:27 +02:00
Michael Adam
a3ea6dbef5 smbXsrv: add bools encryption_desired to session and tcon
This is to indicate that we should sen the ENCRYPT_DATA
flag on session or tcon replies.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11372

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-07 14:05:27 +02:00
Volker Lendecke
8fec35994c vfs_fruit: Fix CID 1311244 Out-of-bounds read
We should not call memcpy if the offset is exactly AFP_INFO_SIZE

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Jul  7 14:04:39 CEST 2015 on sn-devel-104
2015-07-07 14:04:39 +02:00
Christof Schmitt
1d25a51591 sharesec: Remove error message for unmarshall_sec_desc failure
In a cluster setup, running sharesec -D results in an empty record that
triggers this message. The situation is correctly handled in the code
(unmarshall_sec_desc fails and sharesec uses the default), so simply
remove the message in this case.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-06 20:19:12 +02:00
Stefan Metzmacher
793af3f2ae s3:winbindd: use check dcerpc_binding_handle_is_connected() instead of a specific status
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Günther Deschner
185896d988 s3-rpcclient: remove old extra hand marshalling from witness cmds.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-03 02:00:27 +02:00
Günther Deschner
0a2c933dc5 s3-rpcclient: close policy handle in cmd_clusapi_open_resource().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-03 02:00:27 +02:00
Günther Deschner
126c6f06bf s3-rpcclient: use witness defines in witness rpcclient.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-03 02:00:27 +02:00
Günther Deschner
d8dbbfcb0a s3-rpcclient: add clusapi_get_resource_state command.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-03 02:00:27 +02:00
Günther Deschner
82c4b92661 witness: autogenerate the marshalling of the witness_notifyResponse_message.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-03 02:00:27 +02:00
Günther Deschner
cf738ccdb3 s3-rpcclient: add cmdline tools to toggle online/offline cluster resource state.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-03 02:00:27 +02:00
Ralph Boehme
25f302a47c vfs_fruit: check offset and length for AFP_AfpInfo read requests
fruit_pread doesn't check the offset and length parameters and instead
always writes 60 bytes, the size of the AFP_AfpInfo blob, to the the
passed buffer. If the passed in buffer is smaller, we overwrite
something somewhere.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11363

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-07-02 22:45:10 +02:00
Stefan Metzmacher
f87e70a930 s3:libads: improve debug levels/messages in ads_find_dc()
We should not flood the logs (and syslog) with fallback warnings.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Jul  2 14:41:31 CEST 2015 on sn-devel-104
2015-07-02 14:41:31 +02:00
Ralph Boehme
20075e6b30 s3:vfs: copy_chunk buffer size
Use a dynamically allocated copy_chunk buffer size with an upper bound
of 8 MB for now.

The previous size of 64 KB has proven to really hurt performance,
especially with "strict locking = yes".

The SMB2 protocol level maximum allowed copy_chunk size is 1 MB, that's
what will be used as buffer size in the typical case.

With the AAPL copyfile extension the requested copy_chunk size is the
size whole file, which would then make use of a larger buffer up to the
limit of 8 MB.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-01 23:05:55 +02:00
Andreas Schneider
4e28dd16c5 selftest: Plan samba3.blackbox.preserve_case testcase
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-01 23:05:55 +02:00
Andreas Schneider
f72be14315 tests: Add test_preserve_case.sh
Test for: https://bugzilla.samba.org/show_bug.cgi?id=10650

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-01 23:05:55 +02:00
Michael Adam
2b644e3d5d s3:libsmb: fix resolve_ads return if there were no answers
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-01 23:05:55 +02:00