Compare commits

..

No commits in common. "c9s" and "c8" have entirely different histories.
c9s ... c8

26 changed files with 4661 additions and 4545 deletions

299
.gitignore vendored
View File

@ -1,297 +1,2 @@
samba-3.5.4.tar.gz SOURCES/samba-4.19.4.tar.xz
samba-3.6.0pre1.tar.gz SOURCES/samba-pubkey_AA99442FB680B620.gpg
/samba-3.6.0pre2.tar.gz
/samba-3.6.0pre3.tar.gz
/samba-3.6.0rc1.tar.gz
/samba-3.6.0rc2.tar.gz
/samba-3.6.0rc3.tar.gz
/samba-3.6.0.tar.gz
/samba-3.6.1.tar.gz
/samba-3.6.3.tar.gz
/samba-3.6.4.tar.gz
/samba-3.6.5.tar.gz
/samba-3.6.6.tar.gz
/samba-3.6.7.tar.gz
/samba-4.0.0rc1.tar.bz2
/samba-4.0.0rc2.tar.bz2
/samba-4.0.0rc3.tar.bz2
/samba-4.0.0rc4.tar.bz2
/samba-4.0.0rc5.tar.bz2
/samba-4.0.0rc6.tar.bz2
/samba-4.0.0.tar.bz2
/samba-4.0.1.tar.bz2
/samba-4.0.2.tar.bz2
/samba-4.0.3.tar.bz2
/samba-4.0.4.tar.bz2
/samba-4.0.5.tar.bz2
/samba-4.0.6.tar.bz2
/samba-4.0.7.tar.xz
/samba-4.1.0rc1.tar.xz
/samba-4.1.0rc2.tar.xz
/samba-4.1.0rc3.tar.xz
/samba-4.1.0rc4.tar.xz
/samba-4.1.0.tar.xz
/samba-4.1.1.tar.xz
/samba-4.1.2.tar.xz
/samba-4.1.3.tar.xz
/samba-4.1.4.tar.xz
/samba-4.1.5.tar.xz
/samba-4.1.6.tar.xz
/samba-4.1.8.tar.xz
/samba-4.1.9.tar.xz
/samba-4.1.11.tar.gz
/samba-4.1.11.tar.xz
/samba-4.1.12.tar.xz
/samba-4.2.0rc2.tar.xz
/samba-4.2.0rc3.tar.xz
/samba-4.2.0rc4.tar.xz
/samba-4.2.0rc5.tar.xz
/samba-4.2.0.tar.xz
/samba-4.2.1.tar.xz
/samba-4.2.2.tar.xz
/samba-4.2.3.tar.xz
/samba-4.3.0rc3.tar.xz
/samba-4.3.0rc4.tar.xz
/samba-4.3.0.tar.xz
/samba-4.3.1.tar.xz
/samba-4.3.2.tar.xz
/samba-4.3.3.tar.xz
/samba-4.3.4.tar.xz
/samba-4.4.0rc1.tar.xz
/samba-4.4.0rc2.tar.xz
/samba-4.4.0rc3.tar.xz
/samba-4.4.0rc4.tar.xz
/samba-4.4.0rc5.tar.xz
/samba-4.4.0.tar.xz
/samba-4.4.2.tar.xz
/samba-4.4.3.tar.xz
/samba-4.4.4.tar.xz
/samba-4.4.5.tar.xz
/samba-4.5.0rc1.tar.xz
/samba-4.5.0rc2.tar.xz
/samba-4.5.0rc3.tar.xz
/samba-4.5.0.tar.xz
/samba-4.5.1.tar.xz
/samba-4.5.2.tar.xz
/samba-4.5.3.tar.xz
/samba-4.6.0rc1.tar.xz
/samba-4.6.0rc2.tar.xz
/samba-4.6.0rc2.tar.asc
/samba-4.6.0rc3.tar.asc
/samba-4.6.0rc3.tar.xz
/samba-4.6.0rc4.tar.xz
/samba-4.6.0rc4.tar.asc
/samba-4.6.0.tar.asc
/samba-4.6.0.tar.xz
/samba-4.6.1.tar.xz
/samba-4.6.1.tar.asc
/samba-4.6.2.tar.xz
/samba-4.6.2.tar.asc
/samba-4.6.3.tar.xz
/samba-4.6.3.tar.asc
/samba-4.6.4.tar.xz
/samba-4.6.4.tar.asc
/samba-4.6.5.tar.xz
/samba-4.6.5.tar.asc
/samba-4.7.0rc1.tar.xz
/samba-4.7.0rc1.tar.asc
/samba-4.7.0rc3.tar.xz
/samba-4.7.0rc3.tar.asc
/samba-4.7.0rc5.tar.xz
/samba-4.7.0rc5.tar.asc
/samba-4.7.0rc6.tar.xz
/samba-4.7.0rc6.tar.asc
/samba-4.7.0.tar.xz
/samba-4.7.0.tar.asc
/samba-4.7.1.tar.xz
/samba-4.7.1.tar.asc
/samba-4.7.2.tar.xz
/samba-4.7.2.tar.asc
/samba-4.7.3.tar.xz
/samba-4.7.3.tar.asc
/samba-4.7.4.tar.xz
/samba-4.7.4.tar.asc
/samba-4.8.0rc1.tar.xz
/samba-4.8.0rc1.tar.asc
/samba-4.8.0rc2.tar.xz
/samba-4.8.0rc2.tar.asc
/samba-4.8.0rc3.tar.xz
/samba-4.8.0rc3.tar.asc
/samba-4.8.0rc4.tar.xz
/samba-4.8.0rc4.tar.asc
/samba-4.8.0.tar.xz
/samba-4.8.0.tar.asc
/samba-4.8.1.tar.xz
/samba-4.8.1.tar.asc
/samba-4.8.2.tar.xz
/samba-4.8.2.tar.asc
/samba-4.8.3.tar.asc
/samba-4.8.3.tar.xz
/samba-4.9.0rc1.tar.xz
/samba-4.9.0rc1.tar.asc
/samba-4.9.0rc2.tar.xz
/samba-4.9.0rc2.tar.asc
/samba-4.9.0rc3.tar.xz
/samba-4.9.0rc3.tar.asc
/samba-4.9.0rc4.tar.xz
/samba-4.9.0rc4.tar.asc
/samba-4.9.0rc5.tar.asc
/samba-4.9.0rc5.tar.xz
/samba-4.9.0.tar.xz
/samba-4.9.0.tar.asc
/samba-4.9.1.tar.asc
/samba-4.9.1.tar.xz
/samba-4.9.2.tar.xz
/samba-4.9.2.tar.asc
/samba-4.9.3.tar.xz
/samba-4.9.3.tar.asc
/samba-4.9.4.tar.xz
/samba-4.9.4.tar.asc
/samba-4.10.0rc1.tar.xz
/samba-4.10.0rc1.tar.asc
/samba-4.10.0rc2.tar.xz
/samba-4.10.0rc2.tar.asc
/samba-4.10.0rc3.tar.xz
/samba-4.10.0rc3.tar.asc
/samba-4.10.0rc4.tar.xz
/samba-4.10.0rc4.tar.asc
/samba-4.10.0.tar.xz
/samba-4.10.0.tar.asc
/samba-4.10.1.tar.xz
/samba-4.10.1.tar.asc
/samba-4.10.2.tar.xz
/samba-4.10.2.tar.asc
/samba-4.10.3.tar.xz
/samba-4.10.3.tar.asc
/samba-4.10.4.tar.xz
/samba-4.10.4.tar.asc
/samba-4.10.5.tar.xz
/samba-4.10.5.tar.asc
/samba-4.10.6.tar.xz
/samba-4.10.6.tar.asc
/samba-4.11.0rc1.tar.xz
/samba-4.11.0rc1.tar.asc
/samba-4.11.0rc2.tar.xz
/samba-4.11.0rc2.tar.asc
/samba-4.11.0rc3.tar.xz
/samba-4.11.0rc3.tar.asc
/samba-4.11.0rc4.tar.xz
/samba-4.11.0rc4.tar.asc
/samba-4.11.0.tar.xz
/samba-4.11.0.tar.asc
/samba-4.11.1.tar.xz
/samba-4.11.1.tar.asc
/samba-4.11.2.tar.xz
/samba-4.11.2.tar.asc
/samba-4.11.3.tar.xz
/samba-4.11.3.tar.asc
/samba-4.11.4.tar.xz
/samba-4.11.4.tar.asc
/samba-4.11.5.tar.xz
/samba-4.11.5.tar.asc
/samba-4.12.0rc1.tar.xz
/samba-4.12.0rc1.tar.asc
/samba-4.12.0rc2.tar.xz
/samba-4.12.0rc2.tar.asc
/samba-4.12.0rc3.tar.xz
/samba-4.12.0rc3.tar.asc
/samba-4.12.0rc4.tar.xz
/samba-4.12.0rc4.tar.asc
/samba-4.12.0.tar.xz
/samba-4.12.0.tar.asc
/samba-4.12.1.tar.xz
/samba-4.12.1.tar.asc
/samba-4.12.2.tar.xz
/samba-4.12.2.tar.asc
/samba-4.12.3.tar.xz
/samba-4.12.3.tar.asc
/samba-4.12.4.tar.xz
/samba-4.12.4.tar.asc
/samba-4.12.5.tar.xz
/samba-4.12.5.tar.asc
/samba-4.13.0rc1.tar.xz
/samba-4.13.0rc1.tar.asc
/samba-4.13.0rc2.tar.xz
/samba-4.13.0rc2.tar.asc
/samba-4.13.0rc3.tar.xz
/samba-4.13.0rc3.tar.asc
/samba-4.13.0rc4.tar.xz
/samba-4.13.0rc4.tar.asc
/samba-4.13.0rc5.tar.xz
/samba-4.13.0rc5.tar.asc
/samba-4.13.0rc6.tar.xz
/samba-4.13.0rc6.tar.asc
/samba-4.13.0.tar.xz
/samba-4.13.0.tar.asc
/samba-4.13.1.tar.xz
/samba-4.13.1.tar.asc
/samba-4.13.2.tar.xz
/samba-4.13.2.tar.asc
/samba-4.13.3.tar.xz
/samba-4.13.3.tar.asc
/samba-4.13.4.tar.xz
/samba-4.13.4.tar.asc
/samba-4.14.0rc1.tar.xz
/samba-4.14.0rc1.tar.asc
/samba-4.14.0rc2.tar.xz
/samba-4.14.0rc2.tar.asc
/samba-4.14.0rc3.tar.xz
/samba-4.14.0rc3.tar.asc
/samba-4.14.0rc4.tar.xz
/samba-4.14.0rc4.tar.asc
/samba-4.14.0.tar.xz
/samba-4.14.0.tar.asc
/samba-4.14.1.tar.xz
/samba-4.14.1.tar.asc
/samba-4.14.2.tar.xz
/samba-4.14.2.tar.asc
/samba-4.14.4.tar.xz
/samba-4.14.4.tar.asc
/samba-4.14.5.tar.asc
/samba-4.14.5.tar.xz
/samba-4.15.2.tar.asc
/samba-4.15.2.tar.xz
/samba-4.15.3.tar.asc
/samba-4.15.3.tar.xz
/samba-4.15.4.tar.asc
/samba-4.15.4.tar.xz
/samba-4.15.5.tar.xz
/samba-4.15.5.tar.asc
/samba-4.16.1.tar.asc
/samba-4.16.1.tar.xz
/samba-4.16.2.tar.asc
/samba-4.16.2.tar.xz
/samba-4.16.3.tar.asc
/samba-4.16.3.tar.xz
/samba-4.16.4.tar.xz
/samba-4.16.4.tar.asc
/samba-4.17.2.tar.asc
/samba-4.17.2.tar.xz
/samba-4.17.4.tar.asc
/samba-4.17.4.tar.xz
/samba-4.17.5.tar.asc
/samba-4.17.5.tar.xz
/samba-4.18.2.tar.asc
/samba-4.18.2.tar.xz
/samba-4.18.3.tar.asc
/samba-4.18.3.tar.xz
/samba-4.18.4.tar.asc
/samba-4.18.4.tar.xz
/samba-4.18.5.tar.asc
/samba-4.18.5.tar.xz
/samba-4.18.6.tar.xz
/samba-4.18.6.tar.asc
/samba-4.19.3.tar.xz
/samba-4.19.3.tar.asc
/samba-4.19.4.tar.xz
/samba-4.19.4.tar.asc
/samba-4.20.0.tar.asc
/samba-4.20.0.tar.xz
/samba-4.20.1.tar.asc
/samba-4.20.1.tar.xz
/samba-4.20.2.tar.asc
/samba-4.20.2.tar.xz
/samba-4.21.0.tar.asc
/samba-4.21.0.tar.xz
/samba-4.21.1.tar.asc
/samba-4.21.1.tar.xz

2
.samba.metadata Normal file
View File

@ -0,0 +1,2 @@
6a164128df94dd89e785ca9f42d7be5714f16bed SOURCES/samba-4.19.4.tar.xz
971f563c447eda8d144d6c9e743cd0f0488c0d9e SOURCES/samba-pubkey_AA99442FB680B620.gpg

186
README.md
View File

@ -1,186 +0,0 @@
Samba is a free SMB and CIFS client and server and Domain Controller for UNIX
and other operating systems. It is maintained by the Samba Team, who support the
original author, Andrew Tridgell.
This software is freely distributable under the GNU public license, a copy of
which you should have received with this software (in a file called COPYING).
# WHAT IS SMB/CIFS?
This is a big question.
The very short answer is that it is the protocol by which a lot of PC-related
machines share files and printers and other information such as lists of
available files and printers. Operating systems that support this natively
include Windows 9x, Windows NT (and derivatives), OS/2, Mac OS X and Linux. Add
on packages that achieve the same thing are available for DOS, Windows 3.1, VMS,
Unix of all kinds, MVS, and more. Some Web Browsers can speak this protocol as
well (smb://). Alternatives to SMB include Netware, NFS, Appletalk, Banyan
Vines, Decnet etc; many of these have advantages but none are both public
specifications and widely implemented in desktop machines by default.
The Common Internet File system (CIFS) is what the new SMB initiative is called.
For details watch [here](https://samba.org/cifs)
# WHY DO PEOPLE WANT TO USE SMB?
* Many people want to integrate their Microsoft desktop clients with their Unix
servers.
* Others want to integrate their Microsoft (etc) servers with Unix servers. This
is a different problem to integrating desktop clients.
* Others want to replace protocols like NFS, DecNet and Novell NCP, especially
when used with PCs.
# WHAT CAN SAMBA DO?
Please refer to the WHATSNEW.txt included with this README for a list of
features in the latest Samba release.
Here is a very short list of what samba includes, and what it does. For many
networks this can be simply summarized by "Samba provides a complete replacement
for Windows NT, Warp, NFS or Netware servers."
* a SMB server, to provide Windows NT and LAN Manager-style file and print
services to SMB clients such as Windows 95, Warp Server, smbfs and others.
* a Windows Domain Controller (NT4 and AD) replacement.
* a file/print server that can act as a member of a Windows NT 4.0 or Active
Directory domain.
* a NetBIOS (rfc1001/1002) nameserver, which amongst other things gives browsing
support. Samba can be the master browser on your LAN if you wish.
* a ftp-like SMB client so you can access PC resources (disks and printers) from
UNIX, Netware, and other operating systems
* a tar extension to the client for backing up PCs
* limited command-line tool that supports some of the NT administrative
functionality, which can be used on Samba, NT workstation and NT server.
For a much better overview have a look at the [web site](http://samba.org/samba)
and browse the user survey.
#### Related packages include:
* cifsvfs, an advanced Linux-only filesystem allowing you to mount remote SMB
filesystems from PCs on your Linux box. This is included as standard with Linux
2.5 and later.
* smbfs, the previous Linux-only filesystem allowing you to mount remote SMB
filesystems from PCs on your Linux box. This is included as standard with Linux
2.0 and later.
# CONTRIBUTIONS
### To contribute via GitHub
* fork the official Samba team repository on GitHub
-- see [GitHub](https://github.com/samba-team/samba)
* become familiar with the coding standards as described in README.Coding
* make sure you read the Samba copyright policy
-- see [Copyright Policy](https://www.samba.org/samba/devel/copyright-policy.html)
* create a feature branch
* make changes
* when committing, be sure to add signed-off-by tags
-- see [Commit message tags](https://wiki.samba.org/index.php/CodeReview#commit_message_tags)
* send a pull request for your branch through GitHub
* this will trigger an email to the samba-technical mailing list
* discussion happens on the samba-technical mailing list as described below
* more info on using Git for Samba development can be found on Samba Wiki
-- see [Using Git for Samba](https://wiki.samba.org/index.php/Using_Git_for_Samba_Development)
### To contribute via mailing lists
Join the mailing list. The Samba team accepts patches (preferably in "diff -u"
format, see [here](https://samba.org/samba/devel) for more details) and are
always glad to receive feedback or suggestions to the address
samba@lists.samba.org. More information on the various Samba mailing lists can
be found at [mailman](http://lists.samba.org).
You can also get the Samba sourcecode straight from the [git repository](http://wiki.samba.org/index.php/Using_Git_for_Samba_Development).
If you like a particular feature then look through the git change-log on the
[web](https://git.samba.org/?p=samba.git;a=summary) and see who added it, then
send them an email.
Remember that free software of this kind lives or dies by the response we get.
If no one tells us they like it then we'll probably move onto something else.
# MORE INFO
### DOCUMENTATION
There is quite a bit of documentation included with the package, including man
pages, and lots of .html files with hints and useful info. This is also
available from the web page. There is a growing collection of information under
docs/.
A list of Samba documentation in languages other than English is available on
the web page.
If you would like to help with the documentation, please coordinate on the
samba@lists.samba.org mailing list. See the next section for details on
subscribing to samba mailing lists.
### MAILING LIST
Please do NOT send subscription/unsubscription requests to the lists!
There is a mailing list for discussion of Samba. For details go to [mailman](https://lists.samba.org)
or send mail to <samba-subscribe@lists.samba.org>.
There is also an announcement mailing list where new versions are announced. To
subscribe go to [mailman](http://lists.samba.org) or send mail to
<samba-announce-subscribe@lists.samba.org>. All announcements also go to the
samba list, so you only need to be on one.
For details of other Samba mailing lists and for access to archives, see
[mailman](http://lists.samba.org)
### MAILING LIST ETIQUETTE
A few tips when submitting to this or any mailing list.
- Make your subject short and descriptive. Avoid the words "help" or "Samba" in
the subject. The readers of this list already know that a) you need help, and b)
you are writing about samba (of course, you may need to distinguish between
Samba PDC and other file sharing software). Avoid phrases such as "what is" and
"how do i". Some good subject lines might look like "Slow response with Excel
files" or "Migrating from Samba PDC to NT PDC".
- If you include the original message in your reply, trim it so that only the
relevant lines, enough to establish context, are included. Chances are (since
this is a mailing list) we've already read the original message.
- Trim irrelevant headers from the original message in your reply. All we need
to see is a) From, b) Date, and c) Subject. We don't even really need the
Subject, if you haven't changed it. Better yet is to just preface the original
message with "On [date] [someone] wrote:".
- Please don't reply to or argue about spam, spam filters or viruses on any
Samba lists. We do have a spam filtering system that is working quite well thank
you very much but occasionally unwanted messages slip through. Deal with it.
- Never say "Me too." It doesn't help anyone solve the problem. Instead, if you
ARE having the same problem, give more information. Have you seen something that
the other writer hasn't mentioned, which may be helpful?
- If you ask about a problem, then come up with the solution on your own or
through another source, by all means post it. Someone else may have the same
problem and is waiting for an answer, but never hears of it.
- Give as much *relevant* information as possible such as Samba release number,
OS, kernel version, etc...
- RTFM. Google.
### WEB SITE
A Samba WWW [site](https://samba.org) has been setup with lots of useful info.
As well as general information and documentation, this also has searchable
archives of the mailing list and a user survey that shows who else is using this
package.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEgfXigyvSVFoYl7cTqplEL7aAtiAFAmWcCFAACgkQqplEL7aA
tiDKSBAAuWA9jT6xCfFACIlme7DbEoUm/Bsbf+GM2Somd3pgajekiNxo7CsW9Xub
Vmpj0Q5OKiri81XTqA8LlqMCBliqfw/rnP48kCH0YqXzjqD6aYuwmk0Q4G3wWBTJ
2ZT/wOpbM3YooFfE9Iffz6uNgAiQ/8kpBt2m6Zzfy8n1ThfztyGAGaSmrUWxgUlq
XjRjtgTw4isZBm+RzCFSGuPxvWvxRlfD5JCe2gc221rI3kbaQE2GSxdZ6D0635Ln
iy64SLIAKkQCrrFFckudSCCLKgLNdIClEwzamhhCbmCxnWMDufzN+BQZhq3axQ+x
svPfZqltVSQztr4nPGvKdebtVLL2Zyf/LtXWQP/s66quHlHFoEAC7MuD6tEMQVar
JQUCN51Gs0Yk12iReQFm6/Uo35aPAlai1e2uOkNzS5FnagRObYt6FYeQripks4I8
ZW5VvF4cE0zqdjrlG+Ttqmpbj7i6AUJj9wSbrEOFDUhTL+QPPOfJ05yr1BHmS6nJ
vuuUs+ei/DnYEFS91P81h5NuOdpRHIBTG6LUOLz5KOoNdIgvzjD/Ugyscj4AFTBo
+NTG9nNr6gkLV/6dxDRR2/sbU6P+FZBL+JVUoDR7XQ7oHG7sFV+/8Dtu8RivEw++
1sNGqxvGkwu7JunMkJO5YZRwXi81v3nmHkWKgb0+52iYXgmdesY=
=kOPP
-----END PGP SIGNATURE-----

View File

@ -18,6 +18,9 @@
load printers = yes load printers = yes
cups options = raw cups options = raw
# Install samba-usershares package for support
include = /etc/samba/usershares.conf
[homes] [homes]
comment = Home Directories comment = Home Directories
valid users = %S, %D%w%S valid users = %S, %D%w%S

File diff suppressed because it is too large Load Diff

2798
changelog

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
# recipients: idmafs-qe, asn, ftrivino, pfilipen
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
- !PassingTestCaseRule {test_case_name: idm-ci.brew-build.tier1.functional}

View File

@ -1,513 +0,0 @@
From 2d9ab68f501f5796bdf4662a058a2adff30d497e Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Mon, 22 Jul 2024 12:26:55 +0200
Subject: [PATCH] s3:notifyd: Use a watcher per db record
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This fixes a O(n²) performance regression in notifyd. The problem was
that we had a watcher per notify instance. This changes the code to have
a watcher per notify db entry.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14430
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit af011b987a4ad0d3753d83cc0b8d97ad64ba874a)
---
source3/smbd/notifyd/notifyd.c | 214 ++++++++++++++++++-------
source3/smbd/notifyd/notifyd_db.c | 5 +-
source3/smbd/notifyd/notifyd_entry.c | 51 ++++--
source3/smbd/notifyd/notifyd_private.h | 46 ++++--
4 files changed, 228 insertions(+), 88 deletions(-)
diff --git a/source3/smbd/notifyd/notifyd.c b/source3/smbd/notifyd/notifyd.c
index 64dd26a7e11..0b07ab3e435 100644
--- a/source3/smbd/notifyd/notifyd.c
+++ b/source3/smbd/notifyd/notifyd.c
@@ -337,6 +337,7 @@ static bool notifyd_apply_rec_change(
struct messaging_context *msg_ctx)
{
struct db_record *rec = NULL;
+ struct notifyd_watcher watcher = {};
struct notifyd_instance *instances = NULL;
size_t num_instances;
size_t i;
@@ -344,6 +345,7 @@ static bool notifyd_apply_rec_change(
TDB_DATA value;
NTSTATUS status;
bool ok = false;
+ bool new_watcher = false;
if (pathlen == 0) {
DBG_WARNING("pathlen==0\n");
@@ -374,8 +376,12 @@ static bool notifyd_apply_rec_change(
value = dbwrap_record_get_value(rec);
if (value.dsize != 0) {
- if (!notifyd_parse_entry(value.dptr, value.dsize, NULL,
- &num_instances)) {
+ ok = notifyd_parse_entry(value.dptr,
+ value.dsize,
+ &watcher,
+ NULL,
+ &num_instances);
+ if (!ok) {
goto fail;
}
}
@@ -390,8 +396,22 @@ static bool notifyd_apply_rec_change(
goto fail;
}
- if (value.dsize != 0) {
- memcpy(instances, value.dptr, value.dsize);
+ if (num_instances > 0) {
+ struct notifyd_instance *tmp = NULL;
+ size_t num_tmp = 0;
+
+ ok = notifyd_parse_entry(value.dptr,
+ value.dsize,
+ NULL,
+ &tmp,
+ &num_tmp);
+ if (!ok) {
+ goto fail;
+ }
+
+ memcpy(instances,
+ tmp,
+ sizeof(struct notifyd_instance) * num_tmp);
}
for (i=0; i<num_instances; i++) {
@@ -414,41 +434,106 @@ static bool notifyd_apply_rec_change(
*instance = (struct notifyd_instance) {
.client = *client,
.instance = *chg,
- .internal_filter = chg->filter,
- .internal_subdir_filter = chg->subdir_filter
};
num_instances += 1;
}
- if ((instance->instance.filter != 0) ||
- (instance->instance.subdir_filter != 0)) {
- int ret;
+ /*
+ * Calculate an intersection of the instances filters for the watcher.
+ */
+ if (instance->instance.filter > 0) {
+ uint32_t filter = instance->instance.filter;
+
+ if ((watcher.filter & filter) != filter) {
+ watcher.filter |= filter;
+
+ new_watcher = true;
+ }
+ }
+
+ /*
+ * Calculate an intersection of the instances subdir_filters for the
+ * watcher.
+ */
+ if (instance->instance.subdir_filter > 0) {
+ uint32_t subdir_filter = instance->instance.subdir_filter;
- TALLOC_FREE(instance->sys_watch);
+ if ((watcher.subdir_filter & subdir_filter) != subdir_filter) {
+ watcher.subdir_filter |= subdir_filter;
- ret = sys_notify_watch(entries, sys_notify_ctx, path,
- &instance->internal_filter,
- &instance->internal_subdir_filter,
- notifyd_sys_callback, msg_ctx,
- &instance->sys_watch);
- if (ret != 0) {
- DBG_WARNING("sys_notify_watch for [%s] returned %s\n",
- path, strerror(errno));
+ new_watcher = true;
}
}
if ((instance->instance.filter == 0) &&
(instance->instance.subdir_filter == 0)) {
+ uint32_t tmp_filter = 0;
+ uint32_t tmp_subdir_filter = 0;
+
/* This is a delete request */
- TALLOC_FREE(instance->sys_watch);
*instance = instances[num_instances-1];
num_instances -= 1;
+
+ for (i = 0; i < num_instances; i++) {
+ struct notifyd_instance *tmp = &instances[i];
+
+ tmp_filter |= tmp->instance.filter;
+ tmp_subdir_filter |= tmp->instance.subdir_filter;
+ }
+
+ /*
+ * If the filter has changed, register a new watcher with the
+ * changed filter.
+ */
+ if (watcher.filter != tmp_filter ||
+ watcher.subdir_filter != tmp_subdir_filter)
+ {
+ watcher.filter = tmp_filter;
+ watcher.subdir_filter = tmp_subdir_filter;
+
+ new_watcher = true;
+ }
+ }
+
+ if (new_watcher) {
+ /*
+ * In case we removed all notify instances, we want to remove
+ * the watcher. We won't register a new one, if no filters are
+ * set anymore.
+ */
+
+ TALLOC_FREE(watcher.sys_watch);
+
+ watcher.sys_filter = watcher.filter;
+ watcher.sys_subdir_filter = watcher.subdir_filter;
+
+ /*
+ * Only register a watcher if we have filter.
+ */
+ if (watcher.filter != 0 || watcher.subdir_filter != 0) {
+ int ret = sys_notify_watch(entries,
+ sys_notify_ctx,
+ path,
+ &watcher.sys_filter,
+ &watcher.sys_subdir_filter,
+ notifyd_sys_callback,
+ msg_ctx,
+ &watcher.sys_watch);
+ if (ret != 0) {
+ DBG_WARNING("sys_notify_watch for [%s] "
+ "returned %s\n",
+ path,
+ strerror(errno));
+ }
+ }
}
DBG_DEBUG("%s has %zu instances\n", path, num_instances);
if (num_instances == 0) {
+ TALLOC_FREE(watcher.sys_watch);
+
status = dbwrap_record_delete(rec);
if (!NT_STATUS_IS_OK(status)) {
DBG_WARNING("dbwrap_record_delete returned %s\n",
@@ -456,13 +541,21 @@ static bool notifyd_apply_rec_change(
goto fail;
}
} else {
- value = make_tdb_data(
- (uint8_t *)instances,
- sizeof(struct notifyd_instance) * num_instances);
+ struct TDB_DATA iov[2] = {
+ {
+ .dptr = (uint8_t *)&watcher,
+ .dsize = sizeof(struct notifyd_watcher),
+ },
+ {
+ .dptr = (uint8_t *)instances,
+ .dsize = sizeof(struct notifyd_instance) *
+ num_instances,
+ },
+ };
- status = dbwrap_record_store(rec, value, 0);
+ status = dbwrap_record_storev(rec, iov, ARRAY_SIZE(iov), 0);
if (!NT_STATUS_IS_OK(status)) {
- DBG_WARNING("dbwrap_record_store returned %s\n",
+ DBG_WARNING("dbwrap_record_storev returned %s\n",
nt_errstr(status));
goto fail;
}
@@ -706,12 +799,18 @@ static void notifyd_trigger_parser(TDB_DATA key, TDB_DATA data,
.when = tstate->msg->when };
struct iovec iov[2];
size_t path_len = key.dsize;
+ struct notifyd_watcher watcher = {};
struct notifyd_instance *instances = NULL;
size_t num_instances = 0;
size_t i;
+ bool ok;
- if (!notifyd_parse_entry(data.dptr, data.dsize, &instances,
- &num_instances)) {
+ ok = notifyd_parse_entry(data.dptr,
+ data.dsize,
+ &watcher,
+ &instances,
+ &num_instances);
+ if (!ok) {
DBG_DEBUG("Could not parse notifyd_entry\n");
return;
}
@@ -734,9 +833,11 @@ static void notifyd_trigger_parser(TDB_DATA key, TDB_DATA data,
if (tstate->covered_by_sys_notify) {
if (tstate->recursive) {
- i_filter = instance->internal_subdir_filter;
+ i_filter = watcher.sys_subdir_filter &
+ instance->instance.subdir_filter;
} else {
- i_filter = instance->internal_filter;
+ i_filter = watcher.sys_filter &
+ instance->instance.filter;
}
} else {
if (tstate->recursive) {
@@ -1146,46 +1247,39 @@ static int notifyd_add_proxy_syswatches(struct db_record *rec,
struct db_context *db = dbwrap_record_get_db(rec);
TDB_DATA key = dbwrap_record_get_key(rec);
TDB_DATA value = dbwrap_record_get_value(rec);
- struct notifyd_instance *instances = NULL;
- size_t num_instances = 0;
- size_t i;
+ struct notifyd_watcher watcher = {};
char path[key.dsize+1];
bool ok;
+ int ret;
memcpy(path, key.dptr, key.dsize);
path[key.dsize] = '\0';
- ok = notifyd_parse_entry(value.dptr, value.dsize, &instances,
- &num_instances);
+ /* This is a remote database, we just need the watcher. */
+ ok = notifyd_parse_entry(value.dptr, value.dsize, &watcher, NULL, NULL);
if (!ok) {
DBG_WARNING("Could not parse notifyd entry for %s\n", path);
return 0;
}
- for (i=0; i<num_instances; i++) {
- struct notifyd_instance *instance = &instances[i];
- uint32_t filter = instance->instance.filter;
- uint32_t subdir_filter = instance->instance.subdir_filter;
- int ret;
+ watcher.sys_watch = NULL;
+ watcher.sys_filter = watcher.filter;
+ watcher.sys_subdir_filter = watcher.subdir_filter;
- /*
- * This is a remote database. Pointers that we were
- * given don't make sense locally. Initialize to NULL
- * in case sys_notify_watch fails.
- */
- instances[i].sys_watch = NULL;
-
- ret = state->sys_notify_watch(
- db, state->sys_notify_ctx, path,
- &filter, &subdir_filter,
- notifyd_sys_callback, state->msg_ctx,
- &instance->sys_watch);
- if (ret != 0) {
- DBG_WARNING("inotify_watch returned %s\n",
- strerror(errno));
- }
+ ret = state->sys_notify_watch(db,
+ state->sys_notify_ctx,
+ path,
+ &watcher.filter,
+ &watcher.subdir_filter,
+ notifyd_sys_callback,
+ state->msg_ctx,
+ &watcher.sys_watch);
+ if (ret != 0) {
+ DBG_WARNING("inotify_watch returned %s\n", strerror(errno));
}
+ memcpy(value.dptr, &watcher, sizeof(struct notifyd_watcher));
+
return 0;
}
@@ -1193,21 +1287,17 @@ static int notifyd_db_del_syswatches(struct db_record *rec, void *private_data)
{
TDB_DATA key = dbwrap_record_get_key(rec);
TDB_DATA value = dbwrap_record_get_value(rec);
- struct notifyd_instance *instances = NULL;
- size_t num_instances = 0;
- size_t i;
+ struct notifyd_watcher watcher = {};
bool ok;
- ok = notifyd_parse_entry(value.dptr, value.dsize, &instances,
- &num_instances);
+ ok = notifyd_parse_entry(value.dptr, value.dsize, &watcher, NULL, NULL);
if (!ok) {
DBG_WARNING("Could not parse notifyd entry for %.*s\n",
(int)key.dsize, (char *)key.dptr);
return 0;
}
- for (i=0; i<num_instances; i++) {
- TALLOC_FREE(instances[i].sys_watch);
- }
+ TALLOC_FREE(watcher.sys_watch);
+
return 0;
}
diff --git a/source3/smbd/notifyd/notifyd_db.c b/source3/smbd/notifyd/notifyd_db.c
index 18228619e9a..7dc3cd58081 100644
--- a/source3/smbd/notifyd/notifyd_db.c
+++ b/source3/smbd/notifyd/notifyd_db.c
@@ -40,7 +40,10 @@ static bool notifyd_parse_db_parser(TDB_DATA key, TDB_DATA value,
memcpy(path, key.dptr, key.dsize);
path[key.dsize] = 0;
- ok = notifyd_parse_entry(value.dptr, value.dsize, &instances,
+ ok = notifyd_parse_entry(value.dptr,
+ value.dsize,
+ NULL,
+ &instances,
&num_instances);
if (!ok) {
DBG_DEBUG("Could not parse entry for path %s\n", path);
diff --git a/source3/smbd/notifyd/notifyd_entry.c b/source3/smbd/notifyd/notifyd_entry.c
index 539010de03a..f3b0e908136 100644
--- a/source3/smbd/notifyd/notifyd_entry.c
+++ b/source3/smbd/notifyd/notifyd_entry.c
@@ -21,22 +21,51 @@
* Parse an entry in the notifyd_context->entries database
*/
-bool notifyd_parse_entry(
- uint8_t *buf,
- size_t buflen,
- struct notifyd_instance **instances,
- size_t *num_instances)
+/**
+ * @brief Parse a notifyd database entry.
+ *
+ * The memory we pass down needs to be aligned. If it isn't aligned we can run
+ * into obscure errors as we just point into the data buffer.
+ *
+ * @param data The data to parse
+ * @param data_len The length of the data to parse
+ * @param watcher A pointer to store the watcher data or NULL.
+ * @param instances A pointer to store the array of notify instances or NULL.
+ * @param pnum_instances The number of elements in the array. If you just want
+ * the number of elements pass NULL for the watcher and instances pointers.
+ *
+ * @return true on success, false if an error occurred.
+ */
+bool notifyd_parse_entry(uint8_t *data,
+ size_t data_len,
+ struct notifyd_watcher *watcher,
+ struct notifyd_instance **instances,
+ size_t *pnum_instances)
{
- if ((buflen % sizeof(struct notifyd_instance)) != 0) {
- DBG_WARNING("invalid buffer size: %zu\n", buflen);
+ size_t ilen;
+
+ if (data_len < sizeof(struct notifyd_watcher)) {
return false;
}
- if (instances != NULL) {
- *instances = (struct notifyd_instance *)buf;
+ if (watcher != NULL) {
+ *watcher = *((struct notifyd_watcher *)(uintptr_t)data);
}
- if (num_instances != NULL) {
- *num_instances = buflen / sizeof(struct notifyd_instance);
+
+ ilen = data_len - sizeof(struct notifyd_watcher);
+ if ((ilen % sizeof(struct notifyd_instance)) != 0) {
+ return false;
+ }
+
+ if (pnum_instances != NULL) {
+ *pnum_instances = ilen / sizeof(struct notifyd_instance);
}
+ if (instances != NULL) {
+ /* The (uintptr_t) cast removes a warning from -Wcast-align. */
+ *instances =
+ (struct notifyd_instance *)(uintptr_t)
+ (data + sizeof(struct notifyd_watcher));
+ }
+
return true;
}
diff --git a/source3/smbd/notifyd/notifyd_private.h b/source3/smbd/notifyd/notifyd_private.h
index 36c08f47c54..db8e6e1c005 100644
--- a/source3/smbd/notifyd/notifyd_private.h
+++ b/source3/smbd/notifyd/notifyd_private.h
@@ -20,30 +20,48 @@
#include "lib/util/server_id.h"
#include "notifyd.h"
+
/*
- * notifyd's representation of a notify instance
+ * Representation of a watcher for a path
+ *
+ * This will be stored in the db.
*/
-struct notifyd_instance {
- struct server_id client;
- struct notify_instance instance;
-
- void *sys_watch; /* inotify/fam/etc handle */
+struct notifyd_watcher {
+ /*
+ * This is an intersections of the filter the watcher is listening for.
+ */
+ uint32_t filter;
+ uint32_t subdir_filter;
/*
- * Filters after sys_watch took responsibility of some bits
+ * Those are inout variables passed to the sys_watcher. The sys_watcher
+ * will remove the bits it can't handle.
*/
- uint32_t internal_filter;
- uint32_t internal_subdir_filter;
+ uint32_t sys_filter;
+ uint32_t sys_subdir_filter;
+
+ /* The handle for inotify/fam etc. */
+ void *sys_watch;
+};
+
+/*
+ * Representation of a notifyd instance
+ *
+ * This will be stored in the db.
+ */
+struct notifyd_instance {
+ struct server_id client;
+ struct notify_instance instance;
};
/*
* Parse an entry in the notifyd_context->entries database
*/
-bool notifyd_parse_entry(
- uint8_t *buf,
- size_t buflen,
- struct notifyd_instance **instances,
- size_t *num_instances);
+bool notifyd_parse_entry(uint8_t *data,
+ size_t data_len,
+ struct notifyd_watcher *watcher,
+ struct notifyd_instance **instances,
+ size_t *num_instances);
#endif
--
2.46.1

View File

@ -1,27 +0,0 @@
---
inspections:
disttag: off
badfuncs:
ignore:
- /usr/bin/nmblookup
- /usr/bin/smbtorture
- /usr/lib*/libndr.so.*
- /usr/lib*/libsmbconf.so.*
- /usr/lib*/samba/libgse-private-samba.so
- /usr/lib*/samba/libsamba-sockets-private-samba.so
- /usr/lib*/samba/service/nbtd.so
- /usr/libexec/ctdb/smnotify
- /usr/sbin/nmbd
runpath:
allowed_paths:
- /usr/lib/samba
- /usr/lib64/samba
abidiff:
suppression_file: samba.abignore
debuginfo:
ignore:
- /usr/lib*/libdcerpc-samr.so.*

Binary file not shown.

View File

@ -1,2 +0,0 @@
SHA512 (samba-4.21.1.tar.asc) = 2c1e4b347044e15a852ced8bb412a3f372fd2c2b5e0001b1a773f7283f2d8fa62942143b46cbc3f16b18882255cf0aac4426002453971361b0002357657484f1
SHA512 (samba-4.21.1.tar.xz) = 182759820708c9df26fbcb09e755e81236ecacf543f3e18a05dbd0ea551ab072d338fe239eb99ff506f158ec45e981a893ce46eacdde6e073ee85ceb43e2669a

View File

@ -1,62 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of gating test "testparm"
# Description: Basic config check for samba
# Author: Andrej Dzilsky <adzilsky@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=testparm
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Andrej Dzilsky <adzilsky@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Basic samba config check" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: samba" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 1653890" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,43 +0,0 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of gating test "testparm"
# Description: Basic samba config check
# Author: Andrej Dzilsky <adzilsky@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/bin/rhts-environment.sh || exit 1
. /usr/share/beakerlib/beakerlib.sh || exit 1
# From Andreas Schneider <asn@redhat.com>:
# This is a basic test which makes sure the samba is installed and the default
# smb.conf is available.
rlJournalStart
rlPhaseStartTest
rlRun "testparm -v -s" 0 "testparm ends with expected output"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,13 +0,0 @@
---
# This first play always runs on the local staging system
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
tests:
- testparm
required_packages:
- samba
- samba-client
- samba-common