1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-18 17:57:55 +03:00

703 Commits

Author SHA1 Message Date
Jim McDonough
77418256d3 Enable net rpc share and net rpc file commands (list subcommands only), and
autoselect for this subcommand when appropriate.
-
Andrew Bartlett
2498bc69d4 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
-
Andrew Bartlett
c205b18bd6 Remove the password length paramater from cli_full_connection - it really
didn't make any sense, and its was always just strlen(password) anyway.

This fixes it to be strlen(password)+1

Andrew Bartlett
-
Jim McDonough
033faaa8cb Allow initial password set on net ads user add. I need to do this on
rpc and rap too.  Anyone know what key I'm supposed to use to encrypt
it for the rap one?
-
Andrew Bartlett
fa67e4626b Given Jeremy's positive response, and a lack of one from tpot, I'll commit
this:

More code cleanup - this lot a bit more dodgy than the last:

The aim is to trim pwd_cache down to size.  Its overly complex, and a
pain to deal with.  With a header comment like this:

'obfusticaion is planned'

I think it deserved to die (at least partly).

This was being done to allow 'cli_establish_connection' to die - its
functionality has been replaced by cli_full_connection(), which does
not duplicate code everywhere for creating names etc.

This also removes the little 'init' fucntions for the various pipes,
becouse they were only used in one place, and even then it was dodgy.

(I've reworked smbcacls not to use anonymous connections any more, as
this will (should) fail with a 'restrict anonymous' PDC).

This allowed me to remove cli_pipe_util.c, which was calling
cli_establish_connection.

tpot:  I'm not sure what direction you were going with the client stuff,
and you may well have been wanting the init functions.  If thats the case,
give me a yell and I'll reimplement them against cli_full_connection.

Andrew Bartlett
-
Andrew Bartlett
9d8431b04f Add a bit more const, and kill of (finally!) sys_getpwnam and sys_getpwuid.
These might be reimplmented as simple pass-through functions, but all users
really should be doing 'getpwnam_alloc' or 'getpwuid_alloc' to ensure that
there are not shared static buffers.

I don't beleive we actually need a getpw*() cache inside samba - if we do
then I think we should look at our code design first.

(some of these changes are for platforms I don't have access to, but
they look sane)

Andrew Bartlett
-
Andrew Bartlett
84ea2a434b Keep the compiler happy -
Simo Sorce
be5c3b3f57 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
-
Andrew Bartlett
d9330f1044 Make smbpasswd at least slightly sane. This kills off some of the
silly global variables, and makes it come closer to a clean compile.

I'm still not convinced what was wrong with the previous code, at least
it didn't cause a gush of warnings...

In any case, we now don't need to spegetti code gotos etc.

This should really be redone with popt.

Andrew Bartlett
-
Andrew Bartlett
c28668068b A few things in this commit:
cleanup some of the code in net_rpc_join re const warnings and
fstrings.

Passdb:

Make the %u and %U substituions in passdb work.
This is done by declaring these paramters to be 'const' and doing
the substitution manually.  I'm told this is us going full circle,
but I can't really see a better way.

Finally these things actually seem to work properly...

Make the lanman code use the pdb's recorded values for homedir etc
rather than the values from lp_*()

Add code to set the plaintext password in the passdb, where it can
decide how to store/set it.  For use with a future 'ldap password
change' option, or somthing like that...

Add pdb_unix, so as to remove the 'not in passdb' special cases from the
local_lookup_*() code.  Quite small, as it uses the new 'struct passwd ->
SAM_ACCOUNT' code that is now in just one place.  (also used by pdb_smbpasswd)

Other:
Fix up the adding of [homes] at session setup time to actually pass
the right string, that is the unix homedir, not the UNC path.

Fix up [homes] so that for winbind users is picks the correct name.
(bad interactions with the default domain code previously)

Change the rpc_server/srv_lsa_nt.c code to match NT when for the
SATUS_NONE_MAPPED reply:  This was only being triggered on
no queries, now it is on the 'no mappings' (ie all mappings failed).
Checked against Win2k.

Policy Question:  Should SID -> unix_user.234/unix_group.364 be
considered a mapping or not?  Currently it isn't.

Andrew Bartlett
-
Andrew Bartlett
64aaec137e Make --with-ldapsam 'go away'. This is now a standard, stable, feature
and there is no real reason for it to depend on more than the abilty
to compile the code.
-
Richard Sharpe
c986a19cde Changes to allow head to translate NMB flags ... -
Gerald Carter
91f569a691 merges from SAMBA_2_2 -
Jim McDonough
5edccb51b9 Added ability to lookup ldap server, kdc, dc, and master browser. Please
review especially the methods for finding kdc and ldap server when they're
not specified.  This is a first attempt...
-
Jim McDonough
c2a6b0b126 Add auto-detect of time server. Uses master browser. -
Gerald Carter
b41cefb4c0 merge from SAMBA_2_2 -
Andrew Bartlett
e56de32f5c Allow -c to specify the location of the config file, and fix up some handling
of non-existant passdb cases.
-
Jim McDonough
95cc3fa4d3 Converged net group command. -
Jim McDonough
fde62de7a1 Add ads group add and delete, allowing converged net group command.
Also update some of the help info.
-
Jim McDonough
45ac4f4c29 Start of net rpc group command. List only right now. Add and delete have
not been implemented...is it worth the effort?
-
Jim McDonough
9de5e0dc73 Converged help on net group command. -
Gerald Carter
19b9b50d90 pidfile merge from SAMBA_2_2 (including --with-fhs) and a few other minor things; compiles and shouldnt break, but needs testing -
Herb Lewis
c64a57a610 fix compile error -
Andrew Tridgell
3e58a1ee83 fixed the fallback to a BDC for ADS connections -
Jean-François Micouleau
bfc3a25b77 we did not initialise global_myname and global_myworkgroup which lead to
duplicate entries in secrets.tdb and false SID generated.

took me *hours* to understand.

	J.F.
-
Andrew Bartlett
80adf1dbb5 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
-
Volker Lendecke
8973a01f5e Merge from 2_2.
Volker
-
Tim Potter
245468dbab The cli_lsa_lookup_{names,sids} functions were returning useless
information when one or more of the names/sids being queried were not
resolvable.  We now return a list the same length as the parameters passed
instead of an array of just the resolvable names/sids.
-
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
-
Tim Potter
6d9336f3b9 Fixed debugs. -
Andrew Bartlett
012b3326c4 More updates from ctrlsoft. (Jelmer Vernooij <jelmer@nl.linux.org>)
Andrew Bartlett
-
Andrew Bartlett
c10def37f5 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
-
Jim McDonough
b69f11170c Rename of ads_do_search_all2() to ads_do_search_all() and removal of
server sort controls.  Also put option externs in the net.h include.
-
Jim McDonough
4e3265c3c9 Add a few option externs for net_ads.c -
Andrew Tridgell
da794d3bbd fixed a return value for a help function -
Tim Potter
423985ed56 Spelling. -
Jim McDonough
e3a8138312 Use the new ads_do_search_all2 function. It provides sorted results. We now
also filter out users that end in '$', which gives us the same results as
the net rpc user and net rap user.
-
Jim McDonough
9daa5788c8 Lots more net consistency work:
- Added net_help.c for unified help when possible
- Added net rpc user listing, delete, info commands
- Unified net user command to autodetect ads/rpc/rap (try in that order)
- Added generic routine for detecting rpc (protocol > PROTOCOL_NT1)
- I'm sure I forgot something.
-
Jim McDonough
1280968000 Multiple changes:
- Get rid of improper "Invalid option: d (100)" message when setting
  debug from commandline.
- Eliminate got_pass global and only use opt_password.  This enables
  re-use of password that may have been enetered in failed ads connect.
- Auto-detect method for net user command
- use new net_ads_check rather than lp_security==ADS test on net join
- Get rid of annoying debug level 0's
-
Jim McDonough
84ab1042a6 Cleanups to make auto-detection of method on net user smoother. -
Jim McDonough
093297a27d More updates for auto-detecting server connection method. Added net_ads_check()
to make a connection (which stores the password in a global so it can be
used by rpc or rap function if ads fails) and close it to verify if ads
method should be used.
-
Jim McDonough
dd7c20e533 Add non-ads version of net_ads_help for build on non-ads machines. -
Jim McDonough
d7317ca8da Correct error string function call to ads_errstr() -
Jim McDonough
24c6bf4e8b Add ability to get specific net ads subcommand help. Not all have been
implemented yet...
-
Jim McDonough
f6eb7c0c7e Add net ads user subcommands: add delete info. Also make user listing format
consistent with rap version.
-
Herb Lewis
020d6fa2f7 reorder useage message a little. -L is not a root-only or local mode option. -
Herb Lewis
af4c3734b5 readd -c config file change from 2.2 - works with -L mode now as well. -
Andrew Tridgell
a5807d5784 reverted Herbs smbpasswd commit as it completely broke setting a
password
-
Herb Lewis
fc15b56d29 merge from 2.2 - allow -c option to specify smb.conf file -
Jim McDonough
4cf42c07ec Re-implemented net ads user and net ads group to use the new
ads_process_results function.  Also made sure net rap user and net ads
user display the same thing, to make auto-transport-detection smoother.
-