garming/samba-autobuild/.git
8 weeks agowinbind: Query domain from winbind rpc name_to_sid
Christof Schmitt [Mon, 11 Mar 2019 22:54:21 +0000 (15:54 -0700)]
winbind: Query domain from winbind rpc name_to_sid

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 weeks agowinbind: Query domain from msrpc name_to_sid
Christof Schmitt [Mon, 11 Mar 2019 22:53:51 +0000 (15:53 -0700)]
winbind: Query domain from msrpc name_to_sid

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 weeks agonsswitch: Add testcase for checking output of wbinfo --sid-to-name
Christof Schmitt [Mon, 11 Mar 2019 23:26:48 +0000 (16:26 -0700)]
nsswitch: Add testcase for checking output of wbinfo --sid-to-name

The username should always be returned in the DOMAISHORTNAME/USERNAME
format.

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

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
8 weeks ago.gitlab-ci.yml: run the samba-o3 job on each working container image
Stefan Metzmacher [Fri, 12 Apr 2019 19:34:24 +0000 (21:34 +0200)]
.gitlab-ci.yml: run the samba-o3 job on each working container image

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Apr 18 13:10:49 UTC 2019 on sn-devel-144

8 weeks ago.gitlab-ci.yml: split AUTOBUILD_JOB_NAME from CI_JOB_NAME
Stefan Metzmacher [Fri, 12 Apr 2019 19:21:03 +0000 (21:21 +0200)]
.gitlab-ci.yml: split AUTOBUILD_JOB_NAME from CI_JOB_NAME

This will make it easier extend the templates later.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks ago.gitlab-ci.yml: make use of bootstrap/.gitlab-ci.yml and use the new defined image
Joe Guo [Wed, 20 Mar 2019 04:03:21 +0000 (17:03 +1300)]
.gitlab-ci.yml: make use of bootstrap/.gitlab-ci.yml and use the new defined image

See bootstrap/README.md for the instructions to create and upload the
images via a custom gitlab ci pipeline.

The key is that it's always possible to regenerate the image if
it's not present in the container registry, where we are free to
delete old images. But it should be possible to rebuild images
if someone has the need to run a pipeline based on an old
branch.

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

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/READMD.md: update the instructions to reflect the current code
Stefan Metzmacher [Thu, 11 Apr 2019 14:56:17 +0000 (16:56 +0200)]
bootstrap/READMD.md: update the instructions to reflect the current code

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap: add the result of bootstrap/template.py --render
Stefan Metzmacher [Fri, 12 Apr 2019 11:33:12 +0000 (13:33 +0200)]
bootstrap: add the result of bootstrap/template.py --render

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/.gitlab-ci.yml: add ci file to trigger image auto build
Joe Guo [Thu, 14 Mar 2019 04:15:47 +0000 (17:15 +1300)]
bootstrap/.gitlab-ci.yml: add ci file to trigger image auto build

Depending on 'SAMBA_CI_REBUILD_IMAGES=yes' (and
'SAMBA_CI_REBUILD_BROKEN_IMAGES=yes') as environment
variables on a custom gitlab ci pipeline we'll generate und upload
container images.

bootstrap/README.md will get more details in the next commits.

Please note ci in this file did NOT add the `latest` tag,
since we want main ci to always use a fixed image based on the sha1sum of
everything under bootstrap/ from now on.
This also implies the new built image will not replace/break anything.

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

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap: remove unused docker.py
Stefan Metzmacher [Thu, 11 Apr 2019 14:56:32 +0000 (16:56 +0200)]
bootstrap: remove unused docker.py

We'll generate docker images during a gitlab-ci run.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/template.py: add sha1sum support
Joe Guo [Tue, 19 Mar 2019 23:26:48 +0000 (12:26 +1300)]
bootstrap/template.py: add sha1sum support

1. calc sha1sum for files under bootstrap/ (except README.md
   and *.pyc files) after render and write to bootstrap/sha1sum.txt file.
2. add a new option to print sha1sum, so we can use it to compare in ci

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

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/template.py: generate Vagrantfile just once
Stefan Metzmacher [Thu, 11 Apr 2019 08:34:28 +0000 (10:34 +0200)]
bootstrap/template.py: generate Vagrantfile just once

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/template.py: render locale.sh for each dist and make shell scripts executable
Joe Guo [Thu, 7 Mar 2019 06:00:37 +0000 (19:00 +1300)]
bootstrap/template.py: render locale.sh for each dist and make shell scripts executable

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: generate rendered files into bootstrap/generated-dists/
Stefan Metzmacher [Thu, 11 Apr 2019 08:34:28 +0000 (10:34 +0200)]
bootstrap/config.py: generate rendered files into bootstrap/generated-dists/

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: add a hind how to rebuild generated files
Stefan Metzmacher [Thu, 11 Apr 2019 08:34:28 +0000 (10:34 +0200)]
bootstrap/config.py: add a hind how to rebuild generated files

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: Add openSUSE Leap 15.0
Samuel Cabrero [Fri, 22 Mar 2019 13:15:31 +0000 (14:15 +0100)]
bootstrap/config.py: Add openSUSE Leap 15.0

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: Create the 'samba' group in containers
Samuel Cabrero [Wed, 27 Mar 2019 17:00:09 +0000 (18:00 +0100)]
bootstrap/config.py: Create the 'samba' group in containers

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: Fix lmdb-utils package name for RPM family
Samuel Cabrero [Thu, 28 Mar 2019 11:04:15 +0000 (12:04 +0100)]
bootstrap/config.py: Fix lmdb-utils package name for RPM family

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: Use generic lsb-release package name
Samuel Cabrero [Fri, 22 Mar 2019 11:37:13 +0000 (12:37 +0100)]
bootstrap/config.py: Use generic lsb-release package name

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: Add gzip, which and hostname to base packages
Samuel Cabrero [Fri, 22 Mar 2019 11:34:14 +0000 (12:34 +0100)]
bootstrap/config.py: Add gzip, which and hostname to base packages

The openSUSE Leap 15.0 container does not include gzip and which

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: add libicu-dev/libicu-devel
Ralph Boehme [Tue, 9 Apr 2019 14:55:37 +0000 (16:55 +0200)]
bootstrap/config.py: add libicu-dev/libicu-devel

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: add glib2-dev
Ralph Boehme [Fri, 29 Mar 2019 11:13:09 +0000 (12:13 +0100)]
bootstrap/config.py: add glib2-dev

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: add patch, rsync and tar
Stefan Metzmacher [Fri, 29 Mar 2019 08:43:08 +0000 (09:43 +0100)]
bootstrap/config.py: add patch, rsync and tar

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: link ld to ld.gold when available
Joe Guo [Wed, 20 Mar 2019 22:04:24 +0000 (11:04 +1300)]
bootstrap/config.py: link ld to ld.gold when available

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: add ARG in Dockerfile to allow add sha1sum into docker image
Joe Guo [Tue, 19 Mar 2019 03:31:47 +0000 (16:31 +1300)]
bootstrap/config.py: add ARG in Dockerfile to allow add sha1sum into docker image

Add ARG SHA1SUM, then we can pass it to docker build with --build-arg

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: rm ENV for ccache since we didn't use it any more
Joe Guo [Tue, 12 Mar 2019 06:06:03 +0000 (19:06 +1300)]
bootstrap/config.py: rm ENV for ccache since we didn't use it any more

When ccache is not installed, this will cause failure.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: add missing dev packages
Joe Guo [Tue, 19 Mar 2019 21:08:08 +0000 (10:08 +1300)]
bootstrap/config.py: add missing dev packages

Add a few extra dev packages missing in current ci image but should be included.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: adjust package list to align current ci image
Joe Guo [Tue, 19 Mar 2019 21:06:44 +0000 (10:06 +1300)]
bootstrap/config.py: adjust package list to align current ci image

Adjust packages to make `dpkg -l` output align current ci image.
The ones not required are ignored, add a few missing python3 ones.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: change UTF-8 to utf8 for locale name in Dockerfile ENV
Joe Guo [Fri, 8 Mar 2019 01:49:06 +0000 (14:49 +1300)]
bootstrap/config.py: change UTF-8 to utf8 for locale name in Dockerfile ENV

While generating locales, glibc/localedef/locale-gen will normalize
`UTF-8` to `utf8`, use same name style to avoid string mismatch issues.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks agobootstrap/config.py: mv locale setup from bootstrap.sh
Joe Guo [Thu, 7 Mar 2019 04:02:50 +0000 (17:02 +1300)]
bootstrap/config.py: mv locale setup from bootstrap.sh

In future, samba developers could run `bootstrap.sh` to update
dependencies on their workstation, this is very useful when new people
get on board or new dependencies introduced.

But currenly it will override locale, which is not expected for this case.

Remove locale setup cmds from bootstrap.sh, add a separate script for this.

Although this script is written in a generic way and has no variable so far,
still follow the same routine as `bootstrap.sh` to keep consistent.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
8 weeks ago.gitlab-ci.yml: require samba-ci-private tag for our private runners
Stefan Metzmacher [Fri, 12 Apr 2019 19:24:27 +0000 (21:24 +0200)]
.gitlab-ci.yml: require samba-ci-private tag for our private runners

This makes it more clear that we need our own private runners.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Apr 16 17:45:35 UTC 2019 on sn-devel-144

8 weeks ago.gitlab-ci.yml: remove outdated comments
Stefan Metzmacher [Fri, 12 Apr 2019 19:23:53 +0000 (21:23 +0200)]
.gitlab-ci.yml: remove outdated comments

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 weeks ago.gitlab-ci.yml: run samba-schemaupgrade on the private runner
Stefan Metzmacher [Tue, 16 Apr 2019 12:54:55 +0000 (14:54 +0200)]
.gitlab-ci.yml: run samba-schemaupgrade on the private runner

The related jobs often fail with timeouts
because the shared runners (4GB RAM + 2GB SWAP)
will use ~450MB of the swapfile.

The private runners use 8GB RAM without any swap.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
8 weeks agolib/replace: define NAME_MAX for platforms that don't have it
Günther Deschner [Tue, 16 Apr 2019 10:01:58 +0000 (12:01 +0200)]
lib/replace: define NAME_MAX for platforms that don't have it

This allows the vfs_glusterfs_fuse build to complete on AIX.

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

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Apr 16 15:14:50 UTC 2019 on sn-devel-144

2 months agosmbd: Remove share_mode_lease and the leases array from share_mode_entry
Volker Lendecke [Wed, 19 Sep 2018 15:42:51 +0000 (17:42 +0200)]
smbd: Remove share_mode_lease and the leases array from share_mode_entry

This also removes the temporary functions introduced during the patchset.

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): Sun Apr 14 05:18:14 UTC 2019 on sn-devel-144

2 months agosmbd: Use share_mode_forall_leases in share_mode_cleanup_disconnected()
Volker Lendecke [Wed, 19 Sep 2018 11:22:12 +0000 (13:22 +0200)]
smbd: Use share_mode_forall_leases in share_mode_cleanup_disconnected()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use share_mode_forall_leases in do_break_to_none()
Volker Lendecke [Mon, 17 Sep 2018 15:01:38 +0000 (17:01 +0200)]
smbd: Use share_mode_forall_leases in do_break_to_none()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use share_mode_forall_leases in rename_share_filename()
Volker Lendecke [Mon, 17 Sep 2018 11:24:56 +0000 (13:24 +0200)]
smbd: Use share_mode_forall_leases in rename_share_filename()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Add share_mode_forall_leases()
Volker Lendecke [Mon, 17 Sep 2018 11:14:22 +0000 (13:14 +0200)]
smbd: Add share_mode_forall_leases()

Function to walk all leases for a file exactly once. This used to be simpler
with the leases[] array, thus this function that encapsulates the complexity.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use leases_db in lease_match()
Volker Lendecke [Wed, 19 Sep 2018 14:31:55 +0000 (16:31 +0200)]
smbd: Use leases_db in lease_match()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Make find_share_mode_lease() static
Volker Lendecke [Wed, 19 Sep 2018 10:36:25 +0000 (12:36 +0200)]
smbd: Make find_share_mode_lease() static

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use leases_db in process_oplock_break_message()
Volker Lendecke [Tue, 18 Sep 2018 13:18:15 +0000 (15:18 +0200)]
smbd: Use leases_db in process_oplock_break_message()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use leases_db in vfs_default_durable_reconnect()
Volker Lendecke [Wed, 19 Sep 2018 11:37:23 +0000 (13:37 +0200)]
smbd: Use leases_db in vfs_default_durable_reconnect()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use leases_db in downgrade_lease()
Volker Lendecke [Wed, 19 Sep 2018 10:05:57 +0000 (12:05 +0200)]
smbd: Use leases_db in downgrade_lease()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use leases_db in try_lease_upgrade()
Volker Lendecke [Tue, 18 Sep 2018 11:51:01 +0000 (13:51 +0200)]
smbd: Use leases_db in try_lease_upgrade()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Split up grant_fsp_lease()
Volker Lendecke [Tue, 18 Sep 2018 11:00:49 +0000 (13:00 +0200)]
smbd: Split up grant_fsp_lease()

Simple refactoring into simpler routines. View best with "git show -b"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Add update_share_mode_lease_from_db()
Volker Lendecke [Wed, 19 Sep 2018 08:25:31 +0000 (10:25 +0200)]
smbd: Add update_share_mode_lease_from_db()

This is an interim function supposed to be around for just a few patches as
long as we have both the leases.tdb entries and the leases[] in
share_mode_entries around. It makes it easier to transition to just use
leases.tdb while keeping the code running.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Don't pass up lease_idx from grant_fsp_lease
Volker Lendecke [Tue, 18 Sep 2018 09:37:28 +0000 (11:37 +0200)]
smbd: Don't pass up lease_idx from grant_fsp_lease

The only reason for grant_fsp_lease to return the lease_idx was to pass it down
to set_share_mode. That does not need it anymore.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Don't pass lease_idx down to set_share_mode()
Volker Lendecke [Tue, 18 Sep 2018 09:31:27 +0000 (11:31 +0200)]
smbd: Don't pass lease_idx down to set_share_mode()

Temporary patch to keep the code running. The new code in set_share_mode() will
leave again once the patchset to remove share_mode_lease and thus the lease_idx
in share_mode_entry goes away.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agoutils: Use leases_db in smbstatus
Volker Lendecke [Wed, 19 Sep 2018 10:52:46 +0000 (12:52 +0200)]
utils: Use leases_db in smbstatus

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use leases_db in fsp_lease_update()
Volker Lendecke [Wed, 10 Apr 2019 14:38:28 +0000 (16:38 +0200)]
smbd: Use leases_db in fsp_lease_update()

Remove a reference to "struct share_mode_lease"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use leases_db in get_lease_type()
Volker Lendecke [Thu, 13 Sep 2018 10:48:30 +0000 (12:48 +0200)]
smbd: Use leases_db in get_lease_type()

Remove a reference to share_mode_data->leases[]

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use leases_db in delay_for_oplock()
Volker Lendecke [Thu, 13 Sep 2018 10:48:30 +0000 (12:48 +0200)]
smbd: Use leases_db in delay_for_oplock()

Remove a reference to share_mode_data->leases[]

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use share_mode_entry's lease data in lease_match()
Volker Lendecke [Wed, 10 Apr 2019 19:54:27 +0000 (21:54 +0200)]
smbd: Use share_mode_entry's lease data in lease_match()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use share_mode_entry's lease data in vfs_default_durable_reconnect()
Volker Lendecke [Wed, 10 Apr 2019 19:34:24 +0000 (21:34 +0200)]
smbd: Use share_mode_entry's lease data in vfs_default_durable_reconnect()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use share_mode_entry's lease data in remove_share_mode_lease()
Volker Lendecke [Wed, 19 Sep 2018 14:39:31 +0000 (16:39 +0200)]
smbd: Use share_mode_entry's lease data in remove_share_mode_lease()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use share_mode_entry's lease data in remove_share_mode_lease()
Volker Lendecke [Wed, 19 Sep 2018 12:14:32 +0000 (14:14 +0200)]
smbd: Use share_mode_entry's lease data in remove_share_mode_lease()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use share_mode_entry's lease data in is_same_lease()
Volker Lendecke [Wed, 19 Sep 2018 12:29:23 +0000 (14:29 +0200)]
smbd: Use share_mode_entry's lease data in is_same_lease()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use share_mode_entry's lease data in delay_rename_for_lease_break()
Volker Lendecke [Thu, 13 Sep 2018 17:11:22 +0000 (19:11 +0200)]
smbd: Use share_mode_entry's lease data in delay_rename_for_lease_break()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use share_mode_entry's lease data in delay_for_oplock()
Volker Lendecke [Wed, 10 Apr 2019 12:05:15 +0000 (14:05 +0200)]
smbd: Use share_mode_entry's lease data in delay_for_oplock()

This was the last "share_mode_lease" reference in this function, remove
variable "l".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Add lease key to share_mode_entry
Volker Lendecke [Thu, 13 Sep 2018 10:47:55 +0000 (12:47 +0200)]
smbd: Add lease key to share_mode_entry

Instead of indexing into the leases[] array, put the lease_db reference into
the share_mode_entry. For simplicity, put in the client guid as well. We
*might* be able to retrieve that from somewhere else, but as other smbd
processes have to look at the lease values, put in the full leases_db index
data.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Use leases_db_set()
Volker Lendecke [Mon, 8 Apr 2019 14:21:41 +0000 (16:21 +0200)]
smbd: Use leases_db_set()

Whenever we update the share_mode_lease struct, also update the leases.tdb
entry.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agoleases_db: Add getter/setter for share_mode_lease metadata
Volker Lendecke [Tue, 11 Sep 2018 14:23:38 +0000 (16:23 +0200)]
leases_db: Add getter/setter for share_mode_lease metadata

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agoleases_db: Add share_mode_lease info to leases.tdb
Volker Lendecke [Tue, 11 Sep 2018 14:13:24 +0000 (16:13 +0200)]
leases_db: Add share_mode_lease info to leases.tdb

This is the data stored in share_mode_lease inside the leases[] array in
locking.tdb. This and all the following patches move all leases array to
looking at the leases.tdb.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Pass lease parameters explicitly to find_fsp_lease
Volker Lendecke [Tue, 18 Sep 2018 07:55:51 +0000 (09:55 +0200)]
smbd: Pass lease parameters explicitly to find_fsp_lease

This avoids a use of "struct share_mode_lease"

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Introduce a helper variable in delay_for_oplock()
Volker Lendecke [Wed, 10 Apr 2019 13:14:38 +0000 (15:14 +0200)]
smbd: Introduce a helper variable in delay_for_oplock()

This removes a few explicit share_mode_lease dereferences

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Introduce a helper variable in delay_for_oplock()
Volker Lendecke [Wed, 10 Apr 2019 12:19:30 +0000 (14:19 +0200)]
smbd: Introduce a helper variable in delay_for_oplock()

Why? I am preparing a patchset that will remove
"share_mode_lease". This patch is a micro-step towards that, removing
a set of references to this struct.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agosmbd: Small optimization for break_to_none
Volker Lendecke [Tue, 9 Apr 2019 14:34:24 +0000 (16:34 +0200)]
smbd: Small optimization for break_to_none

We don't need to memzero the struct when we can struct-initialize it a
bit later, implicitly initializing the rest to zero.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months ago.gitlab-ci.yml: show the system state also as after_script
Stefan Metzmacher [Wed, 27 Feb 2019 13:23:48 +0000 (14:23 +0100)]
.gitlab-ci.yml: show the system state also as after_script

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Apr 12 20:42:27 UTC 2019 on sn-devel-144

2 months ago.gitlab-ci.yml: print out /proc/swaps
Stefan Metzmacher [Wed, 27 Feb 2019 13:29:22 +0000 (14:29 +0100)]
.gitlab-ci.yml: print out /proc/swaps

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months ago.gitlab-ci.yml: print out /etc/os-release
Stefan Metzmacher [Mon, 25 Mar 2019 12:54:40 +0000 (13:54 +0100)]
.gitlab-ci.yml: print out /etc/os-release

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months ago.gitlab-ci.yml: remove before_script section of .private_template
Stefan Metzmacher [Wed, 27 Feb 2019 13:22:52 +0000 (14:22 +0100)]
.gitlab-ci.yml: remove before_script section of .private_template

It's already inherited from .shared_template.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2 months agodocs/vfs_ceph: describe new ACL behaviour
David Disseldorp [Fri, 12 Apr 2019 11:55:50 +0000 (13:55 +0200)]
docs/vfs_ceph: describe new ACL behaviour

vfs_ceph now explicitly enables libcephfs POSIX ACL support.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr 12 19:40:25 UTC 2019 on sn-devel-144

2 months agovfs_ceph: explicitly enable libcephfs POSIX ACL support
David Disseldorp [Fri, 12 Apr 2019 11:52:43 +0000 (13:52 +0200)]
vfs_ceph: explicitly enable libcephfs POSIX ACL support

libcephfs disables ACL support by default and returns -EOPNOTSUPP in the
POSIX ACL get/setxattr paths as a result. Enable support by setting the
following Ceph config parameters during mount:
        client acl type = posix_acl
        fuse default permissions = false

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 months agobuild: add explicit cephfs include path for vfs_ceph builds
David Disseldorp [Tue, 26 Mar 2019 17:12:04 +0000 (18:12 +0100)]
build: add explicit cephfs include path for vfs_ceph builds

Needed if building with a custom --with-libcephfs path.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 months agoctdb-common: Avoid race between fd and signal events
Amitay Isaacs [Tue, 9 Apr 2019 04:44:04 +0000 (14:44 +1000)]
ctdb-common: Avoid race between fd and signal events

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

In run_proc, there was an implicit assumption that when a process exits,
fd event (pipe between parent and child) would be processed first and
signal event (SIGCHLD for the child) would be processed later.

However, that is not the case.  SIGCHLD can be received asynchronously
any time even when the pipe data has not fully been read.  This causes
run_proc to miss some of the output from child process in tests.

When SIGCHLD is being processed, if the pipe between parent and child is
still open, then do an explict read from the pipe to ensure we read any
data still in the pipe before closing the pipe.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Apr 12 08:19:29 UTC 2019 on sn-devel-144

2 months agoctdb-daemon: Revert "We can not assume that just because we could complete a TCP...
Martin Schwenke [Fri, 5 Apr 2019 05:17:35 +0000 (16:17 +1100)]
ctdb-daemon: Revert "We can not assume that just because we could complete a TCP handshake"

We also can not assume that nodes can be marked as connected via only
the keepalive mechanism.  Keepalives are not sent to disconnected
nodes so, in the absence of other packets (e.g. broadcasts), 2 nodes
may never become marked as connected to each other.

Revert to marking nodes as connected in the TCP transport code.  If a
connection is to a non(-operational) ctdbd then it will revert to
disconnected after a short while and may actually flap.  This should
be rare.

This reverts commit 66919db3d7ab1e091223faf515b183af8bfddc83.

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

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 months agoRevert "ctdb-scripts: Do not "correct" number of nfsd threads when it is 0"
Martin Schwenke [Thu, 4 Apr 2019 07:21:49 +0000 (18:21 +1100)]
Revert "ctdb-scripts: Do not "correct" number of nfsd threads when it is 0"

I thought this was being triggered during automated testing.
However, it appears that a poor choice of fixed ports for NFS RPC
services was the real problem.  Revert, since the original behaviour
may be useful.

This reverts commit f1a1c300e192d43f5c9faf9450ffbf16341a2661.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2 months agoselftest: rename schemaupgrade_dc (+pair) to schema_dc
Garming Sam [Fri, 12 Apr 2019 01:31:29 +0000 (03:31 +0200)]
selftest: rename schemaupgrade_dc (+pair) to schema_dc

This is needed because the name of the autobuild job and
the name of the selftest env end up in the socket path
for ncalrpc sockets.

The challenge is that (for example)
/memdisk/autobuild/fl/b2424063/samba-schemaupgrade/bin/ab/schemaupgrade_pair_dc/ncalrpc/np/protected_storage
does not fit in a struct sockaddr_un.

Signed-off-by: Garming Sam <garming@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Apr 12 05:41:36 UTC 2019 on sn-devel-144

2 months agondrdump: change behaviour of flags to operate as flags
Andrew Bartlett [Fri, 12 Apr 2019 03:10:35 +0000 (15:10 +1200)]
ndrdump: change behaviour of flags to operate as flags

These are called flags because that is what they become to the ndr_pull function,
but to avoid total confusion treat them as flags generally even if the values are
always exclusive (at the moment).

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2 months agondrdump: Remove local variables for pipes
Michael Hanselmann [Wed, 3 Apr 2019 22:04:23 +0000 (00:04 +0200)]
ndrdump: Remove local variables for pipes

There's no need for the local variables as the NDR call structure
pointer is kept around anyway.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 months agoldb: Avoid calling talloc_get_type() in ldb_kv_parse_data_unpack()
Andrew Bartlett [Thu, 11 Apr 2019 23:26:01 +0000 (11:26 +1200)]
ldb: Avoid calling talloc_get_type() in ldb_kv_parse_data_unpack()

We have the ldb_kv in the caller, just fill it into the context and
so avoid the cost of the talloc_get_type().

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2 months agoutils: Move conn_tdb.c to utils/
Volker Lendecke [Thu, 11 Apr 2019 11:03:30 +0000 (13:03 +0200)]
utils: Move conn_tdb.c to utils/

That's a wrapper that only smbstatus and net status use by now.

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 Apr 12 00:37:05 UTC 2019 on sn-devel-144

2 months agosmbd: Remove some unused includes
Volker Lendecke [Thu, 11 Apr 2019 10:58:05 +0000 (12:58 +0200)]
smbd: Remove some unused includes

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 months agobuild: Move smbstatus definition to source3/utils/wscript_build
Volker Lendecke [Thu, 11 Apr 2019 09:36:56 +0000 (11:36 +0200)]
build: Move smbstatus definition to source3/utils/wscript_build

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2 months agolib: remove duplicate check
Swen Schillig [Thu, 11 Apr 2019 07:52:05 +0000 (09:52 +0200)]
lib: remove duplicate check

This check was supposed to be removed by c9f4b92a613.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Christof Schmitt <cs@samba.org>
Autobuild-Date(master): Thu Apr 11 23:34:51 UTC 2019 on sn-devel-144

2 months agosource4: Update error check for new string conversion wrapper
Swen Schillig [Wed, 6 Mar 2019 09:11:39 +0000 (10:11 +0100)]
source4: Update error check for new string conversion wrapper

The new string conversion wrappers detect and flag errors
which occured during the string to integer conversion.
Those modifications required an update of the callees
error checks.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agolibcli: Update error check for new string conversion wrapper
Swen Schillig [Wed, 6 Mar 2019 09:06:35 +0000 (10:06 +0100)]
libcli: Update error check for new string conversion wrapper

The new string conversion wrappers detect and flag errors
which occured during the string to integer conversion.
Those modifications required an update of the callees
error checks.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agocommon-lib: Update error check for new string conversion wrapper
Swen Schillig [Wed, 6 Mar 2019 09:02:53 +0000 (10:02 +0100)]
common-lib: Update error check for new string conversion wrapper

The new string conversion wrappers detect and flag errors
which occured during the string to integer conversion.
Those modifications required an update of the callees
error checks.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agoctdb-tools: Update error check for new string conversion wrapper
Swen Schillig [Wed, 6 Mar 2019 08:48:24 +0000 (09:48 +0100)]
ctdb-tools: Update error check for new string conversion wrapper

The new string conversion wrappers detect and flag errors
which occured during the string to integer conversion.
Those modifications required an update of the callees
error checks.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agoctdb-protocol: Update error check for new string conversion wrapper
Swen Schillig [Wed, 6 Mar 2019 08:43:53 +0000 (09:43 +0100)]
ctdb-protocol: Update error check for new string conversion wrapper

The new string conversion wrappers detect and flag errors
which occured during the string to integer conversion.
Those modifications required an update of the callees
error checks.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agomodules: Update error check for new string conversion wrapper
Swen Schillig [Wed, 6 Mar 2019 08:34:10 +0000 (09:34 +0100)]
modules: Update error check for new string conversion wrapper

The new string conversion wrappers detect and flag errors
which occured during the string to integer conversion.
Those modifications required an update of the callees
error checks.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agoutils: Update error check for new string conversion wrapper
Swen Schillig [Wed, 6 Mar 2019 08:29:13 +0000 (09:29 +0100)]
utils: Update error check for new string conversion wrapper

The new string conversion wrappers detect and flag errors
which occured during the string to integer conversion.
Those modifications required an update of the callees
error checks.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agolib: Update error check for new string conversion wrapper
Swen Schillig [Wed, 6 Mar 2019 08:07:13 +0000 (09:07 +0100)]
lib: Update error check for new string conversion wrapper

The new string conversion wrappers detect and flag errors
which occured during the string to integer conversion.
Those modifications required an update of the callees
error checks.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agolib: modify string conversion wrapper to handle invalid strings
Swen Schillig [Wed, 6 Mar 2019 08:03:27 +0000 (09:03 +0100)]
lib: modify string conversion wrapper to handle invalid strings

The standard string conversion routines convert a "non-number string"
to zero and do not flag an error.
This is changed now by returning EINVAL if no conversion occured.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2 months agotests/ldb_kv: Add another case for completeness
Garming Sam [Tue, 9 Apr 2019 01:22:01 +0000 (13:22 +1200)]
tests/ldb_kv: Add another case for completeness

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Apr 11 05:25:02 UTC 2019 on sn-devel-144

2 months agoldb_kv: Avoid memdup of database records in the case of base searches
Garming Sam [Thu, 7 Mar 2019 03:45:46 +0000 (16:45 +1300)]
ldb_kv: Avoid memdup of database records in the case of base searches

This makes LDAP bind significantly faster in the case of having many
members, due to large size of these records (with tens of thousands of
member links). During the nested group calculation, you are only
interested in memberOf not the member links.

(We add a bit-field to determine whether or not the backend actually
supports pointing into database memory. For some reason TDB pointers
aren't stable, so for now we set this option just on LMDB backends.)

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 months agoldb_mdb: Change function declaration as per README.coding
Garming Sam [Thu, 11 Apr 2019 00:53:45 +0000 (12:53 +1200)]
ldb_mdb: Change function declaration as per README.coding

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 months agoldb_kv: Remove unnecessary space
Garming Sam [Mon, 8 Apr 2019 02:41:43 +0000 (14:41 +1200)]
ldb_kv: Remove unnecessary space

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2 months agoselftest: split schemaupgrade testenv out
Aaron Haslett [Mon, 1 Apr 2019 21:45:36 +0000 (10:45 +1300)]
selftest: split schemaupgrade testenv out

Schemaupgrade tests are particularly resource intensive and are causing
runners to hit their memory and CPU limits, so we need to split them
out.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>