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

217 Commits

Author SHA1 Message Date
Jeremy Allison
4ae130bfa8 Add 3 second timeout when terminating server and sending print notify
messages. Stops build-up of large numbers of smbd's waiting to terminate
on large print throughput.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
f087fe546f Keep all the const warnings in one place, by adding a utility function to
make the TDB_DATA.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
df6e455992 fix tdb_append() prototype 0001-01-01 00:00:00 +00:00
Jeremy Allison
b515525a06 Added tdb_append() call. Efficiently adds to an entry. Used by new messaging
code. Also added torture tests for it.
Jeremy.
0001-01-01 00:00:00 +00:00
Martin Pool
575908cb06 tdb_chainlock_with_timeout: Add TODO: If we time out waiting for a
lock, it might be nice to use F_GETLK to get the pid of the process
currently holding the lock and print that as part of the debugging
message.

I'd like to have this in appliance_head, but the code is too different
so I won't worry for now.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
92a777d0ea BIG patch...
This patch makes Samba compile cleanly with -Wwrite-strings.
 - That is, all string literals are marked as 'const'.  These strings are
always read only, this just marks them as such for passing to other functions.

What is most supprising is that I didn't need to change more than a few lines of code (all
in 'net', which got a small cleanup of net.h and extern variables).  The rest
is just adding a lot of 'const'.

As far as I can tell, I have not added any new warnings - apart from making all
of tdbutil.c's function const (so they warn for adding that const string to
struct).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Simo Sorce
eb595efa7e it's getting comic ...
yet another missing piece :-O
0001-01-01 00:00:00 +00:00
Jeremy Allison
ff3a8d3728 Fixed auth module code. Added VALGRIND defines to reduce spurious warnings.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
19f86f1f72 Lots of fixes for error paths where tdb_fetch() data need freeing.
Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
064fa201ab Add chainlock_read functions to get a read lock. Used in *massively*
contended tdb's (and I've got one :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
10024ed06e Merge of scalable printing code fix... Needs testing.
Also tidied up some of Richard's code (I don't think he uses the compiler
flags -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual like
I do :-) :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
bb58a08af4 Add a timeout to tdb_lock_bystring(). Ensure we never have more than
MAX_PRINT_JOBS in a queue.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ece9507ec3 Make explicit the difference between a tdb key with no data attached, and
a non existent entry. Stop a malloc(0) being called in the first case.
Jeremy.
0001-01-01 00:00:00 +00:00
Volker Lendecke
a1bade0748 tdbdump also needs signal.h. Thanks to Guenther Deschner <gd@suse.de>
Volker
0001-01-01 00:00:00 +00:00
Jeremy Allison
7e19a6b7ad tdb tools need #include <signal.h>
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a7781f91d8 Never, *ever* hold a mutex lock in the message database where there may
be traversals being attempted. Yes, this was from bitter experience (and
an out of control server :-). Also allow callers to break out of a tdb_chainlock
with sigalarm if desired.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
4aa7dfb7e7 ensure that we unlock in case we hit a tdb error 0001-01-01 00:00:00 +00:00
Andrew Tridgell
775b918b8c don't report the faiilure of non-blocking locks. They are supposed to
fail sometimes, thats why they are non-blocking :)
0001-01-01 00:00:00 +00:00
Jeremy Allison
b0909cfa14 *Experimental* new large-scaling printer code. Splits printing.tdb into
a separate tdb per printer, but only keeps (currently one) tdb open at
a time (although this is easily changed by changing a #define). Needs
scalability testing with large numbers of printers now....
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
ae2f8aa9d0 don't backup to a newer file 0001-01-01 00:00:00 +00:00
Tim Potter
0cd3952f40 Added tdb_delete_by_string() function. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
e99b6a2b91 auto-recover from the fairly common case of a non-clean tdb shutdown
while deleting a record. This leaves us with a non-free record on the
free list.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
d0eae50874 fixed tdbtool from core dumping. But the braces to make Chris happy !
J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
7ddad4061a Merge Herb's idmap endian fix.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
1d66e53a64 We cannot set errno=0 in any of the wrapper calls as this breaks UNIX error
returns to the client.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
48475a7a69 First cut at fix for the EINTR problem... More needs to be done I think.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
1c92fab405 ignore a few more files 0001-01-01 00:00:00 +00:00
Andrew Bartlett
c331200600 Extra file for the tdb search code (linked list definition).
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
0bdd94cb99 Partly based on the work by mimir (Rafal Szczesniak
<mimir@diament.ists.pwr.wroc.pl>) this patch allows samba to correctly
enumerate its trusted domains - by exaimining the keys in the secrets.tdb file.

This patch has been tested with both NT4 and rpcclient/wbinfo, and adds
some extra functionality to talloc and rpc_parse to allow it to deal with
already unicode strings.

Finally, this cleans up some const warnings that were in net_rpc.c by pushing
another dash of const into the rpc client code.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
a4594d9efe Make our atomic increment code actually do this during its first/second run.
The previous code would return the same value for both the initial and second
call, only incrementing on later calls.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
16015c07ea Added Shirish's client side caching policy change.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
3e7985c60e When printing a tdb log message display "unnamed" instead of "unknown" if
the tdb has not been named.
0001-01-01 00:00:00 +00:00
Simo Sorce
f07b2b3d52 uint32 store and fectch functions, a signed int is not enough sometimes 0001-01-01 00:00:00 +00:00
Simo Sorce
af0fa4cf7c better check of called function's return
tdbtorture say it's ok
0001-01-01 00:00:00 +00:00
Jeremy Allison
1c4a00dcc1 Make winbindd_idmap tdb endian independent. This is very important for
sharing between machines with rsync.
Finally removed tdb_store_int/tdb_fetch_int.
Now only tdb_store_int32/tdb_fetch_int32 which are endian independent
are allowed.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
6edb5bea5f a bit more portability for tdbbackup 0001-01-01 00:00:00 +00:00
Andrew Tridgell
9cc1dadfb0 make tdbbackup more portable 0001-01-01 00:00:00 +00:00
Andrew Tridgell
73b3487daf prevent bogus compiler complaints about comments in comments 0001-01-01 00:00:00 +00:00
Andrew Tridgell
4ac4220e2f added a bunch of explanation about tdbbackup 0001-01-01 00:00:00 +00:00
Andrew Tridgell
18e81a4a5b don't use -pg by default when building standalone 0001-01-01 00:00:00 +00:00
Andrew Tridgell
1438cd8e50 added -v and -s options
-v is used for verify/restore from backup
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f619330082 added a tdb backup utility
when complete, this will be used to backup critical tdbs at samba
startup and possibly periodically while Samba is running so that if
tdb corruption is caused by a power failure Samba can restore from the
backup.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
3bf4b42771 Various comment fixes from Rafal Szczesniak <mimir@diament.ists.pwr.wroc.pl> 0001-01-01 00:00:00 +00:00
Jeremy Allison
9dae1398b4 Memory leak on error condition fixed by Kian Win <codegrunt@rubbercookie.com>.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
0001-01-01 00:00:00 +00:00
Tim Potter
5fb3be6291 Raise log level of warning produced when the open() of the tdb fails.
Sometimes an open error is OK.
0001-01-01 00:00:00 +00:00
Tim Potter
96c36e51ee Display tdb name of "unknown" in logging debug when tdb has not been named. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
ff354c99c5 This is another *BIG* change...
Samba now features a pluggable passdb interface, along the same lines as the
one in use in the auth subsystem.  In this case, only one backend may be active
at a time by the 'normal' interface, and only one backend per passdb_context is
permitted outside that.

This pluggable interface is designed to allow any number of passdb backends to
be compiled in, with the selection at runtime.  The 'passdb backend' paramater
has been created (and documented!) to support this.

As such, configure has been modfied to allow (for example) --with-ldap and the
old smbpasswd to be selected at the same time.

This patch also introduces two new backends:  smbpasswd_nua and tdbsam_nua.
These two backends accept 'non unix accounts', where the user does *not* exist
in /etc/passwd.  These accounts' don't have UIDs in the unix sense, but to
avoid conflicts in the algroitmic mapping of RIDs, they use the values
specified in the 'non unix account range' paramter - in the same way as the
winbind ranges are specifed.

While I was at it, I cleaned up some of the code in pdb_tdb (code copied
directly from smbpasswd and not really considered properly).  Most of this was
to do with % macro expansion on stored data.  It isn't easy to get the macros
into the tdb, and the first password change will 'expand' them.  tdbsam needs
to use a similar system to pdb_ldap in this regard.

This patch only makes minor adjustments to pdb_nisplus and pdb_ldap, becouse I
don't have the test facilities for these.  I plan to incoroprate at least
pdb_ldap into this scheme after consultation with Jerry.

Each (converted) passdb module now no longer has any 'static' variables, and
only exports 1 init function outside its .c file.

The non-unix-account support in this patch has been proven!  It is now possible
to join a win2k machine to a Samba PDC without an account in /etc/passwd!

Other changes:

Minor interface adjustments:
pdb_delete_sam_account() now takes a SAM_ACCOUNT, not a char*.

pdb_update_sam_account() no longer takes the 'override' argument that was being
ignored so often (every other passdb backend).  Extra checks have been added in
some places.

Minor code changes:
smbpasswd no longer attempts to initialise the passdb at startup, this is
now done on first use.

pdbedit has lost some of its 'machine account' logic, as this behaviour is now
controlled by the passdb subsystem directly.

The samr subsystem no longer calls 'local password change', but does the pdb
interactions directly.  This allow the ACB_ flags specifed to be transferred
direct to the backend, without interference.

Doco:

I've updated the doco to reflect some of the changes, and removed some paramters
no longer applicable to HEAD.
0001-01-01 00:00:00 +00:00
Jeremy Allison
eb99e7f29c Ensure we log tdb open fails. Patch from Alexander Bokovoy <a.bokovoy@sam-solutions.net>
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
4f703b84cd Move SAFE_FREE into tdb.c to stop exporting it into tdb.h namespace.
Jeremy.
0001-01-01 00:00:00 +00:00