1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

1148 Commits

Author SHA1 Message Date
Jelmer Vernooij
8e729a4d84 Move samr_make_sam_obj_sd to lib/util_seaccess.c. samtest now compiles and
links successfully!
(This used to be commit 0ea4bcb6b7)
2002-08-29 16:38:43 +00:00
Herb Lewis
b294ce9986 add proto for forward reference
(This used to be commit 7573fd1746)
2002-08-28 14:19:40 +00:00
Jelmer Vernooij
2b2b0f7119 Put in intermediate version of new SAM system. It's not stable yet, code
might be ugly, etc - please don't blame me for anything but instead try to fix
the code :-). Compiling of the new sam system can be enabled with the
configure option --with-sam

Removing passdb/passgrp.c as it's unused
fix typo in utils/testparm.c
(This used to be commit 4b7de5ee23)
2002-08-28 04:54:43 +00:00
Gerald Carter
6dad13d801 merge from APP_HEAD
(This used to be commit ebe89453b6)
2002-08-26 16:57:35 +00:00
Gerald Carter
68d5ab9a65 merge from APP_HEAD
(This used to be commit 4689e7ea5e)
2002-08-26 16:43:29 +00:00
Gerald Carter
2bd75e4714 fix registry editor API for printing backend after I changed
the NT_PRINTER_PARAM to a REGISTRY_VALUE
(This used to be commit 8d510abe12)
2002-08-22 21:16:11 +00:00
Tim Potter
752f2adec5 Fix compile warnings.
(This used to be commit e84f47a234)
2002-08-22 17:43:27 +00:00
Gerald Carter
c9c404b26c get the access check in addform() correct this time.
Needed to modify OpenPrinter() to store the access granted to
on the print server handle as well.
(This used to be commit 08b3f9688c)
2002-08-22 03:12:10 +00:00
Gerald Carter
85b7d9904e addform fix from SAMBA_2_2
(This used to be commit db286e66ec)
2002-08-21 01:47:29 +00:00
Gerald Carter
42045afda9 segfault fixes merged from APP_HEAD
(This used to be commit cd9ee27d89)
2002-08-20 03:01:37 +00:00
Andrew Bartlett
8674440d81 Based orginally by work by Kai, this patch moves our NT_TOKEN generation into
our authenticaion code - removing some of the duplication from the current
code.

This also gets us *much* closer to supporting a real SAM backend, becouse the
SAM can give us the right info then.

This also changes our service.c code, so that we do a VUID (rather than uid)
cache on the connection struct, and do full NT ACL/NT_TOKEN checks (or cached
equivilant) on every packet, for the same r or rw mode the whole share was open
for.

Andrew Bartlett
(This used to be commit d8122cee05)
2002-08-20 01:54:28 +00:00
Gerald Carter
11b71419b0 add support for the "value,OID" format described in MSDN.
I've not seen this on a real network, but we support it now :-)
(This used to be commit 1ed6f68f6f)
2002-08-19 21:17:22 +00:00
Gerald Carter
2b93ecc90b added wrapper for delete_printer_data() that write the printer out to disk.
(This used to be commit 113d960d77)
2002-08-19 02:18:48 +00:00
Gerald Carter
0231bb451d change notify fix left out of merge by APP_HEAD by accident
(This used to be commit a413ff8b49)
2002-08-19 01:56:15 +00:00
Gerald Carter
12be900ece * Fix DeletePrinterDataEx() to work with arbitrary registry keys
* Fix delete_all_printer_data() to accept a key name for partial tree
  deletions

* Fix EnumPrinterKey() to work with subkeys

* Fix DeletePrinterKey() to work with ful or partial registry
  trees

* Fix get_printer_subkeys() to return a list of unique keynames
  ( some were getting added twice due to subkeys names )

* fix a couple of typos for good measure
(This used to be commit b6ceb8c2e5)
2002-08-18 16:52:51 +00:00
Gerald Carter
50d224a898 fix to allow EnumPrinterKey() to enumerate multiple levels of subkeys.
Works on the top level.  Needs more testing for levels > 1.
(This used to be commit 32a7083843)
2002-08-18 11:11:48 +00:00
Gerald Carter
caf8f949b6 * small formatting fixes
* Fix EnumPrinterKey() to enumerate all printer keys
  ( this will break if we have more than one level deep of printer keys )
(This used to be commit e72184ce13)
2002-08-18 02:10:07 +00:00
Gerald Carter
409d7ff3f5 fixed up a few comments
removed now unused getprinterdata)printer() function
(This used to be commit 2d5e4cdc3a)
2002-08-18 01:02:32 +00:00
Gerald Carter
66992aff21 * fix Get/SetPrinterDataEx() to work with printer key other
than SPOOL_PRINTERDATA_KEY

* created an internal set/get_printer_dataex() call for reuse in
  Set/GetPrinterData()
(This used to be commit 4eb8ffba03)
2002-08-18 00:59:47 +00:00
Gerald Carter
cb36e520b3 * the printing code should now be back to the working state it was
before the swap from NT_PRINTER_PARAM to REGISTRY_VALUE.

* XxxPrinterDataEx() functions have not been expanded to support
  keys other than SPOOL_PRINTERDATA_KEY yet

* fixed apparent long standing bug regarding the dependentfiles
  list in the DRIVER_INFO struct
(This used to be commit d59b0eb123)
2002-08-17 13:17:41 +00:00
Gerald Carter
f56e06476f fix seg fault in _spoolss_enumprinterkey after changes...
add SPOOL_PNPDATA_KEY define
(This used to be commit cdaa3f55e1)
2002-08-17 00:38:20 +00:00
Tim Potter
3a226d149d Return access granted in create_user2.
(This used to be commit 8ebc295f4a)
2002-08-16 17:35:38 +00:00
Gerald Carter
31514f67ae fix small bug in enumprinterdataex due to my changes (still more lurking
though).
(This used to be commit 2feb89601f)
2002-08-16 16:46:50 +00:00
Gerald Carter
4ed429481c Fairly large change to printing code.
* removed support for PHANTOM_DEVMODE printer data

* s/NT_PRINTER_PARAM/REGISTRY_VALUE/g - This was a good bit
  of work.  Everything seems stable, but is not complete.

* support for printer data keys other than PrinterDriverData
  in the store and fetch routines.  Still needs to be plugged
  into the XxxPrinterDataEx() calls.

Tested against NT4.0 & 2k.  Like I said, it's not done, but doesn't
crash so it shouldn't upset anyone (unless you're trying to build
a Samba printer server off of HEAD).  More work to come.  Should
settle by Monday.


jerry
(This used to be commit 7ba7c04c0e)
2002-08-16 15:36:37 +00:00
Andrew Bartlett
b84315e2d5 Return the error if get_group_domain_entries() fails.
(This used to be commit bc9e9e3e2e)
2002-08-16 08:47:10 +00:00
Tim Potter
9b38f76ab1 Rename unknown_0 field in create_user2 reply in the actual struct.
(This used to be commit 482d873c26)
2002-08-15 19:40:34 +00:00
Gerald Carter
14d385439d printing change notification merge from APPLIANCE_HEAD
(This used to be commit 11ddfd9cfa)
2002-08-08 20:54:37 +00:00
Tim Potter
335aa54b46 Merge of incomplete rffpcnex testing code from APPLIANCE_HEAD.
(This used to be commit fe43c2ac2d)
2002-08-08 04:58:19 +00:00
Jim McDonough
5e42dcfe46 Add SAMR 0x3e, which is samr_connect4. Seems to be the same as our
existing connect (which I've been told is really connect2), with one
extra dword.  We've only seen 0x00000002 there...
(This used to be commit 2663446349)
2002-08-06 18:02:56 +00:00
Jim McDonough
89d46eeb33 Add LSA RPC 0x2E, lsa_query_info2. Only level implemented is 0x0c, which
is netbios and dns domain info.  Also add code to set/fetch the domain GUID
from secrets.tdb (although set is not yet called by anyone).
(This used to be commit 31d7168530)
2002-07-30 17:23:07 +00:00
Gerald Carter
c17dc6c55c add another registry rpc (opnum 0x14). Have no idea what it's real name
is.  I'm calling it REG_SAVE_KEY, because 2k preps a regedt32.exe
Registry->Save Key with this call.

Done in the process of tracking down a PrinterDriverData issue.
(This used to be commit 66104a3614)
2002-07-29 19:45:15 +00:00
Gerald Carter
9f7e67c6f9 couple of minor formatting fixes to help me see better.
(This used to be commit 26027ee42a)
2002-07-29 18:10:59 +00:00
Gerald Carter
d7ad31cdea merge from SAMBA_2_2
(This used to be commit c268ae460e)
2002-07-29 13:24:56 +00:00
Andrew Bartlett
86b7abe54c Fix a missing 'no memory' return in last night's svrsvc code, and use
sys_dup2() in a couple more places.

Andrew Bartlett
(This used to be commit e69b476626)
2002-07-28 03:41:50 +00:00
Andrew Bartlett
7ce66f79ea A very long time ago (actually 6 months ago) I promised to commit this code
to the Samba tree.

Originally written by Nigel Williams" <nigel@veritas.com>, I've been
trying to keep it in some form of shape for the last 6 months.  In particular
I think some of the code got committed a few months ago, and others have made
changes to the CVS version over time.

anyway, its finally in - and doesn't appear to have broken anything.

Now to try the client-side patches :-)

Andrew Bartlett
(This used to be commit f9bac7c5c2)
2002-07-27 11:48:55 +00:00
Gerald Carter
a23e96316e 3 things:
* normalize all registry key strings before storing or looking
  up paths in the registry tdb
* return the current buffer size for REG_INFO even when not returning
  actual data
* fix a segfault report by metze on #samba-technical so that the
  user/group object picker works again (was the "ProductType" key
  lookup that was failing).
(This used to be commit 5640e6cdb2)
2002-07-26 22:40:06 +00:00
Andrew Bartlett
a564900074 Mimir has been busy with patches again, and sent in the following
patches:

Andrew Bartlett

From his e-mail:

Below I attach the following patches as a result of my work
on trusted domains support:
 1) srv_samr_nt.c.diff
    This fixes a bug which caused to return null string as
    the first entry of enumerated accounts list (no matter what
    entry, it was always null string and rid) and possibly
    spoiled further names, depeding on their length.
    I found that while testing my 'net rpc trustdom list'
    against nt servers and samba server.
 2) libsmb.diff
    Now, fallback to anonymous connection works correctly.
 3) smbpasswd.c.diff
    Just a little fix which actually allows one to create
    a trusting domain account using smbpasswd
 4) typos.diff
    As the name suggests, it's just a few typos fix :)
(This used to be commit 888d595fab)
2002-07-26 13:05:29 +00:00
Gerald Carter
f1ed55d903 * fix return code so we don't let a client just open any key it wants
(even nonexistent ones).  This gets rid of the Scheduling Agent icon.

* fix NT_STATUS return code for bad registry path (NT_STATUS_NO_SUCH_FILE)
(This used to be commit 915ee5c0ec)
2002-07-24 19:53:49 +00:00
Gerald Carter
a12ed7f506 done! printer_info_2, devicemode, sec_desc, & printer data all enumerate
and display correctly in regedit.exe.

Not sure about REG_SZ values in PrinterDriverData.  If we store these
in UNICODE, I'll have to fix up a few things.

REG_BINARY & REG_DWORD are fine.
(This used to be commit 2a30c243ec)
2002-07-24 08:58:03 +00:00
Gerald Carter
c808cc3643 several changes in this checkin
* added REG_OPEN_HKCR for supporting regedit.exe

* All data n a REGISTRY_VALUE is stored to a pointer now

* fixed REG_INFO to correctly display data when double clicking on
  and entry in the registry editor

* Will now enumerate installed driver_info_3 data

* fixed numerous bugs related to pointer offsets, memory issues, etc..
  in the registry routines

* added a simple caching mechanism to fetch_reg_[keys|values]_specific()

All that is left now is to enumerate PrinterData and I will have finished
what I started out to do....
(This used to be commit 419d7208e8)
2002-07-24 06:42:09 +00:00
Andrew Tridgell
fef9d6187e implemented getgrouplist() for systems that don't have it and use it
in get_alias_user_groups(). The old method used getgrent() which is
extremely slow when the number of groups is large
(This used to be commit 44e92b6523)
2002-07-23 09:22:29 +00:00
Gerald Carter
e8177d1104 * changed structure of REG_R_ENUM_VALUE structure since the BUFFER2
is not and [in/out] buffer

* registry value enumeration is working now for the Print\Forms
  key.  The format of the binary data is not quite right yet
  but all installed forms are listed
(This used to be commit 998eb9c731)
2002-07-23 04:55:06 +00:00
Tim Potter
ff667e0983 Sync with APPLIANCE_HEAD branch (whitespace, const only)
(This used to be commit 11229aa88b)
2002-07-22 21:53:36 +00:00
Tim Potter
fb5153a93b Merge from APPLIANCE_HEAD.
(This used to be commit 825cdc49db)
2002-07-22 21:40:45 +00:00
Tim Potter
c0f66c1786 Name get and set dir drive functions consistently.
(This used to be commit 290a304d2c)
2002-07-21 04:55:11 +00:00
Andrew Bartlett
2582e955e7 More use of intermediate variables to avoid issues with pointer size and casts.
Andrew Bartlett
(This used to be commit 88b68f7972)
2002-07-21 00:08:16 +00:00
Gerald Carter
6dd9f24d05 another intermediate checkin on the way to enumerating forms
via the registry.  There is a seg fault here which shouldn't
bother anyone until I can get it fixed.  I just need
a check point in case I need to roll back to this version later on.
(This used to be commit e62ae94823)
2002-07-20 13:23:57 +00:00
Andrew Bartlett
29075c97d3 More fixes towards warnings on the IRIX compiler
(and yes, some of these are real bugs)

In particular, the samr code was doing an &foo of various types, to a function
that assumed uint32.  If time_t isn't 32 bits long, that broke.

They are assignment compatible however, so use that and an intermediate
variable.

Andrew Bartlett
(This used to be commit 30d0998c8c)
2002-07-20 13:02:47 +00:00
Andrew Bartlett
ea9d3057e9 Try to fix up warnings - particularly on the IRIX 64 bit compiler (which had a
distinction between uchar and char).

Lots of const etc.

Andrew Bartlett
(This used to be commit 8196ee908e)
2002-07-20 11:58:06 +00:00
Gerald Carter
b516eb62db enumeration of printers keys ( no data yet ) via the registry
functions now works :-)
(This used to be commit c5768538f6)
2002-07-20 04:27:30 +00:00
Gerald Carter
9fe3bd1259 * refactored registry operations some. subkey lists and
registry values are now passed around in containers
  (REGSUBKEY_CTR & REGVAL_CTR) which each possess a TALLOC_CTX.

* removed subkey_specific_fn() from REGISTRY_OPS.  Is implemented
  in the form of a wrapper

* temporarily broke the printing registry ops.

* implemented inheritence for the data_p of nodes in a SORTED_TREE

* All REGISTRY_KEY instances now store a valid REGISTRY_HOOK since
  the default REGOSTRY_OPS structure is stored in the root of the
  cache_tree.

* Probably some other change I forgot....  T
(This used to be commit e7b55e8f01)
2002-07-19 18:49:44 +00:00
Gerald Carter
06ae9ac5d9 virtual registry framework with initial printing hooks.
(This used to be commit a43d9788fa)
2002-07-18 23:00:24 +00:00
Jeremy Allison
29426b4a50 Gone back to explicit queue number passing as snum - removed encoding of
queueid in job number. This means we must have an internal tdb to store
mapping from 16 bit RAP jobid's to 32 bit RPC jobids.
Jeremy.
(This used to be commit 4ff64f6970)
2002-07-17 19:12:17 +00:00
Gerald Carter
78750803d0 splitting off storage/retrieval routines for abstracting the
registry view front end.  Now to plug in the various hooks.
(This used to be commit 9772acd9ad)
2002-07-15 22:27:07 +00:00
Andrew Tridgell
159118de5c fixed a number of real bugs found by warnings on the 64 bit irix compiler
(This used to be commit 04de6bbc80)
2002-07-15 10:54:35 +00:00
Andrew Tridgell
369040ac5d fixed a problem with getgroups() where it could include our current
effective gid which could mean that the user gets group 0 in their
group list for acl interpretation

this is a replacement fix for the one richard did in 2.2 (which didn't
cope wiith variable behaviour depending on which nss module was in
use)
(This used to be commit cfc5ca3416)
2002-07-15 03:59:14 +00:00
Jeremy Allison
8ba2c4e55d We must ZERO_STRUCT before using the buffer in copy_unistr2.
Fixes addprinterdriverex.
Jeremy.
(This used to be commit d3c73e5970)
2002-07-12 18:10:24 +00:00
Gerald Carter
bdfe11eaea added copyright
(This used to be commit dcb6d70706)
2002-07-11 13:17:57 +00:00
Gerald Carter
137570cb03 last check in for tonight.
* DeletePrinterDriverEx() now has the ability to delete
    driver files.  I need to do some more testing
    tro veriofy that we are in fact not deleting a file out from
    under another driver, but it looks ok so far.

  * DeletePrinterDriver() noiw deletes all versions of the
    specified driver (cversion == 0, 1, 2, 3)
(This used to be commit 17bb780e13)
2002-07-11 04:53:39 +00:00
Gerald Carter
0aadcff8ec all that is left to do is to actually perform the
file deletion now.  I have the file list.
One more commit should do it.
(This used to be commit 7207662504)
2002-07-11 03:27:12 +00:00
Gerald Carter
496e85dd81 intermediate work on DeletePrinterDriverEx(). This call
will actually delete driver files ( not yet though I don't think).
Just wanted to get it in since Jeremy and I are both
working on nt_printing.c
(This used to be commit 3fa6c31329)
2002-07-11 01:54:26 +00:00
Gerald Carter
18742edd2a fix typo
(This used to be commit be926c3a1a)
2002-07-08 20:30:54 +00:00
Gerald Carter
e247cb8239 added parsing routines for SPOOLSS_ADDPRINTERDRIVEREX and
SPOOLSS_DELETEPRINTERDRIVEREX.  Ran them through some testing.
I know I'm off by 2 x uint32's in the former RPC.
(This used to be commit 55fbfd02ba)
2002-07-08 20:15:47 +00:00
Gerald Carter
100b8986ea * basic implementation of SPOOLSS_DELETEPRINTERDATAEX and
SPOOLSS_DELETEPRINTERKEY
* stub funnctions for SPOOLSS_ADDPRINTERDRIVEREX and
  SPOOLSS_DELETEPRINTERDRIVEREX
(This used to be commit d675974d0c)
2002-07-08 18:34:55 +00:00
Andrew Bartlett
21b9280cf5 Kill off const warnings - add a pile of const to various places.
(This used to be commit 1de04ec473)
2002-07-08 02:14:57 +00:00
Andrew Bartlett
b2be8917e0 Jerry: Sorry if I am stepping on toes here, but this should fix the compile on
solaris CC (void* arithmatic) and fixes the other warnings (global variable
shadows) that gcc has with this file.

Andrew Bartlett
(This used to be commit 7ac6517bec)
2002-07-08 01:06:38 +00:00
Andrew Bartlett
d29d29e4a2 Updates to the 'name -> sid' code:
Correct the 'none mapped' behaviour, (so that it matches Win2k) and  add a
function to make the SID types appear as text strings in logs/rpcclient.

Also, remove a silly case that would cause 'failure' to be 'success'.  (Might
look at this a bit more in future).

Andrew Bartlett
(This used to be commit c20d057f88)
2002-07-07 03:34:24 +00:00
Andrew Bartlett
48316a8c0e Copy the NT_TOKEN to the pipe, so the SAMR can use it for access control.
Andrew Bartlett
(This used to be commit 685a205445)
2002-07-06 05:08:35 +00:00
Tim Potter
b1aec128e4 Remove C++ comments.
(This used to be commit 180374c444)
2002-07-05 04:08:32 +00:00
Gerald Carter
26d161ff85 fixed the geyed out registry keys. Stupid typo on my part.
Now on to plug in the printing tdbs to the registry view....

jerry
(This used to be commit 2a68e4529a)
2002-07-04 13:18:56 +00:00
Andrew Bartlett
e48b3fe83c More code from "Kai Krueger" <kai@kruegernetz.de>, this time starting to make
the 'user cannot change password' button work.  Needs help from a future SAM
backend, but at least this parses the data, and returns an error.

Andrew Bartlett
(This used to be commit 0c4afe075a)
2002-07-04 13:11:54 +00:00
Gerald Carter
fafecde33a * fix seg fault caused by missing DLIST_REMOVE in free_fn()
* fixed constant vaolued returned by REG_UNKNOWN_1A
(This used to be commit 3b934e6a85)
2002-07-04 12:51:26 +00:00
Andrew Bartlett
cd383bdc30 Patch to add security descriptors to the SAMR pipe.
This is not the final solution, I think this will probably changed with the
move to the new SAM subsystem, but it allows some research and gives us
somthing to start with.

It should also help with getting proper NT_TOKEN passing set-up.

Original patch by "Kai Krueger" <kai@kruegernetz.de>, which I have modified to
pass back NTSTATUS returns in more places and to use a little more common code.

Andrew Bartlett
(This used to be commit 43b7249370)
2002-07-04 08:45:45 +00:00
Gerald Carter
a3c3960edc first cut at implementing support for browsing printer and driver driver
via regedt32.exe.  The regsitry.tdb is only a framework.  It is not
intended to store values, only key/subkey structure.  The data
will be retrieved from nt*tdb (for printers) creating a virtual view
of the data.

You can currently connect to a Samba box using regedt32.exe (haven't
tried regedit.exe).  Some basic keys are created in registry.tdb
for use.

There are two problems....

  * something is getting freed in the winreg code that causes heap
    corruption later on.  As long as you don't play with the winreg
    server functionality, I don't think you'll be bitten by this.

  * no access controls are currently implemented

  * I can't browse HKLM because regedt32 greys out the SYSTEM subkey.

ok so that was three....
(This used to be commit 542d3c93a9)
2002-07-03 19:15:26 +00:00
Andrew Bartlett
8e52737efc Break up the passdb objects (to allow RPC clients to link without brining in
*.o) and implment new enum_dom_users code in the SAMR RPC subsystem.

Incresingly, we are using the pdb_get_{user,group}_sid() functions, in the
eventual hope that we might one day support muliple domains off a single
passdb.  To extract the RID, we use sid_peek_check_rid(), and supply an
'expected' domain SID.

The id21 -> SAM_ACCOUNT and id23 -> SAM_ACCOUNT code has been moved to
srv_samr_util.c, to ease linking in passdb users.

Compatiblity code that uses 'get_global_sam_sid()' for the 'expected' sid is in
pdb_compat.c

Andrew Bartlett
(This used to be commit 5a2a6f1ba3)
2002-07-03 07:37:54 +00:00
Jeremy Allison
82176f4d85 Address the string_sub problem by changing len = 0 to mean "no expand".
Went through and checked all string_subs I could to ensure they're being
used correctly.
Jeremy.
(This used to be commit 17cae0d683)
2002-07-02 06:34:27 +00:00
Tim Potter
5106ead0e0 Merge of constant renames from APPLIANCE_HEAD.
(This used to be commit daf4c6a013)
2002-07-02 04:07:32 +00:00
Andrew Tridgell
9930b0b065 used findstatic.pl to make some variables static and remove some dead
code
(This used to be commit 91ad9041e9)
2002-07-01 09:12:41 +00:00
Jeremy Allison
f201450f39 Added limit on SPOOLSS pipes from 2.2.x
Jeremy.
(This used to be commit b35fc30c37)
2002-06-28 19:41:17 +00:00
Jeremy Allison
452eb38df0 Proper merge of all the working printing stuff from APPLIANCE_HEAD.
Now let's keep this in sync !
Jeremy.
(This used to be commit 3603cd4947)
2002-06-28 00:17:15 +00:00
Andrew Bartlett
8e387b8178 I'm going to try and check this against Win2k shortly, but I'm certain that
'NT_STATUS_OK' is not the right answer here.  Try NO_MORE_ENTRIES for now.

Andrew Bartlett
(This used to be commit c98b9a9659)
2002-06-25 11:21:41 +00:00
Gerald Carter
2e148c865a compile fix
(This used to be commit b07d6d4ceb)
2002-06-24 20:09:34 +00:00
Gerald Carter
900fb62238 printing merge from SAMBA_2_2. Ther server code looks to be in sync now.
Mostly formatting and s/free/SAFE_FREE/g changes with the two exceptions
being

  * John driver init changes
  * Tim's printer enumeration bug fix
(This used to be commit f753676286)
2002-06-24 19:51:23 +00:00
Simo Sorce
a60e37096d more debug classess activated
(This used to be commit 897e64d2e0)
2002-06-18 09:20:13 +00:00
Andrew Bartlett
ac08646c37 Rework much of the service.c code:
The aim of this execise is to give the 'security>=user' code a straight paper
path.  Security=share will sill call authorise_login(), but otherwise we avoid
that mess.

This allow *much* more accurate error code reporting, beocuse we don't start
pretending that we can use the (nonexistant) password etc.

Also in this patch is code to create the 'homes' share at session setup time
(as we have done in the past - been broken recently) and to record this on
the user's vuser struct for later reference.  The changes here should also
allow for much better use of %H (some more changes to come here).

The service.c changes move a lot of code around, but are not as drastric
as they look...

(Also included is a fix to srv_srvsvc_nt.c where 'total_entries' not
'*total_entries' was compared).

This code is needs testing, but passes my basic tests.

I expect we have lost some functionality, but the stuff I had expected
to loose was already broken before I started.  In particular, we don't 'fall
back' to guest if the user cannot access a share (for security=user).  If you
want this kind of stuff then you really want security=share anyway.

Andrew Bartlett
(This used to be commit 4c0cbcaed9)
2002-06-15 12:38:13 +00:00
Andrew Bartlett
843a467f21 Update the netlogon code to better cope with trusted domains, where things
like the domain name and SID come from the remote domain, not the local
one.  These are filled out by the code from the previous commit (auth_util.c,
the make_server_info_info3() fn) and read back here.

Andrew Bartlett
(This used to be commit 6872de2e5b)
2002-06-15 11:40:25 +00:00
Andrew Bartlett
baef1358d2 Add const, kill of useless casts and therefore eliminate warnings.
Andrew Bartlett
(This used to be commit 29490f2147)
2002-06-14 00:47:08 +00:00
Andrew Bartlett
bad738e653 Latest patch from metze <metze@metzemix.de> to move most of samba across
to using SIDs instead of RIDs.

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

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

Andrew Bartlett
(This used to be commit 04f9a8ff4c)
2002-06-13 14:06:08 +00:00
Gerald Carter
366a649d04 merge from 2.2
(This used to be commit 30a0e72572)
2002-06-11 03:22:32 +00:00
Andrew Bartlett
ae6bdb2cd5 This (hopefully) fixes a bug reported by Kai Krueger <kai@kruegernetz.de>
involving the use of lp_winbind_gid() without checking if they have been
set.

Also revert the 'clashing user' check back to a Get_Pwnam() - I probably should
never have changed it.

Andrew Bartlett
(This used to be commit 1d6ba40558)
2002-06-09 08:45:35 +00:00
Andrew Bartlett
b0ffabdcca Globally replace 'global_sam_sid' with get_global_sam_sid(), a self
initialising function.  This patch thanks to the work of
"Stefan (metze) Metzmacher" <metze@metzemix.de>

This is partly to enable the transition to SIDs in the the passdb.

Andrew Bartlett
(This used to be commit 96afea638e)
2002-06-07 14:33:33 +00:00
Tim Potter
89e9f7530a Fix compile error - doh!
(This used to be commit e80e663706)
2002-06-06 01:34:04 +00:00
Tim Potter
617a551c42 Moved some notify related constants into srv_spoolss_nt.c since
they're only used there.

Added a PRINTER_NOTIFY_VERSION constant.
(This used to be commit 9d3933a592)
2002-06-06 01:19:56 +00:00
Tim Potter
bfa2dfaba8 Fixed out of date comment for _spoolss_rffpcnex()
(This used to be commit 7d9b8c58a6)
2002-06-06 00:59:52 +00:00
Andrew Bartlett
ebe58d8569 Update the SAMR pipe for more use of NTSTATUS and to talloc the stored list of
users/groups for better memory accounting.

Andrew Bartlett
(This used to be commit fe7c5efe91)
2002-06-04 23:10:02 +00:00
Jim McDonough
e142b4b324 Fix netsessenum RPC. Correctly respond with as much info as we can.
(This used to be commit c8781a3fda)
2002-06-03 22:14:43 +00:00
Tim Potter
c3bd192703 Restrict anonymous checks for the SAMR pipe. This is done by
returning access denied for a SAMR_CONNECT by an anonymous user which
seems to be the way 2K does it rather than blocking individual RPC
calls like NT.

Also checked is the SAMR_GET_DOM_PWINFO rpc which for some reason
doesn't require a policy handle to return information.  No idea what
it's actually used.
(This used to be commit 40c68fa85c)
2002-06-03 03:02:39 +00:00
Tim Potter
d706b5dc55 Move restrict anonymous checks into a general function called
pipe_access_check().  Eventually this can take a security descriptor
as an argument as well.
(This used to be commit 8bbdc674af)
2002-06-03 02:55:16 +00:00
Jim McDonough
e422b271da Update netfileenum on both client and server sides to do an arbitrary number
of files.  This was done to better enable net rpc file.  Perhaps we can start
giving back real info this way, too.
(This used to be commit b3fea72ee9)
2002-05-31 17:02:09 +00:00
Tim Potter
c3fb0cd9ed Return access denied for net_share_enum when restrict anonymous > 0
(This used to be commit 5df1aa9f20)
2002-05-31 00:48:40 +00:00
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