1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-20 14:03:59 +03:00

78 Commits

Author SHA1 Message Date
Jelmer Vernooij
7ea0ef92cb - Point users at the HOWTO Collection instead of 'README' in modules/mysql.c
- Make passdb work with absolute paths (passdb backend = /path/to/smbpasswd.so works now). vfs, rpc and charset will follow
(This used to be commit 794d3ed03619a4e41558d9ff65783a1aa1b2be90)
2003-03-30 12:42:18 +00:00
Jelmer Vernooij
41a09c3c53 Revoke some of the popt patch from metze I applied earlier today. It added
some double options and broke some parameters.
(This used to be commit d5f9b0275c91512e1926504f22aaeec2d104430d)
2003-03-24 14:15:14 +00:00
Jelmer Vernooij
11e9de855c Patch from metze to generalise POPT_COMMON_SAMBA, with some minor changes
(This used to be commit 2ddfed298d7f0b6e690275725a39c3ef107077ae)
2003-03-24 11:25:34 +00:00
Volker Lendecke
b5762d9937 Implement abartlet's suggestion to add attribs to ldap if they
are 'SET' when adding the account.

I really don't like passing flags down to inner routines and
complicated if/else conditions, but this time he might be right. ;-)

Volker
(This used to be commit 80d2578108da14f60133df3a308b867beb27e920)
2003-03-23 14:19:13 +00:00
Volker Lendecke
cf4f074b94 This does two things:
* pdbedit -i -e sets all SAM_ACCOUNT elements
  to CHANGED to satisfy the new pdb_ldap.c handling

* pdbedit -g transfers group mappings. I made this
  separate from the user database, as current installations
  have to live with a split backend.

  So, if you are running 3_0 alphas with LDAP as a backend
  and upgrade to the next 3_0 alpha, you should call

  pdbedit -i tdbsam -e ldapsam -g

  to transfer your group mapping database to LDAP.

  You certainly have to have all your groups as posixGroup
  objects in LDAP and adapt the LDAP schema before this
  call.

Volker
(This used to be commit 6d3faeaef6c77e389d39b6d4660ffea13e7f25f2)
2003-03-23 11:49:24 +00:00
Jelmer Vernooij
42879b0bf3 Move -V to -C to prevent conflict with -V for version
(This used to be commit 99de90adc98b8d5354c769dcd25cc1f34d3769e9)
2003-03-23 00:12:54 +00:00
Andrew Bartlett
32ae87014c Truncate the machinename manually, so as not to generate level 0 debugs for
an expected situation.

Andrew Bartlett
(This used to be commit a07fccb7ae169c0b5089e3f7d2c5d6465b2e4686)
2003-03-15 06:53:37 +00:00
Jelmer Vernooij
d21b15ff57 - Rename 'modules = ' to 'preload modules = '
- Add smb_probe_module()
- Add init_modules()
- Call these functions
(This used to be commit f8f21653225792c0001d183c6efe8b7d89a0785d)
2003-02-27 01:54:41 +00:00
Volker Lendecke
6b703fc40a Revert Flag testing upon abartlet's request ;-)
Volker
(This used to be commit e8f751fe84cbd20934116d5213f9bb1850aa9dfa)
2003-02-07 08:02:18 +00:00
Volker Lendecke
0326e054c3 Make account flags editable with pdbedit.
Volker
(This used to be commit 597c50550955c5bdc0c646d5b751d377b40f3485)
2003-02-06 16:53:58 +00:00
Volker Lendecke
173856a77d Fix memory leak. Thanks, Herb!
Volker
(This used to be commit 8915d59a5939b78a177dcd3e075a122e68e8c64a)
2003-01-07 20:54:31 +00:00
Volker Lendecke
7b4bf92955 Create a machine account correctly if the unix account exists.
With this, my test for W2kSP3 join after pdbedit -a -m works fine.

Volker
(This used to be commit c9d0c5254c7d4ddb343f405652c609a0128e60f9)
2003-01-07 10:38:33 +00:00
Andrew Bartlett
6d66fb308a 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
(This used to be commit 92a777d0eaa4fb3a1c7835816f93c6bdd456816d)
2003-01-02 09:07:17 +00:00
Jeremy Allison
561a6634b2 Revert by Simo's request. HEAD and 3.0 should be in sync for
this except for the modules load.
Jeremy.
(This used to be commit c7c3afbd0de8bd8797f91d350368a2419fcede0e)
2002-12-28 19:48:56 +00:00
Jeremy Allison
10c50fb580 Patch for coredump with missing arg from "Bradley W. Langhorst" <brad@langhorst.com>
Jeremy.
(This used to be commit 5914c38a54fcfdb007352b152dc2206708d59af6)
2002-12-28 01:23:34 +00:00
Jelmer Vernooij
aff957e7f7 Don't crash when there are no arguments specified
(This used to be commit 0855e5810aefd71c37031be31abe91229e2de8b3)
2002-11-13 14:45:11 +00:00
Jeremy Allison
250c980119 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit 82b8f749a36b42e22186297482aad2abb04fab8a)
2002-11-12 23:15:52 +00:00
Volker Lendecke
0f8e108686 I was somewhat annoyed by 'pdbedit -a vl' spitting an error message
at me :-)

Volker
(This used to be commit c4452ef22cf63c73bfb3574a55a4810af511ff20)
2002-10-21 19:25:04 +00:00
Andrew Bartlett
4ac9ccfde4 Nice *big* patch from metze.
The actual design change is relitivly small however:

It all goes back to jerry's 'BOOL store', added to many of the elements in a
SAM_ACCOUNT.  This ensured that smb.conf defaults did not get 'fixed' into
ldap.  This was a great win for admins, and this patch follows in the same way.

This patch extends the concept - we don't store values back into LDAP unless
they have been changed.  So if we read a value, but don't update it, or we
read a value, find it's not there and use a default, we will not update
ldap with that value.  This reduced clutter in our LDAP DB, and makes it
easier to change defaults later on.

Metze's particular problem was that when we 'write back' an unchanged value,
we would clear any muliple values in that feild.  Now he can still have his
mulitivalued 'uid' feild, without Samba changing it for *every* other
operation.

This also applies to many other attributes, and helps to eliminate a nasty
race condition.  (Time between get and set)

This patch is big, and needs more testing, but metze has tested usrmgr, and
I've fixed some pdbedit bugs, and tested domain joins, so it isn't compleatly
flawed ;-).

The same system will be introduced into the SAM code shortly, but this fixes
bugs that people were coming across in production uses of Samba 3.0/HEAD, hence
it's inclusion here.

Andrew Bartlett
(This used to be commit 7f237bde212eb188df84a5d8adb598a93fba8155)
2002-10-12 03:38:07 +00:00
Jelmer Vernooij
7ee8de012b Add more common options to popt_common - and start using
the ones for debuglevel and configuration file in pdbedit
(This used to be commit cb0d03a393d9009c3e16b9d05d88c171de9a9414)
2002-10-05 05:43:44 +00:00
Simo Sorce
9e70b39ab2 move all the passdb internal interface to NTSTATUS
only the interface has been fully moved to NTSTATUS
not all the plugins make full use of it, but have been all converted.

My testings passed completely, however a bit of more testing is welcome

Simo.
(This used to be commit 102a26e06591928a03b49cd312a65811ed46314f)
2002-09-26 09:50:53 +00:00
Volker Lendecke
30e51241ec pdbedit needs global_myname to be set in order to display the
user SIDs correctly.

Volker
(This used to be commit 287b7bda11100c42f2cdea36a20a81f6ea397f43)
2002-08-21 19:48:56 +00:00
Simo Sorce
10712f9a22 *** empty log message ***
(This used to be commit cb72eead70509eddaa051571f3eed3c46304b5f8)
2002-08-15 13:25:25 +00:00
Simo Sorce
dd93ff381d passwords where not checked (you cannot check if the same buffer differs from itself).
they where alo not clean after use!

Simo.
(This used to be commit 5a257096e9afdcd1dea863dff43952457a74a9f1)
2002-08-04 15:40:39 +00:00
Andrew Bartlett
5b5208a0b8 Add the ability to set account policies too.
Andrew Bartlett
(This used to be commit 2bf6edf78b64335bf10c10c893d6e8fa0fac708b)
2002-07-28 06:43:03 +00:00
Andrew Bartlett
24675d99e5 Make it possible to query account policy values from pdbedit (set to come soon).
Update account_pol.c to use just uint32, rather then uint32 for paramaters,
int32 for storage.  (The int32 functions didn't have seperate return/status
values, uint32 functions use a pointer-paramater).

Move the #define -> string from a swtich to a table, so we can look it up
both ways.

Andrew Bartlett
(This used to be commit c5b5e3d653f5c38a283d901a409be6603d5103f7)
2002-07-24 05:26:32 +00:00
Tim Potter
de4752d6e7 Fix up dir drive call.
(This used to be commit fe229cc126a4bfdce12882ac7eaa893e00cd506e)
2002-07-21 06:32:25 +00:00
Andrew Bartlett
afb7d1dc48 Another smattering of static and const
(This used to be commit 897cc4a610932e596f8a9807213166e380ef0203)
2002-07-21 03:26:10 +00:00
Andrew Bartlett
3d1b9bfb29 Show the account flags in the 'verbose' listing of pdbedit.
Andrew Bartlett
(This used to be commit b5ec92d7a2e5ba33b641267d2319d101d70a0d9a)
2002-07-14 08:38:09 +00:00
Andrew Bartlett
a26a4c6513 Kill useless cast
(This used to be commit e2f9dd8b65063a276569d9c33aaf06606003b85c)
2002-06-14 04:02:28 +00:00
Andrew Bartlett
0d7ac4bc2c Patch from ctrlsoft to make the pluggable passdb subsystem use an lp_list
rather than a string when configuring mulitple backends.

Also adjust some of the users of get_global_sam_sid() to cope with the fact
that it just might not exist (uninitialised, can't access secrets.tdb).

More places need conversion.

Add some const and remove silly casts.

Andrew Bartlett
(This used to be commit c264bf2ec93037d2a9927c00295fa60c88b7219d)
2002-06-14 02:58:03 +00:00
Andrew Bartlett
bad738e653 Latest patch from metze <metze@metzemix.de> to move most of samba across
to using SIDs instead of RIDs.

The new funciton sid_peek_check_rid() takes an 'expected domain sid' argument.

The idea here is to prevent mistakes where the SID is implict, but isn't
the same one that we have in the struct.

Andrew Bartlett
(This used to be commit 04f9a8ff4c7982f6597c0f6748f85d66d4784901)
2002-06-13 14:06:08 +00:00
Andrew Bartlett
98d5699d28 Some of the updates from ctrlsoft's 'Various' patch:
- convert net to popt
- convert status to popt
- adapt examples/pdb/ to multiple passdb system
- add dynamic debug class example to examples/pdb/

and some reformatting to better match the samba coding style.

Andrew Bartlett
(This used to be commit 2498bc69d4e5c38ec385f640489daa94c508c726)
2002-05-24 09:57:48 +00:00
Simo Sorce
2a02a76913 so here it is the code to introduce seriously debugggging classes.
this is a first step only passdb stuff has beein "classized".

 - so what can you do?
   set debug level to:  1 poasdb:10
   that will make all the code run at debug level 1 except the code in
   passdb/* files that will run at level 10
   TODO: fix the man page

 - also smbcontrol has this nice feature so smbcontrol smbd debug 3 passdb:5
   will set every smbd to have a default log level of 3 while passdb stuff
   will be at level 5

   and so no..

  minor cosmetic fix to pdbedit is there too
(This used to be commit be5c3b3f5781ddc002ffcc98df04ab024dcef4ca)
2002-05-18 15:09:21 +00:00
Andrew Bartlett
4f4f56d147 Allow -c to specify the location of the config file, and fix up some handling
of non-existant passdb cases.
(This used to be commit e56de32f5ce5cb301137497451b0ccd633f09f54)
2002-05-10 14:40:55 +00:00
Herb Lewis
19bacddd52 fix compile error
(This used to be commit c64a57a6106bfd766679ac89837881ed9592409b)
2002-04-26 16:16:14 +00:00
Andrew Bartlett
6d239fc97f Another patch from jelmer:
Doco for pdbedit and (ugly, but the best we could come up with) fix
for compiling pdbedit on some non-gcc compilers.

Andrew Bartlett
(This used to be commit 80adf1dbb56cf8bdbfbcc2c8c7b670c0a23c97f8)
2002-04-15 08:50:36 +00:00
Andrew Bartlett
a88ff199bc More updates from ctrlsoft. (Jelmer Vernooij <jelmer@nl.linux.org>)
Andrew Bartlett
(This used to be commit 012b3326c40ca0f8f4c7673310d73f695cc4f79b)
2002-04-13 10:32:09 +00:00
Andrew Bartlett
cc60b06983 This is the 'multiple pdb backends' patch from ctrlsoft, aka Jelmer Vernooij
<jelmer@nl.linux.org>.

This patch also includes major rework of pdbedit to use popt, and the addition
of -i paramter (allowing the user to specify which PDBs is being
operated on) and -e to export a pdb - useful for backup and testing etc.

Use of -i and -e gets us pdb2pdb functionality for transition between backends,
much like the sam2sam in TNG.

Andrew Bartlett
(This used to be commit c10def37f506d3f2bab442418ac08fdb62659b02)
2002-04-13 08:16:41 +00:00
Simo Sorce
050b80356e second step to gain free uid<->rid mapping
we still need to free gid<->rid mapping and few other stuff
(This used to be commit aa4b6f8181f34196a28951264dd8b631a5deef7f)
2002-03-19 13:57:53 +00:00
Simo Sorce
32334bc655 more verbose checking in talloc and util_pw
fixed tdbsam memory corruption (and segfault)
reducing calls to pdb_uid_to_user_rid and countrary to 0 to move to a non alghoritmic rid allocation with some passdb modules.
(This used to be commit 9836af7cd623357feaec07bc49cfb78f0aa01fc3)
2002-03-18 23:57:14 +00:00
Andrew Bartlett
f3ee505fce Initialise some SAM_ACCOUNT structs to NULL, and add some more error checking.
Andrew Bartlett
(This used to be commit f3f375dc6b7175d4dd4ce401815e5dfdd9747083)
2002-01-31 11:38:47 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-30 06:08:46 +00:00
Andrew Bartlett
26073c4aec Give pdbedit a -D paramater for setting the DEBUGLEVEL (makes debugging passdb
much saner :-).

Change to pdb_init_sam()/pdb_free_sam() loop rather than reset based due to
the talloc basis.

Andrew Bartlett
(This used to be commit e40a0a7f27950bd0484fe7d6b67dce45cd75d25c)
2002-01-27 03:00:56 +00:00
Andrew Bartlett
3e29c28a0b Try to get the compiler not to complain about assignments and truth values...
Andrew Bartlett
(This used to be commit 6650b21ceabefab037cfd3b135039914fb75e3a9)
2002-01-26 05:53:07 +00:00
Andrew Bartlett
158efc3aa2 getpwnam -> getpwnam_alloc.
idra has promised not to revert these this time :-)
(This used to be commit f556ad67e82518f5a024ffe9184ff9430ab5c541)
2002-01-23 12:59:24 +00:00
Andrew Bartlett
1a74d8d1f0 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.
(This used to be commit ff354c99c585068af6dc1ff35a1f109a806b326b)
2002-01-20 14:30:58 +00:00
Andrew Bartlett
dbee612f71 Change the passdb interface to use allocated strings.
These strings are allocated using talloc(), either using its own memory context
stored on the SAM_ACCOUNT or one supplied by the caller.

The pdb_init_sam() and pdb_free_sam() function have been modifed so that a call
to pdb_free_sam() will either clean up (remove hashes from memory) and destroy
the TALLOC_CTX or just clean up depending on who supplied it.

The pdb_init_sam and pdb_free_sam functions now also return an NTSTATUS, and I
have modified the 3 places that actually checked these returns.

The only nasty thing about this patch is the small measure needed to maintin
interface compatability - strings set to NULL are actually set to "".

This is becouse there are too many places in Samba that do strlen() on these
strings without checking if they are NULL pointers.

A supp patch will follow to set all strings to "" in pdb_default_sam().

Andrew Bartlett
(This used to be commit 144345b41d39a6f68d01f62b7aee64ca0d328085)
2002-01-15 01:02:13 +00:00
Herb Lewis
f1256e847e merge changes from 2.2 branch to prevent smb.conf from changing debug level
of commands when specified on command line.
(This used to be commit 39d6b31e14144a3ff4b992d4286b706147e58566)
2002-01-07 21:32:22 +00:00
Andrew Bartlett
a3f891dbd2 Actually enforce the passdb API.
Thou shalt not reference SAM_ACCOUNT members directly - always use
pdb_get/pdb_set.

This is achived by making the whole of SAM_ACCOUNT have a .private member,
where the real members live.  This caught a pile of examples, and these have
beeen fixed.

The pdb_get..() functions are 'const' (have been for some time) and this
required a few small changes to constify other functions.

I've also added some debugs to the pdb get and set, they can be removed if
requested.

I've rewritten the copy_id2x_to_sam_pass() functions to use the new passdb
interface, but I need the flags info to do it properly.

The pdb_free_sam() funciton now blanks out the LM and NT hashes, and as such
I have removed many extra 'samr_clear_sam_passwd(smbpass)' calls as a result.

Finally, any and all testing is always appriciated - but the basics seem to
work.

Andrew Bartlett
(This used to be commit d3dd28f6c443187b8d820d5a39c7c5b3be2fa95c)
2002-01-02 07:41:54 +00:00