1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
https://gitlab.com/samba-team/samba is the Official GitLab mirror of https://git.samba.org/samba.git -- Merge requests should be made on GitLab (not on GitHub)
Go to file
Volker Lendecke 89c785c47a s3: Fix a long-standing problem with recycled PIDs
When a samba server process dies hard, it has no chance to clean up its entries
in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb.

For locking.tdb and brlock.tdb Samba is robust by checking every time we read
an entry from the database if the corresponding process still exists. If it
does not exist anymore, the entry is deleted. This is not 100% failsafe though:
On systems with a limited PID space there is a non-zero chance that between the
smbd's death and the fresh access, the PID is recycled by another long-running
process. This renders all files that had been locked by the killed smbd
potentially unusable until the new process also dies.

This patch is supposed to fix the problem the following way: Every process ID
in every database is augmented by a random 64-bit number that is stored in a
serverid.tdb. Whenever we need to check if a process still exists we know its
PID and the 64-bit number. We look up the PID in serverid.tdb and compare the
64-bit number. If it's the same, the process still is a valid smbd holding the
lock. If it is different, a new smbd has taken over.

I believe this is safe against an smbd that has died hard and the PID has been
taken over by a non-samba process. This process would not have registered
itself with a fresh 64-bit number in serverid.tdb, so the old one still exists
in serverid.tdb. We protect against this case by the parent smbd taking care of
deregistering PIDs from serverid.tdb and the fact that serverid.tdb is
CLEAR_IF_FIRST.

CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not
work when all smbds are restarted. For this, "net serverid wipe" has to be run
before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up
sessionid.tdb and connections.tdb.

While there, this also cleans up overloading connections.tdb with all the
process entries just for messaging_send_all().

Volker
2010-03-10 16:07:10 +01:00
codepages Share codepages. 2008-10-23 16:58:11 +02:00
docs-xml samba: remove Linux cifs-utils files from samba master branch 2010-03-08 15:05:05 -05:00
examples Fix for bug #7189 - Open txt files with notepad on samba shares creates problem. 2010-03-05 15:13:37 -08:00
lib lib/util: change samba_runcmd() to use tevent_req _send/_recv 2010-03-09 21:49:45 +11:00
libcli libcli/auth/schannel_state_tdb.c - fix an obviously wrong error handling 2010-03-09 17:18:26 +01:00
libds/common libds: added recyclebin feature GUID 2010-02-12 01:08:11 +11:00
libgpo Fix NULL pointer dereference in libgpo when listing Local Policy which has no security descriptor. 2009-11-15 19:26:50 +01:00
librpc s3: re-run make samba3-idl. 2010-03-05 22:03:26 +01:00
m4 check_python.m4 - Raise the minimum python version up to 2.4 2010-02-09 17:53:10 +01:00
nsswitch s4:unittest Fix unittest to reflect that wbinfo -r no longer fail 2010-03-09 17:20:31 +01:00
packaging packaging(RHEL-CTDB): adapt configure.rpm to match the spec-file configure call 2010-02-12 23:12:13 +01:00
packaging4 Move README.Debian to the right directory. 2008-10-19 11:53:13 +02:00
pcp r23789: more pcp files under v2-only 2007-10-10 12:28:24 -05:00
pidl pidl:NDR/Client.pm: generate explicit _recv functions 2010-03-01 16:11:51 +01:00
release-scripts s3:release-scripts: fix create-tarball to treat vendor patch level correctly 2010-03-08 23:38:55 +01:00
script Move findstatic.pl script to top-level. 2009-06-03 15:06:15 +02:00
selftest s4:provision - Use netbios name for FDS instance name. 2010-03-02 14:07:01 +11:00
source3 s3: Fix a long-standing problem with recycled PIDs 2010-03-10 16:07:10 +01:00
source4 s4-spoolss: remove unsed iconv handle from dcesrv_spoolss_GetPrinterData(). 2010-03-10 11:16:20 +01:00
swat rename swat => swat2, so that we don't conflict with samba3 2008-09-12 08:51:07 +02:00
swat2 rename swat => swat2, so that we don't conflict with samba3 2008-09-12 08:51:07 +02:00
testdata s4:samba3sam Remove extra newlines that broke samba3sam test 2009-07-29 09:29:50 +10:00
testprogs testprogs: add test_PrinterDataW. 2010-03-04 10:10:02 +01:00
tests s3: Fix bug 7052: "DFS broken on AIX (maybe others)" 2010-01-21 14:21:26 +01:00
testsuite testsuite/libsmbclient use source3 in the path of the C and LFLAGS 2010-01-28 00:44:04 +01:00
.gitignore Fix the build, add filtered subunit runner. 2010-03-01 16:24:59 +01:00
COPYING r23796: main COPYING file for samba4, plus some formatting varients 2007-10-10 14:59:14 -05:00
howto4.txt s4:upgrade_from_s3 - Move it back to "setup" 2009-11-28 19:25:12 +01:00
howto-ol-backend-s4.txt s4:provision A crude update of the OpenLDAP backend HOWTO 2009-08-17 09:50:59 +10:00
MAINTAINERS Update pdbsql maintainers. 2008-09-18 16:27:38 +02:00
Manifest r10039: Minor update. 2007-10-10 11:03:31 -05:00
merged-branches.txt prepare merging Samba3 and Samba4 together. 2008-09-11 16:01:26 +02:00
PFIF.txt Added PFIF notice to Samba 4.0 tree 2008-01-23 13:09:37 +11:00
prog_guide4.txt s4:prog_guide4.txt: remove obsolete comments 2009-12-15 23:34:23 +01:00
Read-Manifest-Now
README README: Fix indentation of bullet point. 2009-06-03 16:26:29 +02:00
README.cifs-utils samba: remove Linux cifs-utils files from samba master branch 2010-03-08 15:05:05 -05:00
README.Coding README.coding: Update rules about code blocks and braces. 2009-11-18 11:44:50 +01:00
Roadmap 3.4 is released... 2009-07-17 22:40:24 +02:00
swat2.txt r1273: An initial doc about what I'd like to see in the swat for samba4. Please 2007-10-10 12:56:48 -05:00
upgrading-samba4.txt Improve upgrade instructions 2009-12-01 13:03:17 +11:00
WHATSNEW4.txt more WHATSNEW4 2010-01-11 16:35:28 +11:00
WHATSNEW.txt Revert "net: Use samba default command line arguments." 2009-07-22 13:39:34 +02:00

This is the release version of Samba, the free SMB and CIFS client and
server for UNIX and other operating systems. Samba is maintained by
the Samba Team, who support the original author, Andrew Tridgell.

>>>> Please read THE WHOLE of this file as it gives important information
>>>> about the configuration and use of Samba.

NOTE: Installation instructions may be found in 
      docs/htmldocs/Samba3-HOWTO/install.html

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 http://samba.org/cifs.


WHY DO PEOPLE WANT TO USE SMB?
==============================

1. Many people want to integrate their Microsoft desktop clients
   with their Unix servers.

2. Others want to integrate their Microsoft (etc) servers with Unix
   servers. This is a different problem to integrating desktop 
   clients.

3. 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 NT 4.0 Domain Controller 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 at
http://samba.org/samba, and browse the user survey.

Related packages include:

- smbfs, a 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.

- cifsvfs, a more 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.



CONTRIBUTIONS
=============

If you want to contribute to the development of the software then
please join the mailing list. The Samba team accepts patches
(preferably in "diff -u" format, see http://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 http://lists.samba.org/.

You can also get the Samba sourcecode straight from the git repository - see
http://wiki.samba.org/index.php/Using_Git_for_Samba_Development.

You could also send hardware/software/money/jewelry or pre-paid pizza
vouchers directly to Andrew. The pizza vouchers would be especially
welcome, in fact there is a special field in the survey for people who
have paid up their pizza :-)

If you like a particular feature then look through the git change-log
(on the web at http://gitweb.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. However, as you can see from the user survey quite a lot of 
people do seem to like it at the moment :-)


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 coodinate 
on the samba@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
<http://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 <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
<http://lists.samba.org/>


MAILING LIST ETIQUETTE
----------------------

A few tips when submitting to this or any mailing list.

1. 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".

2. 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.

3. 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:".

4. 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.

5. 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?

6. 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.

7. Give as much *relevant* information as possible such as Samba
   release number, OS, kernel version, etc...

8. RTFM. Google. groups.google.com.


NEWS GROUP
----------

You might also like to look at the usenet news group comp.protocols.smb 
as it often contains lots of useful info and is frequented by lots of 
Samba users. The newsgroup was initially setup by people on the Samba 
mailing list. It is not, however, exclusive to Samba, it is a forum for 
discussing the SMB protocol (which Samba implements). The samba list 
is gatewayed to this newsgroup.


WEB SITE
--------

A Samba WWW site has been setup with lots of useful info. Connect to:

http://samba.org/samba/

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. Have you registered with the survey yet? :-)