1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

1067 Commits

Author SHA1 Message Date
Gerald Carter
26027ee42a couple of minor formatting fixes to help me see better. 0001-01-01 00:00:00 +00:00
Gerald Carter
c268ae460e merge from SAMBA_2_2 0001-01-01 00:00:00 +00:00
Andrew Bartlett
e69b476626 Fix a missing 'no memory' return in last night's svrsvc code, and use
sys_dup2() in a couple more places.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
f9bac7c5c2 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
0001-01-01 00:00:00 +00:00
Gerald Carter
5640e6cdb2 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).
0001-01-01 00:00:00 +00:00
Andrew Bartlett
888d595fab 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 :)
0001-01-01 00:00:00 +00:00
Gerald Carter
915ee5c0ec * 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)
0001-01-01 00:00:00 +00:00
Gerald Carter
2a30c243ec 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.
0001-01-01 00:00:00 +00:00
Gerald Carter
419d7208e8 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....
0001-01-01 00:00:00 +00:00
Andrew Tridgell
44e92b6523 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
0001-01-01 00:00:00 +00:00
Gerald Carter
998eb9c731 * 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
0001-01-01 00:00:00 +00:00
Tim Potter
11229aa88b Sync with APPLIANCE_HEAD branch (whitespace, const only) 0001-01-01 00:00:00 +00:00
Tim Potter
825cdc49db Merge from APPLIANCE_HEAD. 0001-01-01 00:00:00 +00:00
Tim Potter
290a304d2c Name get and set dir drive functions consistently. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
88b68f7972 More use of intermediate variables to avoid issues with pointer size and casts.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
e62ae94823 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.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
30d0998c8c 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
8196ee908e 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
0001-01-01 00:00:00 +00:00
Gerald Carter
c5768538f6 enumeration of printers keys ( no data yet ) via the registry
functions now works :-)
0001-01-01 00:00:00 +00:00
Gerald Carter
e7b55e8f01 * 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
0001-01-01 00:00:00 +00:00
Gerald Carter
a43d9788fa virtual registry framework with initial printing hooks. 0001-01-01 00:00:00 +00:00
Jeremy Allison
4ff64f6970 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.
0001-01-01 00:00:00 +00:00
Gerald Carter
9772acd9ad splitting off storage/retrieval routines for abstracting the
registry view front end.  Now to plug in the various hooks.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
04de6bbc80 fixed a number of real bugs found by warnings on the 64 bit irix compiler 0001-01-01 00:00:00 +00:00
Andrew Tridgell
cfc5ca3416 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)
0001-01-01 00:00:00 +00:00
Jeremy Allison
d3c73e5970 We must ZERO_STRUCT before using the buffer in copy_unistr2.
Fixes addprinterdriverex.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
dcb6d70706 added copyright 0001-01-01 00:00:00 +00:00
Gerald Carter
17bb780e13 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)
0001-01-01 00:00:00 +00:00
Gerald Carter
7207662504 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.
0001-01-01 00:00:00 +00:00
Gerald Carter
3fa6c31329 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
0001-01-01 00:00:00 +00:00
Gerald Carter
be926c3a1a fix typo 0001-01-01 00:00:00 +00:00
Gerald Carter
55fbfd02ba 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.
0001-01-01 00:00:00 +00:00
Gerald Carter
d675974d0c * basic implementation of SPOOLSS_DELETEPRINTERDATAEX and
SPOOLSS_DELETEPRINTERKEY
* stub funnctions for SPOOLSS_ADDPRINTERDRIVEREX and
  SPOOLSS_DELETEPRINTERDRIVEREX
0001-01-01 00:00:00 +00:00
Andrew Bartlett
1de04ec473 Kill off const warnings - add a pile of const to various places. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
7ac6517bec 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
c20d057f88 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
685a205445 Copy the NT_TOKEN to the pipe, so the SAMR can use it for access control.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Tim Potter
180374c444 Remove C++ comments. 0001-01-01 00:00:00 +00:00
Gerald Carter
2a68e4529a fixed the geyed out registry keys. Stupid typo on my part.
Now on to plug in the printing tdbs to the registry view....

jerry
0001-01-01 00:00:00 +00:00
Andrew Bartlett
0c4afe075a 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
0001-01-01 00:00:00 +00:00
Gerald Carter
3b934e6a85 * fix seg fault caused by missing DLIST_REMOVE in free_fn()
* fixed constant vaolued returned by REG_UNKNOWN_1A
0001-01-01 00:00:00 +00:00
Andrew Bartlett
43b7249370 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
0001-01-01 00:00:00 +00:00
Gerald Carter
542d3c93a9 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....
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5a2a6f1ba3 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
0001-01-01 00:00:00 +00:00
Jeremy Allison
17cae0d683 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.
0001-01-01 00:00:00 +00:00
Tim Potter
daf4c6a013 Merge of constant renames from APPLIANCE_HEAD. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
91ad9041e9 used findstatic.pl to make some variables static and remove some dead
code
0001-01-01 00:00:00 +00:00
Jeremy Allison
b35fc30c37 Added limit on SPOOLSS pipes from 2.2.x
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3603cd4947 Proper merge of all the working printing stuff from APPLIANCE_HEAD.
Now let's keep this in sync !
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
c98b9a9659 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
0001-01-01 00:00:00 +00:00
Gerald Carter
b07d6d4ceb compile fix 0001-01-01 00:00:00 +00:00
Gerald Carter
f753676286 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
0001-01-01 00:00:00 +00:00
Simo Sorce
897e64d2e0 more debug classess activated 0001-01-01 00:00:00 +00:00
Andrew Bartlett
4c0cbcaed9 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
6872de2e5b 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
29490f2147 Add const, kill of useless casts and therefore eliminate warnings.
Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
04f9a8ff4c 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
0001-01-01 00:00:00 +00:00
Gerald Carter
30a0e72572 merge from 2.2 0001-01-01 00:00:00 +00:00
Andrew Bartlett
1d6ba40558 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
96afea638e 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
0001-01-01 00:00:00 +00:00
Tim Potter
e80e663706 Fix compile error - doh! 0001-01-01 00:00:00 +00:00
Tim Potter
9d3933a592 Moved some notify related constants into srv_spoolss_nt.c since
they're only used there.

Added a PRINTER_NOTIFY_VERSION constant.
0001-01-01 00:00:00 +00:00
Tim Potter
7d9b8c58a6 Fixed out of date comment for _spoolss_rffpcnex() 0001-01-01 00:00:00 +00:00
Andrew Bartlett
fe7c5efe91 Update the SAMR pipe for more use of NTSTATUS and to talloc the stored list of
users/groups for better memory accounting.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jim McDonough
c8781a3fda Fix netsessenum RPC. Correctly respond with as much info as we can. 0001-01-01 00:00:00 +00:00
Tim Potter
40c68fa85c 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.
0001-01-01 00:00:00 +00:00
Tim Potter
8bbdc674af Move restrict anonymous checks into a general function called
pipe_access_check().  Eventually this can take a security descriptor
as an argument as well.
0001-01-01 00:00:00 +00:00
Jim McDonough
b3fea72ee9 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.
0001-01-01 00:00:00 +00:00
Tim Potter
5df1aa9f20 Return access denied for net_share_enum when restrict anonymous > 0 0001-01-01 00:00:00 +00:00
Tim Potter
ca61f68d5c Cleaned up srvsvc constants a bit. 0001-01-01 00:00:00 +00:00
Simo Sorce
f5c6496c33 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.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
cdcfe3671e 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
0001-01-01 00:00:00 +00:00
Gerald Carter
f0226a1d83 merge from SAMBA_2_2 0001-01-01 00:00:00 +00:00
Gerald Carter
83f109c940 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
9d8431b04f Add a bit more const, and kill of (finally!) sys_getpwnam and sys_getpwuid.
These might be reimplmented as simple pass-through functions, but all users
really should be doing 'getpwnam_alloc' or 'getpwuid_alloc' to ensure that
there are not shared static buffers.

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

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

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Tim Potter
92b36482fd Patch to only set SV_TYPE_PRINTQ_SERVER in default_server_announce if a
print share is exported.  Needs some more testing.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
d78b74b338 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
c28668068b A few things in this commit:
cleanup some of the code in net_rpc_join re const warnings and
fstrings.

Passdb:

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

Finally these things actually seem to work properly...

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

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

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

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

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

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

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

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
d57a1b4629 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
0001-01-01 00:00:00 +00:00
Jeremy Allison
fc043110bc 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
32fa089ade Merged in printing fixes... There were many missing !
Jeremy
0001-01-01 00:00:00 +00:00
Shirish Kalele
d926cc9896 Sync'ing SAMBA_2_2 with HEAD. 0001-01-01 00:00:00 +00:00
Jeremy Allison
7c02db7c4f Fix my stupid compile bug in num_files_open.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3a93c5daec Fix for a bug Jerry found with printing where a smbd connection may
be idled even with an open pipe.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
5e381abbbf merge from SAMBA_2_2 0001-01-01 00:00:00 +00:00
Jeremy Allison
f988a1af03 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.
0001-01-01 00:00:00 +00:00
Tim Potter
bc673c4204 Merge of print server permission handling fixes from HEAD.
Unit tests rock!
0001-01-01 00:00:00 +00:00
Andrew Bartlett
0bdd94cb99 Partly based on the work by mimir (Rafal Szczesniak
<mimir@diament.ists.pwr.wroc.pl>) this patch allows samba to correctly
enumerate its trusted domains - by exaimining the keys in the secrets.tdb file.

This patch has been tested with both NT4 and rpcclient/wbinfo, and adds
some extra functionality to talloc and rpc_parse to allow it to deal with
already unicode strings.

Finally, this cleans up some const warnings that were in net_rpc.c by pushing
another dash of const into the rpc client code.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
79327a305e 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
0001-01-01 00:00:00 +00:00
Jeremy Allison
42ae2334f2 Correctly emulate NT in printer handle opening access rights.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
d7c9b00253 s/werror_str/dos_errstr/g to fix compile 0001-01-01 00:00:00 +00:00
Gerald Carter
7db47c6647 merge from 2.2 0001-01-01 00:00:00 +00:00
Gerald Carter
32dc5dbbfb WERROR merge from SAMBA_2_2 0001-01-01 00:00:00 +00:00
Jeremy Allison
16015c07ea Added Shirish's client side caching policy change.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
49e429a97f Fixed typo in debug statement. 0001-01-01 00:00:00 +00:00
Tim Potter
be6f955107 Fixed some compiler warnings. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
e60c509813 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
0001-01-01 00:00:00 +00:00
Jeremy Allison
b8b88e863e Fix Gerry bug - MajorVersion should be 2 not 3.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
3e58e9dbab Removed unused variable. 0001-01-01 00:00:00 +00:00
Jeremy Allison
f029bd348c 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c6566fa5fa Don't core dump listing thousands of users in usrmgr.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
f169f3f4df Ensure we return a parseable value if invalid handle given.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
606450f3cb merge from SAMBA_2_2 0001-01-01 00:00:00 +00:00
Gerald Carter
fe099006bb merge from SAMBA_2_2 0001-01-01 00:00:00 +00:00
Gerald Carter
619397cc90 OpenPrinter() merge from 2.2 0001-01-01 00:00:00 +00:00
Jeremy Allison
3b1b8ac435 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.
0001-01-01 00:00:00 +00:00
Tim Potter
e66bdf1229 Stomped on some header file version numbers that have crept back in. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
56009ffbaa Make sure to initaliase SAM_ACCOUNT pointers to NULL, otherwise pdb_init_sam()
fails.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
9282aa02d4 merge from APPLIANCE_HEAD 0001-01-01 00:00:00 +00:00
Gerald Carter
88d8897e21 resetprinter merge from SAMBA_2_2 0001-01-01 00:00:00 +00:00
Tim Potter
47b1003bc5 Merge from app-head:
> Don't put two copies of the server name in construct_printer_info_1()
0001-01-01 00:00:00 +00:00
Simo Sorce
aa4b6f8181 second step to gain free uid<->rid mapping
we still need to free gid<->rid mapping and few other stuff
0001-01-01 00:00:00 +00:00
Jeremy Allison
2e3133fbe5 Merge in JohnR's page count fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Simo Sorce
9836af7cd6 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.
0001-01-01 00:00:00 +00:00
Tim Potter
ddb5753e36 Added dos_errstr() function. Not all errors in list yet. 0001-01-01 00:00:00 +00:00
Tim Potter
1f007d3ed4 Renamed get_nt_error_msg() to nt_errstr(). 0001-01-01 00:00:00 +00:00
Gerald Carter
5760315c1d 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
0001-01-01 00:00:00 +00:00
Tim Potter
d7efc5dd3d Backed out enumprinters stuff - leave it for another day. 0001-01-01 00:00:00 +00:00
Tim Potter
dfd51bc8d0 Merge of enumprinters vs getprinter naming patch from 2.2 0001-01-01 00:00:00 +00:00
Andrew Tridgell
f56d689497 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
0001-01-01 00:00:00 +00:00
Gerald Carter
66eb969ade merge from 2.2 0001-01-01 00:00:00 +00:00
Gerald Carter
4960692e95 merge from 2.2 0001-01-01 00:00:00 +00:00
Jeremy Allison
d31d2dcd22 Turns out an Admin user shouldn't always have access on a handle.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
2b3609a7dd 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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
2b85d3570c Fix the NTSTATUS -> WERROR for srvsvc pipe.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
a7fa0733ba Spelling fixes. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
ffa6c61f0b Some more fixes to enusre we execute the same code pathes as before this
change, just in different packets.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
542673fcd6 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
0242d0e178 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
0001-01-01 00:00:00 +00:00
Jeremy Allison
28d4e7a3e2 Fixup the sending of printer change messages from job changes.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
c8dc59dfe8 Merge of printing performance fixes from appliance. 0001-01-01 00:00:00 +00:00
Gerald Carter
505119f0a7 merge from 2.2 0001-01-01 00:00:00 +00:00
Gerald Carter
63ab947fd9 merge from 2.2 0001-01-01 00:00:00 +00:00
Gerald Carter
25fb4a8d11 merge from 2.2 0001-01-01 00:00:00 +00:00
Gerald Carter
696d439515 merge from APPLIANCE_HEAD 0001-01-01 00:00:00 +00:00
Gerald Carter
e18a7c2647 merge from 2.2 0001-01-01 00:00:00 +00:00
Gerald Carter
09fc979172 merge from 2.2 0001-01-01 00:00:00 +00:00
Jeremy Allison
771ef92fc6 Bring printing in HEAD inline with 2.2.x and app-head.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
e734c1971d merge from APPLIANCE_HEAD 0001-01-01 00:00:00 +00:00
Tim Potter
3cd97d65de 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.  )-:
0001-01-01 00:00:00 +00:00
Andrew Tridgell
9930cf9733 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.
0001-01-01 00:00:00 +00:00
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
0001-01-01 00:00:00 +00:00
Gerald Carter
e3b87ffc8c merge from APPLIANCE_HEAD 0001-01-01 00:00:00 +00:00
Andrew Bartlett
e7b3d64f60 Add the become_root()/unbecome_root() wrapper around the lookup_name() call,
and its new args.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
6e7667125d 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
0001-01-01 00:00:00 +00:00
Andrew Bartlett
4fc9e16ad7 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
0001-01-01 00:00:00 +00:00
Jeremy Allison
27f65b3aad Fixed ADDPRINTEREX to take a devmode and a security descriptor...
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
5f4de275a3 Make systemtime work for spooling on bigendian systems. Fix from
Benjamin (Bj) Kuit bj@it.uts.edu.au.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0db93d8752 Return correct RPC fault PDU on bad handle incoming.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
6025ab201a Sync up startpageprinter with appliance. 0001-01-01 00:00:00 +00:00