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

1148 Commits

Author SHA1 Message Date
Tim Potter
43b35364ff Cleaned up srvsvc constants a bit.
(This used to be commit ca61f68d5c)
2002-05-29 00:49:26 +00:00
Simo Sorce
a27a0e01e2 change: pdb_getsampwrid() ->pdb_getsampwsid()
passdb interface change, now the passdb modules will be asked for SID not for rid, the modules have been updated with a passthrough function that calls the old getsampwrid() functions.

srv_samr_nt.c functions that made use of the pdb_getsampwrid funcion has been updated to use the SID one.
(This used to be commit f5c6496c33)
2002-05-26 19:11:52 +00:00
Andrew Bartlett
20efe2fe6c Clean up a few unused functions, add a bit of static etc.
Importantly:

The removal of the silly 'delete user script' behaviour when secuity=domain.

I have left the name the same - as it still does the (previously documented,
but not in smb.conf(5)) sane behaviour of deleting users on request.

When we decide what to do with the 'add user' functionality, we might
rename it.

Andrew Bartlett
(This used to be commit cdcfe3671e)
2002-05-25 07:37:44 +00:00
Gerald Carter
73bc5782d4 merge from SAMBA_2_2
(This used to be commit f0226a1d83)
2002-05-24 19:17:27 +00:00
Gerald Carter
5b76d846f8 merge from SAMBA_2_2.
Tim, please check the prs_align() removed from sec_io_desc()
and make sure it doesn't break anything else.  I know it is
right for the printing needs and I have tested some other
general things like viewing acls on directories, but I would
feel more comfortable if you would have a look as well.


jerry
(This used to be commit 83f109c940)
2002-05-24 16:27:54 +00:00
Andrew Bartlett
b87eee9836 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
(This used to be commit 9d8431b04f)
2002-05-22 12:44:45 +00:00
Tim Potter
b8618865df Patch to only set SV_TYPE_PRINTQ_SERVER in default_server_announce if a
print share is exported.  Needs some more testing.
(This used to be commit 92b36482fd)
2002-05-19 12:06:45 +00:00
Andrew Bartlett
d4dac178df Passdb:
Kill off the silly code that attempts to do NT -> Unix username mapping.
This is done well before here, no need to repeat it.

Add some small fixes and extra debugs, trying to track down current build
farm failures.

pdb_unix:

When 'updating' a pdb_unix account, instead add it to the default passdb.
This means that you don't need to specify '-a' to smbpasswd any more when
messing with an existing unix user, the account is simply 'upgraded'.

The idea here is that these accounts are just as 'real' as any other, they
just don't have the extra attributes an smbpasswd file does.

I'm open for debate on the pdb_unix issue, and will remove it if given
good reason.  (without this, an attempt to add an account already in
pdb_unix to smbpasswd would fail, as it would fail to update pdb_unix).

rpc_server/srv_netlog_nt.c

Change a couple of things around, so as to show the client workstation etc.

WRONG_PASSWORD is certainly not the right default error.  Try ACCESS_DENIED
for now.

Andrew Bartlett
(This used to be commit d78b74b338)
2002-05-18 09:06:23 +00:00
Andrew Bartlett
58e1fe62cc 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
(This used to be commit c28668068b)
2002-05-18 05:52:52 +00:00
Andrew Bartlett
3fe27b7f9d A few more trusted domains updates from mimir.
I think we may still need to look at our server enumeration code, but
other than that, its much better in the tree than out.

Andrew Bartlett
(This used to be commit d57a1b4629)
2002-05-17 13:49:01 +00:00
Jeremy Allison
2586abb599 Fix the bug that refused to allow IPC$ connection to be idled if a pipe
was open - we now only refuse to allow IPC$ connection to be idled if a
handle is open on a pipe.
Jeremy.
(This used to be commit fc043110bc)
2002-05-10 01:15:36 +00:00
Jeremy Allison
059da8fb3b Merged in printing fixes... There were many missing !
Jeremy
(This used to be commit 32fa089ade)
2002-05-09 19:54:47 +00:00
Shirish Kalele
800185c33f Sync'ing SAMBA_2_2 with HEAD.
(This used to be commit d926cc9896)
2002-05-09 04:43:05 +00:00
Jeremy Allison
fd99accdb5 Fix my stupid compile bug in num_files_open.
Jeremy.
(This used to be commit 7c02db7c4f)
2002-04-23 18:34:52 +00:00
Jeremy Allison
569fa9b3dd Fix for a bug Jerry found with printing where a smbd connection may
be idled even with an open pipe.
Jeremy.
(This used to be commit 3a93c5daec)
2002-04-23 02:16:48 +00:00
Gerald Carter
dde9187728 merge from SAMBA_2_2
(This used to be commit 5e381abbbf)
2002-04-22 18:47:36 +00:00
Jeremy Allison
e9be6c4db4 Fix found by Li Shao @ HP - XP clients don't bother to set the devmode_ptr
in the SetPrinter() call - they send it in the devmode_ctr instead.
Jeremy.
(This used to be commit f988a1af03)
2002-04-18 01:48:45 +00:00
Tim Potter
1667a82106 Merge of print server permission handling fixes from HEAD.
Unit tests rock!
(This used to be commit bc673c4204)
2002-04-15 04:07:13 +00:00
Andrew Bartlett
07e6ff5fcf 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
(This used to be commit 0bdd94cb99)
2002-04-14 09:44:16 +00:00
Andrew Bartlett
4c0399915c Much better support for both non-algorithic RIDs (where the RID is stored in
the passdb) and RIDs not in the passdb, due to being NIS users etc.

The main fix here is to add become_root()/unbecome_root() at critical places.

This (finally) fixes the bug where you could not see local users's names
in a file's security properties as non-root.  Tested.

The similar bug in uid_to_sid is also fixed, but is not (yet) Tested.

Andrew Bartlett
(This used to be commit 79327a305e)
2002-04-11 23:43:40 +00:00
Jeremy Allison
8e2f3ec1d1 Correctly emulate NT in printer handle opening access rights.
Jeremy.
(This used to be commit 42ae2334f2)
2002-04-11 02:59:31 +00:00
Gerald Carter
d3fa6d5de6 s/werror_str/dos_errstr/g to fix compile
(This used to be commit d7c9b00253)
2002-04-11 02:13:56 +00:00
Gerald Carter
ed72efbd3b merge from 2.2
(This used to be commit 7db47c6647)
2002-04-11 02:08:36 +00:00
Gerald Carter
83ece07995 WERROR merge from SAMBA_2_2
(This used to be commit 32dc5dbbfb)
2002-04-11 01:50:18 +00:00
Jeremy Allison
4ad0ff29bf Added Shirish's client side caching policy change.
Jeremy.
(This used to be commit 16015c07ea)
2002-04-10 01:04:13 +00:00
Tim Potter
d0d61ba689 Fixed typo in debug statement.
(This used to be commit 49e429a97f)
2002-04-09 06:19:42 +00:00
Tim Potter
bcb842be57 Fixed some compiler warnings.
(This used to be commit be6f955107)
2002-04-09 05:59:46 +00:00
Andrew Bartlett
5cdc9e1685 Add a become_root()/unbecome_root() pair to allow acces to the passdb for
SID lookup.  This fixes a bug where SIDs (rather than names) are displayed in windows ACL lists
(This used to be commit e60c509813)
2002-04-09 04:59:34 +00:00
Jeremy Allison
ca43b0da79 Fix Gerry bug - MajorVersion should be 2 not 3.
Jeremy.
(This used to be commit b8b88e863e)
2002-04-05 22:41:39 +00:00
Tim Potter
510d470e1e Removed unused variable.
(This used to be commit 3e58e9dbab)
2002-03-31 06:00:37 +00:00
Jeremy Allison
846670fa0e Hack to share pipe handles between lsa and samr pipes as NT4.x usrmgr
insists on re-using an lsa handle opened on a pipe then closed - this
keeps them around so long as a samr pipe is also open.
Jeremy.
(This used to be commit f029bd348c)
2002-03-30 00:45:26 +00:00
Jeremy Allison
a5dc8cb591 Don't core dump listing thousands of users in usrmgr.
Jeremy.
(This used to be commit c6566fa5fa)
2002-03-29 21:50:21 +00:00
Jeremy Allison
9a8b5fdd37 Ensure we return a parseable value if invalid handle given.
Jeremy.
(This used to be commit f169f3f4df)
2002-03-29 20:37:56 +00:00
Gerald Carter
16c3f6c7d0 merge from SAMBA_2_2
(This used to be commit 606450f3cb)
2002-03-28 16:44:26 +00:00
Gerald Carter
c6cd39d4f7 merge from SAMBA_2_2
(This used to be commit fe099006bb)
2002-03-27 17:39:01 +00:00
Gerald Carter
737423f06e OpenPrinter() merge from 2.2
(This used to be commit 619397cc90)
2002-03-26 03:15:30 +00:00
Jeremy Allison
c90cd26e94 Fix the mp3 rename bug - also tidy up our open code and remove the special
cases for rename and unlink. Had to add desired_access into the share mode record.
Jeremy.
(This used to be commit 3b1b8ac435)
2002-03-23 02:57:44 +00:00
Tim Potter
ce236d1dbf Stomped on some header file version numbers that have crept back in.
(This used to be commit e66bdf1229)
2002-03-22 06:24:38 +00:00
Andrew Bartlett
93d25c293f Make sure to initaliase SAM_ACCOUNT pointers to NULL, otherwise pdb_init_sam()
fails.

Andrew Bartlett
(This used to be commit 56009ffbaa)
2002-03-21 03:53:44 +00:00
Gerald Carter
9529a4827c merge from APPLIANCE_HEAD
(This used to be commit 9282aa02d4)
2002-03-20 23:09:34 +00:00
Gerald Carter
826f3fb86b resetprinter merge from SAMBA_2_2
(This used to be commit 88d8897e21)
2002-03-20 03:37:27 +00:00
Tim Potter
0cd5dd67ce Merge from app-head:
> Don't put two copies of the server name in construct_printer_info_1()
(This used to be commit 47b1003bc5)
2002-03-20 00:24:35 +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 aa4b6f8181)
2002-03-19 13:57:53 +00:00
Jeremy Allison
72eb7dbd40 Merge in JohnR's page count fixes.
Jeremy.
(This used to be commit 2e3133fbe5)
2002-03-19 02:35:12 +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 9836af7cd6)
2002-03-18 23:57:14 +00:00
Tim Potter
a4cce223d6 Added dos_errstr() function. Not all errors in list yet.
(This used to be commit ddb5753e36)
2002-03-17 06:04:15 +00:00
Tim Potter
ab13654dc9 Renamed get_nt_error_msg() to nt_errstr().
(This used to be commit 1f007d3ed4)
2002-03-17 04:36:35 +00:00
Gerald Carter
65c007b583 syncing up printing code with SAMBA_2_2 (already done some merges
in the reverse).

  * add in new printer change notify code from SAMBA_2_2

  * add in se_map_standard() from 2.2 in _spoolss_open_printer_ex()

  * sync up the _print_queue_struct in smb.h (why did someone change the
    user/file names in fs_user/fs_file (or vice-versa) ? )

  * sync up some cli_spoolss_XXX functions
(This used to be commit 5760315c1d)
2002-03-15 08:14:10 +00:00
Tim Potter
8975d3ef70 Backed out enumprinters stuff - leave it for another day.
(This used to be commit d7efc5dd3d)
2002-03-14 01:48:59 +00:00
Tim Potter
92e59edc41 Merge of enumprinters vs getprinter naming patch from 2.2
(This used to be commit dfd51bc8d0)
2002-03-12 00:16:03 +00:00
Andrew Tridgell
664fa8e572 return the correct SID and domain name for the samr enum_domain and
lookup_domain calls. We were incorrectly returning the PDCs domain
nameand SID when we are a domain member. We should only do that when
we are the DC
(This used to be commit f56d689497)
2002-03-10 01:45:49 +00:00
Gerald Carter
8fa6b34e08 merge from 2.2
(This used to be commit 66eb969ade)
2002-03-08 22:07:18 +00:00
Gerald Carter
c3e813945c merge from 2.2
(This used to be commit 4960692e95)
2002-03-08 21:57:53 +00:00
Jeremy Allison
194e39b179 Turns out an Admin user shouldn't always have access on a handle.
Jeremy.
(This used to be commit d31d2dcd22)
2002-03-08 00:26:18 +00:00
Jeremy Allison
43ca6e3ef8 Merge in the change to do per-handle access checks on setdata/setform etc.
Should allow the buggy spoolss code on NT to work against us.
Jeremy.
(This used to be commit 2b3609a7dd)
2002-03-07 01:02:48 +00:00
Jeremy Allison
aa78524943 Fix the NTSTATUS -> WERROR for srvsvc pipe.
Jeremy.
(This used to be commit 2b85d3570c)
2002-03-05 02:12:00 +00:00
Tim Potter
308b222ffd Spelling fixes.
(This used to be commit a7fa0733ba)
2002-03-05 00:53:46 +00:00
Andrew Bartlett
309818b2a1 Some more fixes to enusre we execute the same code pathes as before this
change, just in different packets.
(This used to be commit ffa6c61f0b)
2002-03-03 04:25:29 +00:00
Andrew Bartlett
4941e64fe0 This patch allows NT4 domains to trust Samba.
Simply add an account (smbpasswd -a -i REMOTEDOM) and join with 'user manager'
on the remote domain.

The only issue (at the auth level at least) that prevented NT4 domains from
trusting Samba was that our netlogon code was based on what appear to be
invalid assumptions.

The netlogon code appears to assume that the 'client name' specified
corrosponds to an account of the same form.  This doesn't apply in trusted
domains, becouse the account is in the form domain$

Now that we use the supplied account name, and no longer make our access
control checks at the challange stage (where this info is unavailable) we
match the Win2k behaviour for invalid machine logins, and don't need to know
the names of PDCs/BDCs in trusting domains.

We also kill off the 'you logged on with a machine account, use your user
account' error message, becouse the previous NT_STATUS return was compleatly
bogus.  (The ACCESS_DENIED we now return matches Win2k, and gives snane error
messages on the client).

TNG doesn't use this and has to do magic password syncs between the various
accounts for domain/pdc/bdc.  This patch feels like the much more natural way
of doing things, and has been mildly tested.

Andrew Bartlett
(This used to be commit 542673fcd6)
2002-03-03 03:56:53 +00:00
Andrew Bartlett
a07e040c8c SECURITY FIXES:
Remove a stray 'unbecome_root()' in the ntdomain an auth failure case.

Only allow trust accounts to request a challange in srv_netlogon_nt.c.
Currently any user can be the 'machine' for the domain logon.  MERGE for 2.2.

Andrew Bartlett
(This used to be commit 0242d0e178)
2002-03-01 22:45:23 +00:00
Jeremy Allison
2ff9390245 Fixup the sending of printer change messages from job changes.
Jeremy.
(This used to be commit 28d4e7a3e2)
2002-02-26 03:12:09 +00:00
Tim Potter
2f8452fd49 Merge of printing performance fixes from appliance.
(This used to be commit c8dc59dfe8)
2002-02-25 23:18:05 +00:00
Gerald Carter
5dbe33e3ee merge from 2.2
(This used to be commit 505119f0a7)
2002-02-21 17:30:58 +00:00
Gerald Carter
84b18178a9 merge from 2.2
(This used to be commit 63ab947fd9)
2002-02-21 00:55:01 +00:00
Gerald Carter
cef4f9215f merge from 2.2
(This used to be commit 25fb4a8d11)
2002-02-20 23:36:23 +00:00
Gerald Carter
83bc6cdd55 merge from APPLIANCE_HEAD
(This used to be commit 696d439515)
2002-02-15 18:59:34 +00:00
Gerald Carter
1f6df6c9ce merge from 2.2
(This used to be commit e18a7c2647)
2002-02-12 22:31:18 +00:00
Gerald Carter
51e205c92a merge from 2.2
(This used to be commit 09fc979172)
2002-02-12 19:16:14 +00:00
Jeremy Allison
03cfb31ad9 Bring printing in HEAD inline with 2.2.x and app-head.
Jeremy.
(This used to be commit 771ef92fc6)
2002-02-09 04:10:24 +00:00
Gerald Carter
7dbaaa0964 merge from APPLIANCE_HEAD
(This used to be commit e734c1971d)
2002-02-08 21:51:40 +00:00
Tim Potter
8fff9a4b9e Added administrator access check for server side add, delete and setform
rpcs.  The only one I have been able to verify is addform - can't get the
client side routines working properly yet.  )-:
(This used to be commit 3cd97d65de)
2002-01-31 11:44:00 +00:00
Andrew Tridgell
b48750fba6 this fixes the problem of not being able to add a SD to a file on a
non-domain Samba server from a NT4 client.

Note that this exactly reverses a change by Jeremy on the 18th of
December 2001, reverting the code back to what JF originally wrote. I
have looked carefully with a sniffer and JFs original NULL sid is
correct (ie. it matches what NT4 does) and also fixes the problem.

Sending a blank sid (which is what jeremy's patch did) causes NT4 to
give a classic "parameter is incorrect error" and prevents the
addition of new ACLs.
(This used to be commit 9930cf9733)
2002-01-31 09:37:26 +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 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Gerald Carter
485b4ff5ec merge from APPLIANCE_HEAD
(This used to be commit e3b87ffc8c)
2002-01-26 22:27:12 +00:00
Andrew Bartlett
abd7df24dc Add the become_root()/unbecome_root() wrapper around the lookup_name() call,
and its new args.
(This used to be commit e7b3d64f60)
2002-01-26 10:03:25 +00:00
Andrew Bartlett
965f440983 Move the lsa code across to the changed args for lookup_name, and surround it
in become_root()/unbecome_root().

Also only allocate the memory the client reqests - and don't allow the client
to trigger an SMB_ASSERT if they ask for 'more'.

Up the maximum number of sids allowed, and note that this is an arbiary guess,
and can be raised without consequence.

Andrew Bartlett
(This used to be commit 6e7667125d)
2002-01-26 10:02:23 +00:00
Andrew Bartlett
29ad4a76cd Try to move towards slightly sane linking for Samba by removing some pdb_...()
calls from rpc_parse/parse_net.c - instead these values are passed as a
paramater.

Unfortunetly some there is still some samr work to be done before this is
actually useful.

Andrew Bartlett
(This used to be commit 4fc9e16ad7)
2002-01-26 05:52:20 +00:00
Jeremy Allison
5b0dca4998 Fixed ADDPRINTEREX to take a devmode and a security descriptor...
Jeremy.
(This used to be commit 27f65b3aad)
2002-01-26 01:20:38 +00:00
Jeremy Allison
b3e5d34171 Make systemtime work for spooling on bigendian systems. Fix from
Benjamin (Bj) Kuit bj@it.uts.edu.au.
Jeremy.
(This used to be commit 5f4de275a3)
2002-01-25 18:27:40 +00:00
Jeremy Allison
565b9cc157 Return correct RPC fault PDU on bad handle incoming.
Jeremy.
(This used to be commit 0db93d8752)
2002-01-25 05:28:37 +00:00
Tim Potter
f0fe8ff18a Sync up startpageprinter with appliance.
(This used to be commit 6025ab201a)
2002-01-23 11:47:19 +00:00
Jeremy Allison
1182b7cd8c Merge of fixes from 2.2.
Jeremy.
(This used to be commit 6406a42d01)
2002-01-22 19:45:17 +00:00
Gerald Carter
e24937d9a2 merge from appliance_head
(This used to be commit 38d2d26af9)
2002-01-22 18:19:00 +00:00
Andrew Bartlett
5b5b6771a8 Fix the negation of the extra parinoia check on machine password changes.
I *love* automated testing - this one got picked up by the build farm.

Andew Bartlett
(This used to be commit b19296172a)
2002-01-20 23:05:23 +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 ff354c99c5)
2002-01-20 14:30:58 +00:00
Andrew Bartlett
32101155d4 Kill off another ugly wart from the side of the passdb subsystem.
This time its the pdb_getsampwuid() function - which was only being used by the
SAMR rpc subsystem to gain a 'user session key'.  This 'user session key' is
actually generated at login time, and the other changes here simply move that
data around.

This also means that (when I check some details) we will be able to use the
user session key, even when we are not actually the DC, becouse its one of the
components of the info3 struct returned on logon.

Andrew Bartlett
(This used to be commit 799ac01fe0)
2002-01-20 13:26:31 +00:00
Andrew Bartlett
bb6af711b8 This is the current patch from Luke Leighton <lckl@samba-tng.org> to add a
degree of seperation betwen reading/writing the raw NamedPipe SMB packets
and the matching operations inside smbd's RPC components.

This patch is designed for no change in behaviour, and my tests hold that to be
true.  This patch does however allow for the future loadable modules interface
to specify function pointers in replacement of the fixed state.

The pipes_struct has been split into two peices, with smb_np_struct taking the
information that should be generic to where the data ends up.

Some other minor changes are made: we get another small helper function in
util_sock.c and some of the original code has better failure debugs and
variable use. (As per on-list comments).

Andrew Bartlett
(This used to be commit 8ef13cabdd)
2002-01-20 02:40:05 +00:00
Andrew Bartlett
93a8358910 This patch makes the 'winbind use default domain' code interact better with
smbd, and also makes it much cleaner inside winbindd.

It is mostly my code, with a few changes and testing performed by Alexander
Bokovoy <a.bokovoy@sam-solutions.net>.  ab has tested it in security=domain and
security=ads, but more testing is always appricatiated.

The idea is that we no longer cart around a 'domain\user' string, we keep them
seperate until the last moment - when we push that string into a pwent on onto
the socket.

This removes the need to be constantly parsing that string - the domain prefix
is almost always already provided, (only a couple of functions actually changed
arguments in all this).

Some consequential changes to the RPC client code, to stop it concatonating the
two strings (it now passes them both back as params).

I havn't changed the cache code, however the usernames will no longer have a
double domain prefix in the key string.  The actual structures are unchanged
 - but the meaning of 'username' in the 'rid' will have changed.  (The cache is
invalidated at startup, so on-disk formats are not an issue here).

Andrew Bartlett
(This used to be commit e870f0e727)
2002-01-20 01:24:59 +00:00
Andrew Bartlett
c311d24ce3 A nice *big* change to the fundemental way we do things.
Samba (ab)uses the returns from getpwnam() a lot - in particular it keeps
them around for a long time - often past the next call...

This adds a getpwnam_alloc and a getpwuid_alloc to the collection.

These function as expected, returning a malloced structure that can be
free()ed with passwd_free(&passwd).

This patch also cuts down on the number of calls to getpwnam - mostly by
taking advantage of the fact that the passdb interface is already
case-insensiteve.

With this patch most of the recursive cases have been removed (that I know
of) and the problems are reduced further by not using the sys_ interface
in the new code.  This means that pointers to the cache won't be affected.
(This is a tempoary HACK, I intend to kill the password cache entirly).

The only change I'm a little worried about is the change to
rpc_server/srv_samr_nt.c for private groups.  In this case we are getting
groups from the new group mapping DB.  Do we still need to check for private
groups?  I've toned down the check to a case sensitve match with the new code,
but we might be able to kill it entirly.

I've also added a make_modifyable_passwd() function, that copies a passwd
struct into the form that the old sys_getpw* code provided.  As far as I can
tell this is only actually used in the pass_check.c crazies, where I moved
the final 'special case' for shadow passwords (out of _Get_Pwnam()).

The matching case for getpwent() is dealt with already, in lib/util_getent.c

Also included in here is a small change to register the [homes] share at vuid
creation rather than just in one varient of the session setup.  (This picks
up the SPNEGO cases).  The home directory is now stored on the vuid, and I
am hoping this might provide a saner way to do %H substitions.

TODO:  Kill off remaining Get_Pwnam_Modify calls (they are not needed), change
the remaining sys_getpwnam() callers to use getpwnam_alloc() and move
Get_Pwnam to return an allocated struct.

Andrew Bartlett
(This used to be commit 1d86c7f942)
2002-01-17 08:45:58 +00:00
Jeremy Allison
5fa0da0ba5 Missing assign fix from Bernt Nilsson bkn@ida.liu.se.
Jeremy.
(This used to be commit adf24a90e8)
2002-01-15 16:20:25 +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 144345b41d)
2002-01-15 01:02:13 +00:00
Jeremy Allison
c9d350a736 Added PRINTER_INFO_4/PRINTER_INFO_5, we're seeing level 5 requested on the wire... so.
Jeremy.
(This used to be commit b63b762978)
2002-01-12 02:37:54 +00:00
Jeremy Allison
1d40138232 Round and round we go....
Jeremy.
(This used to be commit 2603ab3c68)
2002-01-11 23:33:12 +00:00
Martin Pool
f5bc0e92a6 Better explanation message for dmalloc.
Also more insertion of parenthesis to handle struct members called
'free'.

You can now get useful dmalloc output, as long as it is compatible
with your C library.  On RH7.1 it looks like you have to rebuild
dmalloc to allow free(0) by default, because something in libcrypt
does that. (sigh)
(This used to be commit 391cbb6901)
2002-01-09 07:52:51 +00:00
Jeremy Allison
a842a3d458 When re-writing tdb version numbers as little endian int32, we must
change the version number also.
Jeremy.
(This used to be commit 3dec9cf99a)
2002-01-09 05:24:07 +00:00
Jeremy Allison
91536cc901 Fixed all uses of tdb_fetch/store/_int to use explicit int32 little endian
in tdb's. All except winbindd_idmap.... Hmmmmmm.
Jeremy.
(This used to be commit ec71f1732b)
2002-01-09 04:13:30 +00:00
Jeremy Allison
4702494dce Added get_called_name() function, which replaces global_myname in printing
code (one less global, hurrah !) - to allow NetBIOS aliasing to be used
with point and print.
Jeremy.
(This used to be commit 10d72f0b01)
2002-01-08 00:46:56 +00:00
Andrew Bartlett
2e28f8ff0e I've decided to move the auth code around a bit more...
The auth_authsupplied_info typedef is now just a plain struct - auth_context,
but it has been modified to contain the function pointers to the rest
of the auth subsystem's components.

(Who needs non-static functions anyway?)

In working all this mess out, I fixed a number of memory leaks and moved the
entire auth subsystem over to talloc().

Note that the TALLOC_CTX attached to the auth_context can be rather long-lived,
it is provided for things that are intended to live as long.  (The
global_negprot_auth_context lasts the whole life of the smbd).

I've also adjusted a few things in auth_domain.c, mainly passing the domain as
a paramater to a few functions instead of looking up lp_workgroup().  I'm
hopign to make this entire thing a bit more trusted domains (as PDC) freindly
in the near future.

Other than that, I moved a bit of the code around, hence the rather messy diff.

Andrew Bartlett
(This used to be commit 12f5515f55)
2002-01-05 04:55:41 +00:00
Jeremy Allison
eca99f5c22 Fixed nasty cast of tdb_delete in traversals.
Jeremy.
(This used to be commit a0cdec3acc)
2002-01-03 22:48:48 +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 d3dd28f6c4)
2002-01-02 07:41:54 +00:00
Jeremy Allison
71f982c9f2 Make user enumeration work for w2k and win9x.
This means different return sizes depending on client bugs. This sucks :-(.
Jeremy.
(This used to be commit f6592628eb)
2002-01-02 07:27:33 +00:00
Andrew Bartlett
6694109c04 Named constants are always much better than magic numbers...
(I defined the constants when I put in 'net rpc shutdown')

Andrew Bartlett
(This used to be commit 4d90cc1d99)
2002-01-01 00:18:47 +00:00
Jeremy Allison
38851c64d9 last_enum not used.
Jeremy.
(This used to be commit efbec935fe)
2001-12-31 23:24:48 +00:00
Jeremy Allison
120607cab1 Fixed enumeration of a large (<1500) users from a Samba PDC to a W2k
member server. Firstly, use the same max enumeration size (0x400) as W2K
uses, otherwise W2K won't ask for any more. Secondly, if a enumeration
request with a non-zero offset comes in on a handle that hasn't started
an enumeration, don't bitch about it (return NT_STATUS_UNSUCCESSFUL),
just load the db on that handle and return at that offset.
Jeremy.
(This used to be commit 0b7da4a50e)
2001-12-31 22:37:51 +00:00
Andrew Tridgell
eb4e101153 - portablitity fixes for cc -64 on irix
- fixed gid* bug in rpc_server
(This used to be commit 48aa90c48c)
2001-12-31 13:46:26 +00:00
Gerald Carter
04aff47c71 moving SAM_ACCOUNT to include a bit field for initialized
members (such as uid and gid).  This way we will be able to
keep ourselves from writing out default smb.conf settings when
the admin doesn't want to,  That part is not done yet.

Tested compiles with ldap/tdb/smbpasswd.  Tested connection with smbpasswd
backend.

oh...and smbpasswd doesn'y automatically expire accounts after 21 days
from the last password change either now.  Just ifdef'd out that code
in build_sam_account().

Will merge updates into 2.2 as they are necessary.




jerry
(This used to be commit f0d4379115)
2001-12-27 06:38:04 +00:00
Jeremy Allison
7478d27e70 Removed unused variables.
Jeremy.
(This used to be commit 621fa227bd)
2001-12-21 23:28:04 +00:00
Jeremy Allison
e1e64a26fa The jf_get_sampasswd_entries() is not used anymore.
Jeremy.
(This used to be commit bf18160997)
2001-12-21 23:25:32 +00:00
Jean-François Micouleau
1acf4f67a2 added a copyright notice.
J.F.
(This used to be commit 87928c4d91)
2001-12-21 22:54:53 +00:00
Jean-François Micouleau
0e550b2c11 doesn't keep track of the struct's size we enumerate. W2K doesn't
calculate them and always reply a size of 32 bytes whereas NT4 did the
maths. Anyway, it looks like the clients don't complain.

in query_dom_info() at level 2, return the real number of users and
groups. That's the fix to the W95/98 userlist bug !

as W95/98 does a query_dom_info(2) followed by a query_disp_info(4) on
the SAME context handle (err we call it an lsa policy handle ! plain
wrong name), I was tempted to keep the snapshoot in memory, to prevent
2 full user db enumerations in a row and just have one shared. But if some
client does the 2 calls on two different handles, we would have 2 copies
in memory not free'ed before the samr_close().

We still have too many fixed constant and too many magic values in that
code. And btw, I really hates how the sequence number is generated !

        J.F.
(This used to be commit c0178e1a03)
2001-12-21 22:34:49 +00:00
Jeremy Allison
5829284a07 Fixup some DEBUG statements (0 -> 10).
Jeremy.
(This used to be commit bf65331cb4)
2001-12-21 22:27:20 +00:00
Jeremy Allison
fff44cc700 Use pdb_free_sam() to free a SAM_ACCOUNT struct, not safe_free(). There
are pointers withing the SAM_ACCOUNT struct that also need freeing.
Jeremy.
(This used to be commit a7d099cc75)
2001-12-21 19:34:32 +00:00
Jean-François Micouleau
595dd01507 re-done all of samr_query_disp_info()
instead of enumerating the whole user db or group db every time, we store
a in memory copy linked to the handle.

that's much faster for large enumeration where the db can't fit in a
single rpc packet. And as it's a copy, it's constant between enumeration.

still some stuff to clean. But now I can fix the W95 userlist bug, as I've
finally found it.

	J.F.
(This used to be commit 3ab4521536)
2001-12-21 13:36:14 +00:00
Martin Pool
bf65820af2 Add an output parameter to message_send_all that says how many
messages were sent, so you know how many replies to expect.

Const and doc religion.
(This used to be commit 22e510ea0d)
2001-12-21 00:37:49 +00:00
Jean-François Micouleau
ea274ac97f added info level 1 to samr_query_alias()
(This used to be commit 589aa4fe22)
2001-12-19 00:15:29 +00:00
Jeremy Allison
dccc1ed3f8 Fixup JF's weird SID return :-).
Jeremy
(This used to be commit 7b8fb8d85c)
2001-12-18 19:44:14 +00:00
Tim Potter
140f1ccf1f Fixed bad args to debug statements.
(This used to be commit 5e0f0716ca)
2001-12-18 05:00:07 +00:00
Jeremy Allison
5d3b81dede I'm pretty sure we need to return our netbios name for LSA_QUERY_INFO
level 5 when we're a standalone server. This makes the security dialogs
return correct info. JF - please check !
Jeremy.
(This used to be commit dd13daf52b)
2001-12-18 02:17:46 +00:00
Jean-François Micouleau
e611111732 in lsa_query_info at level 5 in member mode, we must reply our machine
name and not our domain name.

I thought it has been already fixed !

	J.F.
(This used to be commit 1fbb01868b)
2001-12-18 00:32:45 +00:00
Jean-François Micouleau
6e76486505 there is no unknown field in LSA_SEC_QOS
some cleanup of the lsa_open_policy and lsa_open_policy2 parser. the
length fields are not correct but that's what NT send. We don't anymore
underflow or overflow the decoding.

added the domain admins group to the default SD.

we are now checking the desired access flag in the lsa_open_policy_X()
calls and in most functions also.

        J.F.
(This used to be commit a217c4e4ff)
2001-12-17 23:03:23 +00:00
Gerald Carter
abcd1cad3a ChangeID fixe from APPLIANCE_HEAD
(This used to be commit 096d06a961)
2001-12-14 20:38:04 +00:00
Jean-François Micouleau
689144c631 add lsa_query_secobj server code. level 4 is the ACL, level 1 is the
owner. that's basic stuff.

got the POLICY_ define from TNG but they are also in an include file in
the NT SDK.

	J.F.
(This used to be commit 84289a9bf4)
2001-12-14 17:31:48 +00:00
Tim Potter
14d7f43590 FALSE -> False
(This used to be commit dbdbf7cd07)
2001-12-14 04:43:31 +00:00
Gerald Carter
4ad930ad5e merge from appliance_head
(This used to be commit 423554fd71)
2001-12-13 16:35:43 +00:00
Jean-François Micouleau
0ff1a9568b added info level 3 to samrgetgroupinfo. I don't know what the value is.
It's just to keep usermanager happy ;-)

clean up a bit samr_query_aliasinfo to return the group description

added: samr_del_aliasmem, samr_del_groupmem and samr_del_domuser

with the correct scripts, you can now entirely manage the users from
usermanager ! Closer to full PDC every day ;-)

        J.F.
(This used to be commit 0a727afc66)
2001-12-10 15:03:16 +00:00
Tim Potter
4f53486d78 Added client and server code for the GetPrintProcessorDirectory SPOOLSS
rpc.  This was supposed to fix a printer driver download bug but it didn't
but it seemed a shame to trash all this code so I'm commiting it #ifdef'ed
out in case someone needs it one day.
(This used to be commit bef4365647)
2001-12-10 05:03:17 +00:00
Jean-François Micouleau
6490fbce6b small comment I don't want to loose.
J.F.
(This used to be commit a0b5ae5822)
2001-12-08 23:57:35 +00:00
Jean-François Micouleau
139c46eced Fix domain logon that I broke 3 days ago.
And it's in sync with the docs, %U is really replaced by the name the user
asked. Whereas in 2.2 that's false, %U is replaced by the name the user
was mapped to.

	J.F.
(This used to be commit 39f2b23347)
2001-12-08 23:56:58 +00:00
Jean-François Micouleau
e0066d2dd4 again an intrusive patch:
- removed the ugly as hell sam_logon_in_ssb variable, I changed a bit the
definition of standard_sub_basic() to cope with that.

- removed the smb.conf: 'domain admin group' and 'domain guest group'
parameters ! We're not playing anymore with the user's group RIDs !

- in get_domain_user_groups(), if the user's gid is a group, put it first
in the group RID list.

I just have to write an HOWTO now ;-)

        J.F.
(This used to be commit fef52c4b96)
2001-12-06 13:09:15 +00:00
Jean-François Micouleau
7b53a92f59 added samr_queryuseralias(). instead of returning BUILTIN_ALIAS_RID_USERS,
now return the alias correctly.

time to look at the netlogon case.

	J.F.
(This used to be commit 72ee179108)
2001-12-05 15:41:44 +00:00
Andrew Tridgell
95a21460b7 fixed a return value
(This used to be commit 56bdb152d8)
2001-12-05 11:32:25 +00:00
Jeremy Allison
105f8a1a0f Use print_queue_length() by preference if we don't need a queue
as it doesn't do a traversal.
Jeremy.
(This used to be commit 4bf4ee3f14)
2001-12-05 02:11:03 +00:00
Jeremy Allison
5472638730 Improved efficiency of enumerating print queue's under a particular
extreme condition...
Jeremy.
(This used to be commit 425bb0f405)
2001-12-05 00:54:33 +00:00
Jean-François Micouleau
922eb763d7 added a boolean to the group mapping functions to specify if we need or
not the privileges. Usually we don't need them, so the memory is free
early.

lib/util_sid.c: added some helper functions to check an SID.

passdb/passdb.c: renamed local_lookup_rid() to local_lookup_sid() and pass
an RID all the way. If the group doesn't exist on the domain SID,
don't return a faked one as it can collide with a builtin one. Some rpc
structures have been badly designed, they return only rids and force the
client to do subsequent lsa_lookup_sid() on the domain sid and the builtin
sid !

rpc_server/srv_util.c: wrote a new version of get_domain_user_groups().
Only the samr code uses it atm. It uses the group mapping code instead of
a bloody hard coded crap. The netlogon code will use it too, but I have to
do some test first.

	J.F.
(This used to be commit 6c87e96149)
2001-12-04 21:53:47 +00:00
Jean-François Micouleau
cdf9b42754 added a tdb to store the account policy informations.
You can change them with either usermanager->policies->account
or from a command prompt on NT/W2K: net accounts /domain

we can add a rpc accounts to the net command. As the net_rpc.c is still
empty, I did not start. How should I add command to it ? Should I take the
rpcclient/cmd_xxx functions and call them from there ?

alse changed the SAM_UNK_INFO_3 parser, it's an NTTIME. This one is more
for jeremy ;-)

        J.F.
(This used to be commit bc28a8eebd)
2001-12-03 17:14:23 +00:00
Jean-François Micouleau
633ee99afa added queryuseraliases to rpcclient
and some comments to the samr server code, to explain what we should
return here.

	J.F.
(This used to be commit 06cb20a46d)
2001-12-02 01:45:50 +00:00
Jean-François Micouleau
043dfe985c there was a bug in samr_lookup_names (my fault)
and added comments and some debugs.

	J.F.
(This used to be commit 114eba496f)
2001-12-02 00:06:10 +00:00
Gerald Carter
9cc8cb5134 merge from APPLIANCE_HEAD
(This used to be commit f8b18b2594)
2001-11-30 20:33:35 +00:00
Jeremy Allison
605248abd9 Check error returns.
Jeremy.
(This used to be commit fc8638e89e)
2001-11-30 03:45:21 +00:00
Jeremy Allison
445ab75ec3 Gerald's fix.
Jeremy
(This used to be commit b0c1fcfc8b)
2001-11-30 03:38:59 +00:00
Tim Potter
6d9adfe73c Renamed sid field in SEC_ACE to trustee to be more in line with MS's
definitions.
(This used to be commit 9712d3f15a)
2001-11-30 01:04:15 +00:00
Jean-François Micouleau
fac01bda8b Changed again how the privilege list is handled in the group mapping code.
This time it's a PRIVILEGE_SET struct instead of a simple uint32 array. It
makes much more sense. Also added a uint32 systemaccount to the GROUP_MAP
struct as some privilege showing in USRMGR.EXE are not real privs but a
bitmask flag. I guess it's an heritage from NT 3.0 ! I could setup an NT
3.1 box to verify, but I'm too lazy (yes I still have my CDs).

Added 3 more LSA calls: SetSystemAccount, AddPrivileges and
RemovePrivileges, we can manage all this privilege from UserManager.

Time to change the NT_USER_TOKEN struct and add checks in all the rpc
functions. Fun, fun, fun.

        J.F.
(This used to be commit 3f0a9ef2b8)
2001-11-29 16:05:05 +00:00
Gerald Carter
bd8e916cb5 merge from APPLIANCE_HEAD
(This used to be commit c60aa6c06f)
2001-11-28 21:51:11 +00:00
Jean-François Micouleau
e158c4123d added samr_set_domain_info and samr_unknown_2E.
We now get the full account policy window in usermanager, and the
framework to store all those values. I plan to add a TDB file to store
them.

oh, and found that the last value in a sam_unknown_info_12_inf struct is
an uint16 and not a uint32.

andrewb: you hardcoded the MAX_PASSWORD_AGE to 21 days. We can now turn it
to a value setable in usermanager.

        J.F.
(This used to be commit 99471d2569)
2001-11-28 00:06:00 +00:00
Jeremy Allison
d919314390 Added PRINTER_ALREADY_EXISTS error check from Gerry.
Jeremy
(This used to be commit c7f1d3d6f7)
2001-11-27 20:01:23 +00:00
Tim Potter
178f6a64b2 challange -> challenge
(This used to be commit d6318add27)
2001-11-26 04:05:28 +00:00
Andrew Bartlett
97346ea795 Unless the error is exactly NT_STATUS_OK, we might not have a server info, so
we need to bail here.
(This used to be commit ea0331354e)
2001-11-25 02:30:30 +00:00
Andrew Bartlett
d0a2faf78d This is another rather major change to the samba authenticaion
subystem.

The particular aim is to modularized the interface - so that we
can have arbitrary password back-ends.

This code adds one such back-end, a 'winbind' module to authenticate
against the winbind_auth_crap functionality.  While fully-functional
this code is mainly useful as a demonstration, because we don't get
back the info3 as we would for direct ntdomain authentication.

This commit introduced the new 'auth methods' parameter, in the
spirit of the 'auth order' discussed on the lists.  It is renamed
because not all the methods may be consulted, even if previous
methods fail - they may not have a suitable challenge for example.

Also, we have a 'local' authentication method, for old-style
'unix if plaintext, sam if encrypted' authentication and a
'guest' module to handle guest logins in a single place.

While this current design is not ideal, I feel that it does
provide a better infrastructure than the current design, and can
be built upon.

The following parameters have changed:
 - use rhosts =

  This has been replaced by the 'rhosts' authentication method,
 and can be specified like 'auth methods = guest rhosts'

 - hosts equiv =

  This needs both this parameter and an 'auth methods' entry
  to be effective.  (auth methods = guest hostsequiv ....)

 - plaintext to smbpasswd =

  This is replaced by specifying 'sam' rather than 'local'
  in the auth methods.

The security = parameter is unchanged, and now provides defaults
for the 'auth methods' parameter.

The available auth methods are:

guest
rhosts
hostsequiv
sam (passdb direct hash access)
unix (PAM, crypt() etc)
local (the combination of the above, based on encryption)
smbserver (old security=server)
ntdomain (old security=domain)
winbind (use winbind to cache DC connections)


Assistance in testing, or the production of new and interesting
authentication modules is always appreciated.

Andrew Bartlett
(This used to be commit 8d31eae52a)
2001-11-24 12:12:38 +00:00
Andrew Bartlett
af1a0238aa Kill off that crazy copy_sam_passwd(). You simply can't do that if the
structre contains pointers (well not if you intend of free those pointers
at some stage)

There is no reason (given the new passdb interface) that you can't modify a
SAM_ACCOUNT in any case.

Andrew Bartlett
(This used to be commit e8e73f7f0f)
2001-11-24 00:36:37 +00:00
Jeremy Allison
b9a82592f6 Sorry. I broke the build, missed on open_directory call.
Jeremy.
(This used to be commit fe288b14cc)
2001-11-23 19:07:35 +00:00
Jean-François Micouleau
7e1dce1de8 return NO_MORE_ENTRIES in lsa_enum_trust_dom. UserManager is happier :-)
J.F.
(This used to be commit 75ee50bbef)
2001-11-23 15:17:30 +00:00
Jean-François Micouleau
2527f5ef52 Changed how the privileges are stored in the group mapping code. It's now
an array of uint32. That's not perfect but that's better.

Added more privileges too.

Changed the local_lookup_rid/name functions in passdb.c to check if the
group is mapped. Makes the LSA rpc calls return correct groups

Corrected the return code in the LSA server code enum_sids.

Only enumerate well known aliases if they are mapped to real unix groups.
Won't confuse user seeing groups not available.

Added a short/long view to smbgroupedit.

now decoding rpc calls to add/remove privileges to sid.

        J.F.
(This used to be commit f29774e589)
2001-11-23 15:11:22 +00:00
Jean-François Micouleau
fbfd27a495 added lsa_enum_sids to rpcclient
fixed lsa_enum_rpivs server code. This time it works as W2K.
fixed smbgroupedit to compile and work.

	J.F.
(This used to be commit 646651018a)
2001-11-22 23:50:16 +00:00
Jean-François Micouleau
b09d9e3dc5 fixing enum_privs and get_dispname server code.
That works as expected now.

	J.F.
(This used to be commit f2766932d6)
2001-11-22 17:19:59 +00:00
Jean-François Micouleau
2e8ae88785 add a command to rpcclient: enumprivs
J.F.
(This used to be commit fa63cb78e3)
2001-11-22 16:12:43 +00:00
Gerald Carter
59b2e772e2 remove unused variables
(This used to be commit 90ed3d47e1)
2001-11-22 06:44:05 +00:00
Gerald Carter
116740a5df merge from 2.2
(This used to be commit 96b3a65a73)
2001-11-22 05:56:09 +00:00
Martin Pool
f741f65673 Store some path names in global variables initialized to configure
default, rather than in preprocessor macros.
(This used to be commit 79ec88f0da)
2001-11-19 02:49:53 +00:00
Tim Potter
06ff349e21 FALSE -> False
(This used to be commit 7c6529c081)
2001-11-15 05:26:22 +00:00
Gerald Carter
e3abad1741 Fixed a few typos and added the opnum for ADDPRINTERDRIVEREX to the
rpc_spoolss.h header file.
(This used to be commit d4cafc076b)
2001-11-09 20:59:18 +00:00
Andrew Bartlett
395aa946cd This change updates lp_guestaccount() to be a *global* paramater, rather than
per-share.  I beleive that almost all the things that this could have done on
a per-share basis can be done with other tools, like 'force user'.

Almost all the user's of this paramater used it as a global anyway...

While this is one step at a time, I hope it will allow me to considerably
simplfy the make_connection() code, particularly for the user-level security
case.

This already removes an absolute truckload of extra attempted password lookups
on the guest account.

Andrew Bartlett
(This used to be commit 8e708332ed)
2001-11-09 11:16:06 +00:00
Andrew Bartlett
55dfb66079 Change to guest logon code.
This changes the way we process guest logons - we now treat them as normal
logons, but set the 'guest' flag.  In particular this is needed becouse Win2k
will do an NTLMSSP login with username "", therefore missing our previous guest
connection code - this is getting a pain to do as a special case all over the
shop.

Tridge:  We don't seem to be setting a guest bit for NTLMSSP, in either the
anonymous or authenticated case, can you take a look at this?

Also some cleanups in the check_password() code that should make some of the
debugs clearer.

Various other minor cleanups:

 - change the session code to just take a vuser, rather than having to do a
   vuid lookup on vuser.vuid

 - Change some of the global_client_caps linking

 - Better debug in authorise_login(): show the vuid.

Andrew Bartlett
(This used to be commit 62f4e4bd0a)
2001-11-08 22:19:01 +00:00
Andrew Bartlett
848d01cde5 Initilising these variables before appending the domain groups to them
(This used to be commit 8004cfea19)
2001-11-07 02:16:22 +00:00
Jeremy Allison
198612deda Changed MAX_OPEN_PIPES to 2048.
Jeremy.
(This used to be commit 591d217ed4)
2001-11-05 07:42:55 +00:00
Tim Potter
7623cec4ad Wrote some stubs for new win2k only spoolss rpc commands:
GetPrinterDataEx() and SetPrinterDataEx().  Not sure what the command
number is for the latter is - I haven't seen it on the wire yet.
(This used to be commit 87614c74b3)
2001-11-05 06:15:02 +00:00
Tim Potter
d876260d88 Don't put a \n on the end of the arg to exit_server()
(This used to be commit dfb8566220)
2001-11-05 00:02:38 +00:00
Andrew Bartlett
5f5661d217 Fix up authenticated pipes in line with vuser changes. This ensures that global
groups obtained via a domain logon are respected in the attached NT_USER_TOKEN.

This functionality is only available in HEAD, becosue of the way authenticaion
has been abstracted.

Both vuid logins and authenticated pipes need to use the same code for this in
future.

Can sombody with the correct facilties check this please?\

Thanks,

Andrew Bartlett
(This used to be commit caae69fcd0)
2001-11-04 01:14:15 +00:00
Jeremy Allison
f8e2baf39e Added NT_USER_TOKEN into server_info to fix extra groups problem.
Got "medieval on our ass" about const warnings (as many as I could :-).
Jeremy.
(This used to be commit ee5e7ca547)
2001-11-03 23:34:24 +00:00
Andrew Bartlett
acb81fe408 Various post AuthRewrite cleanups, fixups and tidyups.
Zero out some of the plaintext passwords for paranoia

Fix up some of the other passdb backends with the change to *uid_t rather than
uid_t.

Make some of the code in srv_netlog_nt.c clearer, is passing an array around,
so pass its lenght in is definition, not as a seperate paramater.

Use sizeof() rather than magic numbers, it makes things easier to read.

Cope with a PAM authenticated user who is not in /etc/passwd - currently by
saying NO_SUCH_USER, but this can change in future.

Andrew Bartlett
(This used to be commit 514c91b16b)
2001-11-01 05:02:41 +00:00
Andrew Bartlett
be93100240 Fix up domain logons. Tested with NT4.
(This used to be commit c8b2718adf)
2001-10-31 12:07:59 +00:00
Andrew Bartlett
abaedd04f2 ... and clean up the unused variables.
(This used to be commit e0b56a3148)
2001-10-31 11:10:29 +00:00
Andrew Bartlett
b49b7ed1fb Small changes for guest authenticated pipes.
(This used to be commit 813bf962ae)
2001-10-31 11:09:21 +00:00
Andrew Bartlett
60f0627afb This is a farily large patch (3300 lines) and reworks most of the AuthRewrite
code.

In particular this assists tpot in some of his work, becouse it provides the
connection between the authenticaion and the vuid generation.

Major Changes:
	- Fully malloc'ed structures.
	  - Massive rework of the code so that all structures are made and destroyed
	    using malloc and free, rather than hanging around on the stack.
	- SAM_ACCOUNT unix uids and gids are now pointers to the same, to allow them
	   to be declared 'invalid' without the chance that people might get ROOT by
	   default.

	- kill off some of the "DOMAIN\user" lookups.  These can be readded at a more
	  appropriate place (probably domain_client_validate.c) in the future. They
	  don't belong in session setups.

	- Massive introduction of DATA_BLOB structures, particularly for passwords.

	- Use NTLMSSP flags to tell the backend what its getting, rather than magic
	  lenghths.

	- Fix winbind back up again, but tpot is redoing this soon anyway.

	- Abstract much of the work in srv_netlog_nt back into auth helper functions.

This is a LARGE change, and any assistance is testing it is appriciated.

Domain logons are still broken (as far as I can tell) but other functionality
seems
intact.

Needs testing with a wide variety of MS clients.

Andrew Bartlett
(This used to be commit f70fb819b2)
2001-10-31 10:46:25 +00:00
Tim Potter
6f0b8a38ec Added some extra fields to the auth_serversupplied_info structure.
To obtain the full group membership of a user (i.e nested groups on a
win2k native mode server) it is necessary to merge this list of groups
with the groups returned by winbindd when creating an nt access token.

This breaks winbindd linking while AB and I sync up our changes to the
authentication subsystem.
(This used to be commit 4eeb7bcd78)
2001-10-31 06:20:58 +00:00
Andrew Bartlett
d9d7f023d8 This commit is number 4 of 4.
In particular this commit focuses on:

Actually adding the 'const' to the passdb interface, and the flow-on changes.

Also kill off the 'disp_info' stuff, as its no longer used.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes introduces a large dose of 'const' to the Samba tree.
There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username

---

This finishes this line of commits off, your tree should now compile again :-)

Andrew Bartlett
(This used to be commit c95f5aeb93)
2001-10-29 07:35:11 +00:00
Andrew Bartlett
2038649e51 This commit is number 3 of 4.
In particular this commit focuses on:

Changing the Get_Pwnam code so that it can work in a const-enforced
environment.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes allow for 'const' in the Samba tree.

There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username
(This used to be commit e7634f81c5)
2001-10-29 07:28:32 +00:00
Andrew Bartlett
ab5d5cfbe0 This commit is number 1 of 4.
In particular this commit focusses on:

Adding the new 'pass changed now' helper function.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.
(This used to be commit a8971a5448)
2001-10-29 07:15:51 +00:00
Jeremy Allison
d04824639d Raise simultaneous open pipes from 64 to 1024 for large print server
environments.
Jeremy.
(This used to be commit e5f8147d02)
2001-10-27 07:16:48 +00:00
Jeremy Allison
c416ff851b Merge the become_XXX -> change_to_XXX fixes from 2.2.2 to HEAD.
Ensure make_conection() can only be called as root.
Jeremy.
(This used to be commit 8d23a7441b)
2001-10-18 20:15:12 +00:00
Jean-François Micouleau
375dcb9a8b Fix some unicode string error.
I'm wondering if I have to audit *all* the rpc code for that kind of
trouble ;-) Oh well I've done it twice already, I can do it a third time
;-)

	J.F.
(This used to be commit 6be8ea28f9)
2001-10-16 22:42:24 +00:00
Jeremy Allison
de2ece0543 Back-out the share acl fix. Not needed (Gerald has been telling porkies
again :-) :-).
Jeremy.
(This used to be commit 3b56239c51)
2001-10-10 19:36:53 +00:00
Jeremy Allison
a2272cb71f Fix bug where removing root from a share SD stops further edit access.
Jeremy.
(This used to be commit 4d57c7520f)
2001-10-09 21:22:33 +00:00
Jeremy Allison
ed94aa9d61 Fixes from John Trostel (modified somewhat by me) to ensure that all lookup_XX
functions correctly deal with the SID_NAME_TYPE. One fix for connection user
lookup in LSA.
Jeremy.
(This used to be commit 29730027d8)
2001-10-09 20:54:56 +00:00
Simo Sorce
a42efb4971 fix some possible memleaks and not tested reallocs spotted by Andreas Moroder
(This used to be commit d30939a091)
2001-10-03 21:10:29 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Andrew Bartlett
81697d5ebe Fix up a number of intertwined issues:
The big one is a global change to allow us to NULLify the free'ed pointer to a
former passdb object.  This was done to allow idra's SAFE_FREE() macro to do
its magic, and to satisfy the input test in pdb_init_sam() for a NULL pointer
to start with.

This NULL pointer test was what was breaking the adding of accounts up until
now, and this code has been reworked to avoid duplicating work - I hope this
will avoid a similar mess-up in future.

Finally, I fixed a few nasty bugs where the pdb_ fuctions's return codes were
being ignored.  Some of these functions malloc() and are permitted to fail.
Also, this caught a nasty bug where pdb_set_lanman_password(sam, NULL) acheived
precisely didilly-squat, just returning False.  Now that we check the returns
this bug was spotted.  This could allow different LM and NT passwords.

 - the pdbedit code needs to start checking these too, but I havn't had a
chance to fix it.

I have also fixed up where some of the password changing code was using the
pdb_set functions to store *internal* data.  I assume this is from a previous
lot of mass conversion work...

Most likally (and going on past experience) I have missed somthing, probably in
the LanMan password change code which I havn't yet been able to test, but this
lot is in much better shape than it was before.

If all this is too much to swallow (particularly for 2.2.2) then just adding a
sam_pass = NULL to the particular line of passdb.c should do the trick for the
ovbious bug.

Andrew Bartlett
(This used to be commit 762c8758a7)
2001-09-29 13:08:26 +00:00
Andrew Bartlett
2a9cd3b79a Fix memory leak in get_sampwd_entries(), reindent for clarity.
- call pdb_reset_sam() after each getent call.

Fix bug in get_group_alias_entries(), were if num_entries was zero this caused
talloc() to return NULL, failing a test below with NT_STATUS_NO_MEMORY.

Fix pdb_reset_sam() to correctly initalise the sam structure.

Move default value code into a single place, likewise for sam freeing code.
 - should make things easier if we decide to malloc other strings, or get more
 non-zero default values.

Finally, add a function in init a sam struct from a getpwnam() return.

Andrew Bartlett
(This used to be commit a41fb44f5e)
2001-09-27 09:13:26 +00:00
Andrew Bartlett
d74d82bddc Make use of the pdb_set_plaintext_passwd() update to vastly simplify
decode_pw_buffer() and the samr password changing routines.

And yes, I know that we can lost some information in the Unicode->UTF->Unicode
bit of this, but its worth the code cleanup.

This also takes into account the possability of multibyte passwords.

Andrew Bartlett
(This used to be commit 42402c87d6)
2001-09-26 11:51:25 +00:00
Andrew Bartlett
6744ca0a36 More updates to prevent account-guessing.
This moves the check that ensures that the account being looked up is the same
account as the machine logged in as to the front, before we even start with
passdb.

Merge for 2.2.2?

Andrew Bartlett
(This used to be commit f7ed0ecc14)
2001-09-26 11:13:55 +00:00
Jeremy Allison
0f4281b9b4 Added Elrond patch to make se_access_check use NT datastructures, not Samba.
Jeremy.
(This used to be commit bca6419447)
2001-09-26 00:05:03 +00:00
Jeremy Allison
008ba27b28 Fixed enumeration of large numbers of groups from a Samba DC.
Tidied up debug messages in lib/messages.c
Jeremy.
(This used to be commit dfb58f2276)
2001-09-25 00:50:37 +00:00
Andrew Tridgell
80ad52d5c2 fixed character set for user name pull
(This used to be commit 374f76fa2d)
2001-09-21 13:22:22 +00:00
Andrew Bartlett
01529e340c fix debug
(This used to be commit d103371e80)
2001-09-19 02:53:14 +00:00
Andrew Bartlett
36939fcd24 Reverse some of the breakage I commited a day or two ago, as we need to
fill out the user_info struct (otherwise we don't have a vuid for
make_connection()).

Also add a become_user() call, becouse it really looks like it was missing
(we must pass it anyway to finish make_connection()).

Is there any reason not to be the user when reading an ACL?

Finally, fix up some formatting to show that the two functions are almost
identical.

Andrew Bartlett
(This used to be commit 00c667c0ad)
2001-09-19 02:28:15 +00:00
Simo Sorce
87945989c0 move to SAFE_FREE()
(This used to be commit 5ceecc7bef)
2001-09-17 10:26:23 +00:00
Andrew Bartlett
6ff605c283 Minor tidy-up.
(This used to be commit dbb21aedbf)
2001-09-16 07:32:06 +00:00
Andrew Bartlett
dec3cbcaf0 Fix up workstaion and kickoff time checks, moved to auth_smbpasswd.c where
they can have general effect.

Fixed up workstaion support in the rest of samba, so that we can do these
checks.

Pass through the workstation for cli_net_logon(), if supplied.
(This used to be commit 7f04a139b2)
2001-09-16 06:35:35 +00:00
Andrew Bartlett
06ccf1e499 Looks like it missed these. make_connection now no longer takes a 'username'
argument.
(This used to be commit 0e1322227b)
2001-09-15 23:32:19 +00:00
Andrew Bartlett
7892c494e7 Kill off the //server/share%user hack in share level security.
This should help make much of this code simpiler.

Andrew Bartlett
(This used to be commit fb0c3629c3)
2001-09-15 12:55:59 +00:00
Gerald Carter
bd7595ec37 merge from appliance_head
(This used to be commit f70b1707e4)
2001-09-14 15:22:49 +00:00
Andrew Bartlett
cbd99a13c5 Finally commit my fix to this little mess...
The same function that adds machines to the system also adds users, and the
new 'add user script'/'add machine script' distinction needs to be made
correctly.  Also introduces a sainity check for correct $ termination.

Andrew Bartlett
(This used to be commit ef377ea0cc)
2001-09-14 10:31:39 +00:00
Tim Potter
b800a36b1c Some patches to authentication:
- the usersupplied_info now contains a smb_username (as it comes across on
   the wire) and a unix_username (after being passed through mapping
   functions)

 - when doing security={server,domain} use the smb_username, otherwise use
   the unix_username
(This used to be commit d34fd8ec07)
2001-09-12 06:39:50 +00:00
Andrew Tridgell
39d7983a47 - enable MSDFS by default, there seems no reason not to have it enabled
by default in Samba 3.x

- got rid of some unused parameters in Makefile.in

- declare DEBUGLEVEL in debug.h rather than in each file
(This used to be commit b8651acb9c)
2001-09-12 03:08:51 +00:00
Tim Potter
a39d4c052c Converted DFS error returns to WERROR instead of uint32.
(This used to be commit 97286570ef)
2001-09-12 01:14:03 +00:00
Gerald Carter
cae476a1a2 cut-n-paste error
(This used to be commit b2ed211df0)
2001-09-10 19:30:34 +00:00
Gerald Carter
c113b5196f merge from APPLIANCE_HEAD
(This used to be commit 55bd514c45)
2001-09-10 19:29:00 +00:00
Andrew Tridgell
9a9ac2739b got rid of USE_TDB_MMAP_FLAG as its not needed any more
(This used to be commit c26e0d3f27)
2001-09-06 22:08:19 +00:00
Tim Potter
b31055fa74 Logon workstation checks from Toomas Soome <tsoome@ut.ee>
Fixed compile warning.
(This used to be commit 3eee665165)
2001-09-06 05:24:37 +00:00
Andrew Tridgell
b04933dfbb a fix for fussy compilers
(This used to be commit 78f437b507)
2001-09-04 11:18:50 +00:00
Andrew Tridgell
19fea3242c the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work
(This used to be commit dcd6e735f7)
2001-09-04 07:13:01 +00:00
Andrew Tridgell
fbc1f326f4 more NTSTATUS/WERROR conversion
(This used to be commit ad648c5cd8)
2001-09-03 10:38:13 +00:00
Andrew Tridgell
fd6ea43161 the next step in our error code handling change
- added WERROR for win32 error codes
- added a configure test for immediate structures

still lots to do, so its not enabled by default, but the main
structure is there
(This used to be commit 24f9ab683d)
2001-09-03 08:50:59 +00:00
Tim Potter
cd0a9f6fcc Send a MSG_SMB_SAM_SYNC when a netlogon_ctrl2 message is received.
(This used to be commit 73e1b708d0)
2001-08-28 06:34:08 +00:00
Andrew Tridgell
b031af348c converted another bunch of stuff to NTSTATUS
(This used to be commit 1d36250e33)
2001-08-27 19:46:22 +00:00
Andrew Tridgell
ee5f7237de started converting NTSTATUS to be a structure on systems with gcc in order to make it type incompatible with BOOL so we catch errors sooner. This has already found a number of bugs
(This used to be commit 1b778bc7d2)
2001-08-27 17:52:23 +00:00
Andrew Bartlett
3820578473 As per plug-fest discussions this paramater no longer defaults to the value
of add user script.
(This used to be commit 9e0c9a99f6)
2001-08-27 03:56:09 +00:00
Jeremy Allison
d309035c3e Spaces -> Tabs.
Jeremy.
(This used to be commit 5b665122f5)
2001-08-26 20:05:33 +00:00
Herb Lewis
717533483b get rid of compiler warnings
(This used to be commit 0768991d04)
2001-08-24 20:32:01 +00:00
Herb Lewis
40342d6917 fix missing )
(This used to be commit f3bc6b5d68)
2001-08-24 14:34:23 +00:00
Simo Sorce
0174ccc0d6 let admins also abort a shutdown
(This used to be commit 3b40ec4f14)
2001-08-24 07:51:59 +00:00
Jeremy Allison
659774bffd Fixed malloc -> talloc problems pointed out by Simo.
Jeremy
(This used to be commit 0f5b187387)
2001-08-24 07:32:51 +00:00
Simo Sorce
8ef7ddba65 so let admins shutdown their samba servers remotely if they want :-)
(This used to be commit 6391fd7bda)
2001-08-23 23:25:34 +00:00
Tim Potter
b5a5fe44cc Fix for filers sending -1 for the maximum read request length on the
LSA pipe.
(This used to be commit 95307a5d38)
2001-08-23 18:05:44 +00:00
Simo Sorce
28b206f163 some %things are not expanded properly in get share info levels
(This used to be commit 3e60636f2b)
2001-08-22 16:10:28 +00:00
Jeremy Allison
e08ca02631 Added Jim McDonough's Win9x take ownership fix.
Jeremy.
(This used to be commit 800e46ea7e)
2001-08-13 23:19:16 +00:00
Gerald Carter
26ceb74063 merge from 2.2
(This used to be commit 7049217eb4)
2001-08-13 21:30:27 +00:00
Simo Sorce
2e783a4707 this is a big global fix for the ptr = Realloc(ptr, size) bug.
many possible mem leaks, and segfaults fixed.

someone should port this fix to 2.2 also.
(This used to be commit fa8e55b8b4)
2001-08-12 17:30:01 +00:00
Andrew Bartlett
ddec830658 Kill of idra's extra become_root()/unbecome_root() now I have fixed the actual
problem.

Andrew Bartlett
(This used to be commit 895d1cd317)
2001-08-12 12:23:50 +00:00
Andrew Bartlett
6ad80352dd This patch does a number of things, mostly smaller than they look :-)
In particuar, it moves the domain_client_validate stuff out of
auth_domain.c to somwhere where they (I hope) they can be shared
with winbind better.  (This may need some work)

The main purpose of this patch was however to improve some of the
internal documentation and to correctly place become_root()/unbecome_root()
calls within the code.

Finally this patch moves some more of auth.c into other files, auth_unix.c
in this case.

Andrew Bartlett
(This used to be commit ea1c547ac8)
2001-08-12 11:19:57 +00:00
Simo Sorce
8d5916d5fa Without this become_root()/unbecome_root() pair I was not able to login
when samba acting as a PDC.
I also removed a pdb_free_sam(sampass), because it sampass was never
initialized before...

Please abartlet can you check this patch is ok?
I feel like this was a bad check-in
(This used to be commit f25a5dab60)
2001-08-11 16:34:11 +00:00
Jeremy Allison
4b2016305b Merge in the NT drivers changes from 2.2.
Jeremy.
(This used to be commit a3781ad38f)
2001-08-10 19:38:53 +00:00
Tim Potter
047a7c88d7 Replaced the duplicate DOS constants with appropriate ones from doserr.h to
emphasise the fact that the spoolss pipe returns DOS error codes instead of
32-bit nt status codes.
(This used to be commit 5f5ed41ee8)
2001-08-10 05:41:53 +00:00
Gerald Carter
f8d3cac8af a few cleanups while mergeing the passdb code into 2.2
(This used to be commit ef01739708)
2001-08-09 15:53:49 +00:00
Andrew Bartlett
986372901e This is my 'Authentication Rewrite' version 1.01, mostly as submitted to
samba-technical a few weeks ago.

The idea here is to standardize the checking of user names and passwords,
thereby ensuring that all authtentications pass the same standards.  The
interface currently implemented in as

nt_status = check_password(user_info, server_info)

where user_info contains (mostly) the authentication data, and server_info
contains things like the user-id they got, and their resolved user name.

The current ugliness with the way the structures are created will be killed
the next revision, when they will be created and malloced by creator functions.

This patch also includes the first implementation of NTLMv2 in HEAD, but which
needs some more testing.  We also add a hack to allow plaintext passwords to be
compared with smbpasswd, not the system password database.

Finally, this patch probably reintroduces the PAM accounts bug we had in
2.2.0, I'll fix that once this hits the tree.  (I've just finished testing
it on a wide variety of platforms, so I want to get this patch in).
(This used to be commit b30b6202f3)
2001-08-03 13:09:23 +00:00
Jeremy Allison
996719cce2 Added "use mmap" for HPUX.
Jeremy.
(This used to be commit 840802f106)
2001-07-30 22:21:31 +00:00
Tim Potter
648528196c Held a shoot-out between NT_STATUS_NO_PROBLEMO and NT_STATUS_NOPROBLEMO.
According to the incorruptible judges find and grep, the latter won.

Mmm - procrastination.  (-:
(This used to be commit 2e33940360)
2001-07-25 06:42:05 +00:00
Jeremy Allison
a9ab7eaa5d Fix case insensitive password change code.
Fixed crash bug with un-zeroed talloced memory.
Jeremy.
(This used to be commit eea1c30df2)
2001-07-23 22:06:05 +00:00
Tim Potter
cdcf646c65 #ifdef'ed out some unused functions.
(This used to be commit ab5ccce2ed)
2001-07-19 07:44:59 +00:00
Jeremy Allison
3015fde980 Fix usermanager for domains - we were returning no memory when we
should have been returning empty space at end of enumeration.
Jeremy.
(This used to be commit 175c640692)
2001-07-17 02:26:04 +00:00
Tim Potter
5f4a1aa3c3 Removed unused variable.
(This used to be commit 914e78f053)
2001-07-12 22:19:39 +00:00
Jean-François Micouleau
0a33cb45c1 implement:
LSA_ENUM_PRIVS
	LSA_PRIV_GET_DISPNAME
	LSA_ENUM_ACCOUNTS
	LSA_OPENACCOUNT
	LSA_ENUMPRIVSACCOUNT
	LSA_GETSYSTEMACCOUNT

It's a work in progress. nobody should expect it to work

	J.F.
(This used to be commit 3056357cd8)
2001-07-09 18:32:54 +00:00
Jean-François Micouleau
62d399f3cf add query user info level 20 (for RAS)
add query dominfo level 5
some cleanup, don't free talloced memory.
implement delete domain and local groups.

	J.F.
(This used to be commit 3f14dda2a2)
2001-07-09 18:25:40 +00:00
Andrew Bartlett
5b8d230e39 This removes unused paramaters from various authtication functions, and should
not change behaviour.

This should make my later diffs smaller, where I actualy start cleaning up this
mess...

Andrew Bartlett
(This used to be commit 04f090c224)
2001-07-08 14:10:30 +00:00
Andrew Bartlett
28a53730a9 Add a new paramater: add machine script
This allows the administrator to define different scripts for adding unix users
and automaticly adding machines.  If it is not defined, it falls back to the
value of 'add user script'.

Andrew Bartlett
(This used to be commit 7a478e050f)
2001-07-07 08:45:39 +00:00
Jeremy Allison
3a40f80a94 Fix for enumerating large numbers of users.
Jeremy.
(This used to be commit c8c138c1fb)
2001-07-05 22:36:25 +00:00
Andrew Tridgell
527e824293 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376)
2001-07-04 07:36:09 +00:00
Andrew Tridgell
87fbb7092b The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Jeremy Allison
ed2fc96222 Fixed extra file_free calls - my fault :-(.
Jeremy.
(This used to be commit 2f8b84bda0)
2001-07-02 18:37:39 +00:00
Andrew Bartlett
e682d6d54e This fix from Eelco Vriezekolk <eelco@nexus.com.na> is for a SIG11 bug where we
would always file_free(fsp) twice, once in close_file and once afterwoulds.

The bug was reported in SAMBA_2_2, but a code inspection shows it to be in HEAD
as well.  (Unfortunetly I don't have the facilites to actualy check this, but
the change is quite simple, makes sence and compiles).

Andrew Bartlett
(This used to be commit 5d3f622375)
2001-07-02 13:43:46 +00:00
Jeremy Allison
8d0b9cf534 Added LsaGetConnectedCredentials patch from Manoj Naik <manoj@almaden.ibm.com>.
Jeremy.
(This used to be commit 7079300da6)
2001-06-29 23:12:55 +00:00
Jeremy Allison
2cddd5fe8c From JF....
hi jeremy,

can you commit the following patch against HEAD. I can't do it right now

Thanks Tim for me. He changed the SAM_DISPINFO_1 array without checking if
he didn't break the server code. And he did.

So on my way I cleaned info_1, 2, .. 5

it may break winbind. I leave to tim the pleasure to fix it ;-)

        jf.

I added some talloc changes and checks for alloc fails.

Jeremy.
(This used to be commit 001e9b7b54)
2001-06-29 18:41:31 +00:00
Herb Lewis
c2cfcb34e1 SGI compiler fixes.
Jeremy
(This used to be commit 45bf995bf6)
2001-06-26 20:23:45 +00:00
Tim Potter
6e0605c3ab Cosmetic fixups found while playing with the server manager. Added support
for NET_SRV_SET_INFO rpc call which is made when double-clicking on a
computer in the server manager and changing the description.  We always
return NT_STATUS_NOPROBLEMO as NT doesn't seem to decode any error messages
passed back.

Maybe the changed comment string could be stored in a tdb and regurgitated
instead of the "server string" smb.conf parameter?
(This used to be commit d936ffedd9)
2001-06-25 06:13:27 +00:00
Jeremy Allison
b08ee8995d Fix from "Jim McDonough" <jmcd@us.ibm.com>" - when we use open_file_shared(),
we need to close with close_file().
Jeremy.
(This used to be commit 5b2ffd160f)
2001-06-22 18:58:35 +00:00
Jeremy Allison
3a6019b0eb Merging Gerry's spoolss changes.
Jeremy.
(This used to be commit 6b4a70cd82)
2001-06-21 17:46:14 +00:00
Jeremy Allison
3f1254bee1 Fixed W2K SP2 joining a Samba PDC hosted domain.
Jermey.
(This used to be commit 05a2911403)
2001-06-20 19:55:59 +00:00
Jeremy Allison
d2846a3ea9 Only try and open a directory if we get EISDIR.
Jeremy.
(This used to be commit 5b1245f803)
2001-06-19 18:43:17 +00:00
Tim Potter
fd0f3dfd3c Fixed typo in debug message.
(This used to be commit d05577c332)
2001-06-19 06:52:45 +00:00
Jeremy Allison
c1fbf761ce rpc_server/srv_srvsvc_nt.c: Don't test an uint32 for < 0.
utils/smbcacls.c: Set enum correctly.
Jeremy.
(This used to be commit 66f959e0ff)
2001-06-19 00:44:23 +00:00
Jeremy Allison
48a5c87240 Fix for assert fail - left over when moved to dynamic allocation.
Jeremy.
(This used to be commit 0fcf200633)
2001-06-18 21:34:01 +00:00
Jeremy Allison
809c025878 Added patches to remove Linux specific XFS ACLs. These are now handled by the
generic Linux ACL code.
rpc_server/srv_samr_nt.c: Don't delete a policy handle before it's created.
Jeremy.
(This used to be commit db5b82e53a)
2001-06-18 20:27:35 +00:00
Jeremy Allison
0417200fa9 Added "Jim McDonough" <jmcd@us.ibm.com> patches for directory support
for Win9x.
Jeremy.
(This used to be commit 70194b194e)
2001-06-18 17:52:58 +00:00
Jeremy Allison
af604fe769 Modified version of Jim's 0x27 and 0x28 Win9x Secdesc patch.
Jeremy.
(This used to be commit 5690ec77c8)
2001-06-16 00:32:13 +00:00
Jeremy Allison
8209eda774 Make message receive fn static.
Jeremy.
(This used to be commit d8807b1922)
2001-06-13 01:08:27 +00:00
Tim Potter
c569e20b10 Fixed typo in debug message.
(This used to be commit 4d2f660582)
2001-06-12 10:13:24 +00:00
Jeremy Allison
11b2de50fc Added getconf flags for RH7.1 lfs support. Changed while() to a for()
loop in Simo's code (removes much grp = gep->next code).
Jeremy.
(This used to be commit d0c276c242)
2001-06-06 23:07:10 +00:00
Tim Potter
5d83242a9e Merge of lsa_lookup_names() i18n bugfix from appliance.
(This used to be commit 84a22d5f0a)
2001-06-05 01:26:06 +00:00
Andrew Tridgell
05fc3e578c use LDSHFLAGS not -shared in several places
(This used to be commit 8ec9c87b5d)
2001-06-04 05:13:59 +00:00
Tim Potter
94186f645d Merge of i18n domain name fix for lsa_query_info_policy() from appliance
branch.
(This used to be commit e7a4dd7612)
2001-06-02 06:14:42 +00:00
Tim Potter
2eef56f9fa i18n bugfix merge from appliance.
(This used to be commit 73eb539da6)
2001-06-02 03:03:28 +00:00
Simo Sorce
bbf5ea221a 4 new functions to retrieve single linked list of group and passwd entries
+ a fix to an infinite loop in srv_samr_nt.c caused by misuse of
setgrent/getgrent/endgrent solved by these new functions
(This used to be commit 97dbb54a13)
2001-05-29 07:34:01 +00:00
Tim Potter
076ace3e3d Added server side reponse to net_logon_ctrl rpc. We can now respond
to NLTEST /BDC_QUERY:DOMAIN when acting as a BDC.

Reverse engineered a couple of status constants.
(This used to be commit 0678c30282)
2001-05-24 08:05:12 +00:00
Gerald Carter
43000d8d06 merge from 2.2 (deleteprinterdriver RPC)
(This used to be commit 515caaf7b4)
2001-05-18 04:11:17 +00:00
Jeremy Allison
c912d04389 Fix the W2KSP2 joining a Samba domain problem.
Jeremy.
(This used to be commit 6bbcab5e48)
2001-05-18 01:30:21 +00:00
Gerald Carter
6dd8c06ce9 Should be faliing on False and not True. Bad check on return value
(This used to be commit 5be97aacf4)
2001-05-10 20:05:06 +00:00
Gerald Carter
f874646136 check for valid pointer before calling memset() in samr_clear_sam_passwd
(This used to be commit a6a4a17f6a)
2001-05-09 17:57:08 +00:00
Jean-François Micouleau
b6a6b4b02e fixes to the group mapping code.
Not ready yet.

	J.F.
(This used to be commit 62a7a567fd)
2001-05-08 16:33:18 +00:00
Tim Potter
f39cb774e7 Fixed compiler warning.
(This used to be commit 9f1f811154)
2001-05-08 06:09:52 +00:00
Jeremy Allison
ee8821f2f3 Fix for insure missmatched parameter error.
Jeremy.
(This used to be commit b32b1afe25)
2001-05-08 01:26:28 +00:00
Gerald Carter
495f6e6787 merge from 2.2 removing the 'domain XXX' parameters.
(This used to be commit 9aefc86e35)
2001-05-07 22:10:38 +00:00
Gerald Carter
dbd7e0a54e removed unused variables
(This used to be commit 09103b16cf)
2001-05-07 22:08:34 +00:00
Gerald Carter
30c4c04c2f Patch from Simo:
o sed 's/pdb_clear_sam/pdb_free_sam/g'
  o add pdb_reset_sam()
  o password changing should be ok now as well.
(This used to be commit 96d0e7c330)
2001-05-07 14:04:46 +00:00
Jean-François Micouleau
f35157f392 Big cleanup of passdb and backends.
I did some basic tests but I have probably broken something. Notably the
password changing. So don't cry ;-)

	J.F.
(This used to be commit a4a4c02b12)
2001-05-04 15:44:27 +00:00
Jeremy Allison
dea501bc5f Fix noticed by John Trostel - we need to return our account SID for level 5.
Jeremy.
(This used to be commit acf32f277d)
2001-05-02 20:32:17 +00:00
Jeremy Allison
3c525aaaa3 Remove embedded '/*' in comment.
Jeremy.
(This used to be commit 9a85dc9cdb)
2001-05-02 08:14:00 +00:00
Andrew Tridgell
e51cc47cec fixed comment-in-comment
(This used to be commit 4c456c8264)
2001-05-01 04:02:15 +00:00
Jeremy Allison
8bd2a11c86 Added code from "Nigel Williams" <nigel@veritas.com> (yes, the same famous
Nigel Williams who did NIS/GINA !) to implement add/modify/delete shares
for Win2k. Needs testing as I made a few mods to the original code.
Jeremy.
(This used to be commit 9b3dd80176)
2001-05-01 01:01:19 +00:00
Jeremy Allison
9b78339875 More acl -> the_acl, %d with uid_t issues.
Jeremy.
(This used to be commit 30edd7fdf1)
2001-04-27 21:49:22 +00:00
Jean-François Micouleau
30c0777c1f fix a bug in printer name handling that jerry reported.
names can be \\server -> print server
\\server\printer -> printer
printer -> printer

	J.F.
(This used to be commit ec576722b7)
2001-04-27 17:08:33 +00:00
Gerald Carter
c3bf153c0c converted the passdb smbpasswd implementation to using talloc
for memory allocation.  This fixes a long standing seg fault
(i knew i would get around to it one day :) )

Tested with NT4 and Win2k.  Needs a little more testing with the
"create the machine account on the fly" code for NT4.

Simo, this is probably going to break the tdb passdb code.
Can you look at that when you get a chance and see what you think?
(This used to be commit 1c13110873)
2001-04-25 22:12:13 +00:00
Jeremy Allison
3e4c6d130c Fix "proc num out of range" error. Missing rpc call.
Jeremy.
(This used to be commit 6248fb2292)
2001-04-23 23:31:09 +00:00
Jeremy Allison
130f31f571 Finally got name & SID returns correct.
Jeremy.
(This used to be commit 2a5b513c44)
2001-04-22 06:13:14 +00:00
Andrew Tridgell
ac9e221c3e merging from 2.2 to head
(This used to be commit bfcc6f8827)
2001-04-22 02:54:04 +00:00
Jeremy Allison
a626bb3a23 JF pointed out we were returning the wrong info for Domain member with info
levels 3 and 5. I *hate* LSAQueryInfoPolicy() :-).
Jeremy.
(This used to be commit 37581bdf1e)
2001-04-21 23:06:59 +00:00
Tim Potter
af08cd21eb Getting medieval with compiler warnings as Jeremy puts it.
(This used to be commit d05c3cf0f4)
2001-04-16 02:35:35 +00:00
Jeremy Allison
06a50f5184 Patch from "Christoph Zwerschke" <zwerschke@zuv.uni-heidelberg.de> to
map usernames before calling password change.
Jeremy.
(This used to be commit ce2a236dc6)
2001-04-15 22:29:36 +00:00
Jeremy Allison
2ef68c7e92 Merge of Andrew's changes in 2.2.
Jeremy.
(This used to be commit fc76681812)
2001-04-13 19:12:06 +00:00
Jeremy Allison
50e78a9ac8 As Andrew suggested, make smbrun return a fd for a deleted file which can then
be read.
Jeremy.
(This used to be commit e7d59d6de8)
2001-04-13 00:37:00 +00:00
Jeremy Allison
09a5daf032 Changed lp_add/delete/enum scripts to use lockdir if spool dir doesn't
exist for printer. Rather than using pid for suffix, use a 16 byte random
string. Created generate_random_str() function in genrand.c. Still needs
more testing but this is the way to go.
Jeremy.
(This used to be commit 71a330987f)
2001-04-12 07:00:08 +00:00
Jeremy Allison
0ca9f5c023 Fix for core dump in security = share code with new share security db.
Jeremy.
(This used to be commit 20b13bafdf)
2001-04-11 21:19:25 +00:00