1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00
Commit Graph

203 Commits

Author SHA1 Message Date
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
Jeremy Allison
1233b553e7 Added int32 version of "atomic" update.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d57fb9a8c2 Added int32 versions of the endian-dependent code.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a0cdec3acc Fixed nasty cast of tdb_delete in traversals.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
eb66074665 debug statement fixups.
Merge SAFE_FREE fix in tdb from 2.2, and IRIX fix.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
65e857b36e more irix -64 portability fixes 0001-01-01 00:00:00 +00:00
Martin Pool
79feca4d25 Ignore torture.tdb 0001-01-01 00:00:00 +00:00
Andrew Tridgell
412e79c448 net ads password and net ads chostpass commands from Remus Koos 0001-01-01 00:00:00 +00:00
Jeremy Allison
1d2504b5c7 Must check against -1 for fcntl error check.
Jeremy
0001-01-01 00:00:00 +00:00
Herb Lewis
fe0db4c55f add *.po32 to ignore list 0001-01-01 00:00:00 +00:00
Jeremy Allison
9e3581827d Fix up warnings. Make tdb_openXX() names const.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b03aaddcf3 Tidyups to remove warnings on tdb standalone code.
Jeremy.
0001-01-01 00:00:00 +00:00
Martin Pool
6c684c89a4 Doc. 0001-01-01 00:00:00 +00:00
Martin Pool
caa08bb56e Allow for internal databases which may have no name. 0001-01-01 00:00:00 +00:00
Martin Pool
8118676f78 Log more error messages. 0001-01-01 00:00:00 +00:00