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

664 Commits

Author SHA1 Message Date
Jeremy Allison
5690ec77c8 Modified version of Jim's 0x27 and 0x28 Win9x Secdesc patch.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
bc366f3153 Jim McDonough's parse patches for Win9x get SD calls.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a600c96e59 Fixed typo spotted by "Jim McDonough" <jmcd@us.ibm.com>....
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
d2eafa7483 Add password length field to SAM_USER_INFO24 structure and fix init
and parse function.
0001-01-01 00:00:00 +00:00
Tim Potter
13df2304b3 Added some msdfs client routines. 0001-01-01 00:00:00 +00:00
Tim Potter
35d2794114 Converted init_samr_q_lookup_names() and samr_io_q_lookup_names()
to use tallocated memory instead of dodgy static arrays.
0001-01-01 00:00:00 +00:00
Tim Potter
870e9e4e89 Added *.po to .cvsignore files. 0001-01-01 00:00:00 +00:00
Tim Potter
8ba30031a4 Added a init function for net_q_logon_ctrl2 so we can make this call
from rpcclient.

Added init and i/o functions for net_{q,r}_logon_ctrl functions so we
can call from rpcclient and respond to this call from smbd.
0001-01-01 00:00:00 +00:00
Gerald Carter
09506ac0e6 merge from 2.2 DeletePrinterDriver() server side stud coming
in separate commit after I get it working in 2.2.
0001-01-01 00:00:00 +00:00
Tim Potter
5bbd946d59 Reverted samr_io_userinfo_ctr() patch because it broke too much other
stuff.  (-:
0001-01-01 00:00:00 +00:00
Tim Potter
fc44cec0de So the samr_io_userinfo_ctr was requiring a SAM_USERINFO_CTR to be passed
in as well as tallocating space for one itself.  I've deleted code so the
passed in container is used to store the SAM user info.  This may have
broken some server side SAM stuff which probably isn't used anyway.  )-:
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
62a7a567fd fixes to the group mapping code.
Not ready yet.

	J.F.
0001-01-01 00:00:00 +00:00
Tim Potter
a8c49d1e60 Fixed typo in comment. 0001-01-01 00:00:00 +00:00
Tim Potter
139e767e78 iinit_samr_q_lookup_rids() didn't actually copy the rids into the
parse structure.
0001-01-01 00:00:00 +00:00
Tim Potter
d384cae570 Renamed unknown field to access mask in open alias parsing functions. 0001-01-01 00:00:00 +00:00
Jeremy Allison
9b3dd80176 Added code from "Nigel Williams" <nigel@veritas.com> (yes, the same famous
Nigel Williams who did NIS/GINA !) to implement add/modify/delete shares
for Win2k. Needs testing as I made a few mods to the original code.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
0feaac00a1 few cleanups to bring in line with 2.2 0001-01-01 00:00:00 +00:00
Gerald Carter
0a6ceed279 rpcclient merge from 2.2 (including Jeremy's non-void return fix) 0001-01-01 00:00:00 +00:00
Jeremy Allison
f4f4aae675 Added Herb's comment fix.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
6248fb2292 Fix "proc num out of range" error. Missing rpc call.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
fc76681812 Merge of Andrew's changes in 2.2.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
04976c32f3 Set SD's for share. Added level 1501. Map GENERIC file bits to specific bits.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
94747b4639 Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3512ba1f65 Implemented stub function for NET_SHARE_DELETE. Now to implement the real
internals to support server manager.
Jeremy
0001-01-01 00:00:00 +00:00
Jeremy Allison
a2cd5f2ba1 Added stub function for NET_SHARE_ADD. Once this is implemented to call a hook
function (same for NET_SHARE_DELETE and NET_SHARE_SET) we will be able to manage
the shares section in smb.conf via NT server manager........
This should enhance the friendliness of Samba in NT-only shops by an order of
magnitude.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3bfd155ba7 I know we're supposed to be feature frozen, but I couldn't resist this... :-).
I worked out and added the per-share get/set RPCs for security descriptors.
Currently this code returns Everyone, full access on get and permission denied
on set, but backending this with a tdb and checking it on tconX (to give full NT
semantics for security on shares) is now an excersise for the reader... :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
887ef3e12d include/ntdomain.h:
rpc_server/srv_lsa_hnd.c: Remove back pointer from policy handle list as the pipe
						that opened the handle may have been closed. We were dereferencing
						into something that had been closed.
rpc_parse/parse_spoolss.c: Sync up with Gerald's changes in 2.2.
lib/replace.c: Don't do proto on setlinebuf as it differs between systems.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
13765eca71 configure configure.in include/config.h.in lib/replace.c: Added test and replacement
for setlinebuf which apparantly doesn't exist on HPUX 11.
include/byteorder.h:
rpc_parse/parse_prs.c:
Ding Dong the witch is dead ! :-). Ok, I'm happy 'cos I've finally deleted
all the *HORRIBLE* DBG_RW_XXX and RW_XXX macros from include/byteorder.h.
They were macros that included macros that had conditional macros included.
No one understood them (they were the cause of most of the bigendian issue
bugs). Finally, I went into parse_prs.c and inlined all of that stuff with
regular function calls. They're understandable, they're easy to edit and
they don't include macros !
JF - please look at the one comment I added (JF PLEASE CHECK). I have
tested this partly with IRIX (a bigendian system) running with AS/U on
a Solaris box in SGI's lab, and I've also confirmed these new changes
work with W2K (vmware) but there may be the odd bug lurking. Herb, if
you could re-checkout and test again with this code that would help.

Extra.  Fixed bug spotted by the sharp eyes of JF - big endian unicode
packet would cause a early truncate of string parsing as we were checking for a char *
0, not a uint16 * 0.

Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
ea963a648b rename of 16 new_smb_io functions to smb_io_* for consistency sake
(merge from 2.2)
0001-01-01 00:00:00 +00:00
Gerald Carter
817258f117 merge from 2.2. 0001-01-01 00:00:00 +00:00
Gerald Carter
fd6bfe03f4 reverted the rename of new_spoolss_io_r_enumprinterdrivers() 0001-01-01 00:00:00 +00:00
Jeremy Allison
c0345bbaed Added Michael Sweet's CUPS patch to call directly into the CUPS backend.
Parameterises the printing functions so other backends can be plugged
directly in (this is a good thing :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
f37ba49c28 whoops...forgot one 0001-01-01 00:00:00 +00:00
Gerald Carter
cbce0c9350 renamed one of the enumprinterdrivers parsing functions
for consistency sake.
0001-01-01 00:00:00 +00:00
Jeremy Allison
500c7bc0fe rpc_parse/parse_samr.c: Removed unneeded deubg.
rpc_server/srv_netlog_nt.c: Ensure we marshall a bad password return correctly
to a w2k client.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
017a6a9868 We were mismarshalling a netlogon reply for bad password to W2K.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0185f8159d We copy the RPC header directly from the incoming client - remember to
set little-endian flag on marshalling. AS/U now correctly tries to join
our domain !
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d23b9be1ba No longer used...
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0be41d5158 Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0cd37c831d Serious (and I *mean* serious) attempt to fix little/bigendian RPC issues.
We were reading the endainness in the RPC header and then never propagating
it to the internal parse_structs used to parse the data.
Also removed the "align" argument to prs_init as it was *always* set to
4, and if needed can be set differently on a case by case basis.
Now ready for AS/U testing when Herb gets it set up :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0e6a34510e Sync up handle creation with 2.2 branch. We can now join AS/U domains and
authenticate against them. Big/little endian issues fixed.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c3a1904564 Merged JF's fixes into HEAD. These are for string parsing and SAMR fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
1552db715d rpc_parse/parse_spoolss.c: Fixed memory leak introduced by restructuring.
rpc_server/srv_spoolss_nt.c: Fixed problem with printer snum being read uninitialised.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3495d5cc3b Remove unused code.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
14d5997dc8 Move to talloc control of SPOOL_XXX structs. Move to talloc control of
security descriptors and pointers. Syncup with 2.2 tree.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d3a56c6042 Added total memory allocated counter to talloc, so we can tell if a talloc
pool is getting bloated. Also added a talloc_zero function to return zeroed memory.
Added debug in rpc_server/srv_pipe_hnd.c so we know when a talloc pool is being
freed. Syncup with srv_pipe_hnd.c from 2.2 so we are freeing memory at the same time.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
94fdffb355 As prs_alloc_mem now zeros memory, remove superfluous memsets after it.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c9a6a17025 Separated dfs pipe into implementation and interface modules.
rpc_parse/parse_dfs.c: Had to add buffer overrun checking ! HOW DID THIS GET IN HERE !
rpc_parse/parse_prs.c: Ensure prs_alloc_mem does a memset of zero before returning.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e14c88ddf4 Split srvsvc pipe into interface and implementation modules.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
f434cda977 Started conversion of lsa server code to canonical format (as srv_reg and
srv_samr have been).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
bda1d6d4a4 This patch (donated by Marc Jacobsen of HP) should make Sun and HP very happy :-).
Probably Veritas too... :-).
It allows Samba as a domain member to authenticate against an AS/U server such
as the older HP PDC product or PD Netlink. It does this by trying a netlogon
with info level 3 and then falling back to info level 2 if the PDC returns
invalid info level.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e7108a18b2 but it is needed for linking ... 0001-01-01 00:00:00 +00:00
Jeremy Allison
41d46a495b Fixup missing tests on code imported from tng.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c0517d6f4e Merge of JohnR's changes to appliance-head, JF's changes to 2.2,
updated the POSIX_ACL code to be in sync.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
5b38513cef Fixed duplicate free_sec_acl() call in free_sec_desc() function.
From "Richard Bollinger" <rabollinger@home.com>
0001-01-01 00:00:00 +00:00
David O'Neill
f24aa0b51f Changes from SAMBA_2_2:
- fix typo in cast from talloc
0001-01-01 00:00:00 +00:00
Jeremy Allison
f76dc952f7 Fixed "object picker can't determine if object in domain" bug seen from W2K
clients. Did this by importing Samba-TNG code that correctly handles LSA
lookups.
*MANY* thanks to Luke, Sander, Elrond and the rest of the TNG gang !
Jeremy
0001-01-01 00:00:00 +00:00
David O'Neill
7853b27bc1 Changes from APPLIANCE_HEAD:
source/include/proto.h
    source/include/rpc_spoolss.h
    source/rpc_parse/parse_spoolss.c
    source/rpc_server/srv_spoolss.c
    source/rpc_server/srv_spoolss_nt.c
        - speedups in printer queue enumeration  - still room for
          improvement.  The construct_dev_mode() still creates and destroys
          a printer info_2 structure every time it is called.
        - fixed job->devmode memory leak
        - converted printer job notification routines to use tallocated
          memory rather than a fixed 2K buffer.   This reduces the memory
          requirements of a 4500 job queue enumeration from 90MB to about
          16MB.
0001-01-01 00:00:00 +00:00
David O'Neill
59229b9025 Changes from APPLIANCE_HEAD:
source/rpc_parse/parse_lsa.c
        - off by one unistr length bug in init_lsa_trans_name()

    source/lib/util_sid.c
        - resolve more BUILTIN sid values to names.

    source/nsswitch/wb_client.c
        - fix typo in debug message
        - set errno on error so we don't get bogus value from last failure.

    source/rpc_server/srv_spoolss_nt.c
        - add debug to track number of open printer handles for ease of
          tracking handle leaks in the future.

    source/rpc_server/srv_lsa.c
        - fix off-by-one string bug.  This was preventing NT from
          displaying names for well-know SIDs in printer permissions
          dialog.
0001-01-01 00:00:00 +00:00
Tim Potter
a125eba0aa Printer name unistr is null terminated in make_spoolss_q_open_printer_ex() 0001-01-01 00:00:00 +00:00
Tim Potter
793153ebde RPC server fixes for RPC client changes merged from TNG. 0001-01-01 00:00:00 +00:00
Tim Potter
c292f4aa31 General clean up. Merge of access_mask fixes for some unknown fields from
tng.
0001-01-01 00:00:00 +00:00
Tim Potter
54b34517ce General clean up. Merged routines for parsing enum_trust_dom rpc call. 0001-01-01 00:00:00 +00:00
David O'Neill
376601d17d Changes from APPLIANCE_HEAD:
testsuite/printing/psec.c
        - Use lock directory from smb.conf parameter when peeking at the
          ntdrivers.tdb file.
    source/rpc_parse/parse_sec.c
        - fix typo in debug message
    source/script/installbin.sh
        - create private directory as part of 'make install'.
    source/nsswitch/winbindd_cache.c
    source/nsswitch/winbindd_idmap.c
    source/passdb/secrets.c
    source/smbd/connection.c
        - always convert tdb key to unix code-page when generating.
    source/printing/nt_printing.c
        - always convert tdb key to unix code-page when generating.
        - don't prepend path to a filename that is NULL in
          add_a_printer_driver_3().
    source/rpc_server/srv_spoolss_nt.c
        - always convert tdb key to unix code-page when generating.
        - don't prepend server name to a path/filename that is NULL in the
          fill_printer_driver_info functions.
    source/printing/printing.c
        - always convert tdb key to unix code-page when generating.
        - move access check for print_queue_purge() outside of job delete
          loop.
    source/smbd/unix_acls.c
        - fix for setting ACLs (this got missed earlier)
    source/lib/messages.c
        - trivial sync with appliance_head
0001-01-01 00:00:00 +00:00
Jeremy Allison
e0931cda80 Cast prs_alloc_mem to correct type.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
26f873540c Merged Tim's fixes from appliance-head.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ce4f461965 Never free anything in the rpc_parse/prs_XXX functions. Do it in the enclosing
function.
lib/util_unistr.c: Check lengths *before* reading source - prevent uninitialised
memory reads.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
506b5e34c3 Added lock backouts on fail.
When chaining together long lines of bloody "if" statements, which should
logically be separated, and one of them allocates memory, remember to
*free* it *WHETHER OR NOT THE IF STATEMENTS SUCCEEDED* !!!!
Yes I do consider this a bug in the coding style of Tridge, Rusty, Tim et al. :-).
I'm just pissed 'cos this took 4 hours to track down even with an insure error report
stating me in the face and also Ben Woodward looking over the code with me :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
69fe739303 lib/util_unistr.c:
rewrote unistr2_to_ascii() to correct a bug seen on SGI boxes.

rpc_parse/parse_misc.c:
rpc_parse/parse_prs.c:
        rewrote of BUFFER5 handling to NOT byteswap when it was already in
        network byte order.

rpc_parse/parse_samr.c:
        cleanup of samr_io_q_lookup_domain(), remove the over-parsing by 2
        bytes.

rpc_server/srv_lsa.c:
        UNISTR2 strings need to be NULL terminated to pleased W2K.

rpc_server/srv_spoolss_nt.c:
        use snprintf instead of safe_strcpy as we want the string
        truncated at 32 chars.


That should fix SUN and SGI box not able to act as printserver and the
problem with joining from a W2K wks.

        J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0a40bc83e1 Fixed memory leaks in lsa_XX calls. Fixed memory leaks in smbcacls. Merged
in fixes from appliance-head and 2.2. Fixed multiple connection.tdb open
problem.
Jeremy.
0001-01-01 00:00:00 +00:00
David O'Neill
505a8a2277 Changes from APPLIANCE_HEAD:
- add some debugs for comparing two security descriptors.
      (source/rpc_parse/parse_sec.c)
0001-01-01 00:00:00 +00:00
Tim Potter
1db0f31ae0 Wrong length for unistr2 in init_q_lookup_names()
Removed some more static arrays and replaced with tallocated memory
blocks.
0001-01-01 00:00:00 +00:00
Jeremy Allison
9e9c71c8b3 Merged in Tim's changes : Removed static limit of MAX_LOOKUP_SIDS in rpc server and client
lsa_lookup_names() and lsa_lookup_sids().
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
71e5e802b7 return NULL instead of return False in char *prs_mem_get(); 0001-01-01 00:00:00 +00:00
Tim Potter
817819d0cc Port of lsa_lookup_sids() and lsa_lookup_names() rpc client functions from
TNG branch.

Re-instated lsa_lookup_sids and lsa_lookup_names functions in rpcclient.

This requires most samba binaries to link in another handful of object
files due to uncessary coupling between modules.  )-:
0001-01-01 00:00:00 +00:00
Andrew Tridgell
9ec4b1fa48 no longer pass the type to make_sec_desc(), instead the type is
derived from the other arguments
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
97e3b29356 alignment issues.
I hate that job ...

	J.F.
0001-01-01 00:00:00 +00:00
Gerald Carter
37a665002c o fixed logon script problems (wrong len in reply to net_sam_logon for
a few strings).  I was the one who broke it obviously.

o changed a few more defaults in the smbpasswd backend with
  respect to times.  Now the logon time becomes '0' and the
  pass_can_change_time is set ot the same as pass_last_set_time

o change Get_Pwnam() call in local_lookup_name to sys_getpwnam()
  as it did not seem necessary to try case permutations in the
  username.

  Tim,  I think this was your code, so you might want to double
  check me.


-- jerry
0001-01-01 00:00:00 +00:00
Jeremy Allison
0ab6eb01b0 ADDPRINTERDRIVER info level 6 fix - this is dynamic depending
on a field in the struct - that's why it was so hard to find.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
78a1307445 Fix for updating of print queues changed from a local box. Essentially,
this makes sure that the change messages sent to ourselves are handled
synchronously w.r.t. other smb packets incoming.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
eeab4e0290 Fix for memory leak when adding driver.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
0b92d0838e Large commit which restructures the local password storage API.
Currently the only backend which works is smbpasswd (tdb, LDAP, and NIS+)
are broken, but they were somewhat broken before. :)

The following functions implement the storage manipulation interface

/*The following definitions come from  passdb/pdb_smbpasswd.c  */

BOOL pdb_setsampwent (BOOL update);
void pdb_endsampwent (void);
SAM_ACCOUNT* pdb_getsampwent (void);
SAM_ACCOUNT* pdb_getsampwnam (char *username);
SAM_ACCOUNT* pdb_getsampwuid (uid_t uid);
SAM_ACCOUNT* pdb_getsampwrid (uint32 rid);
BOOL pdb_add_sam_account (SAM_ACCOUNT *sampass);
BOOL pdb_update_sam_account (SAM_ACCOUNT *sampass, BOOL override);
BOOL pdb_delete_sam_account (char* username);

There is also a host of pdb_set..() and pdb_get..() functions for
manipulating SAM_ACCOUNT struct members.  Note that the struct
passdb_ops {} has gone away.  Also notice that struct smb_passwd
(formally in smb.h) has been moved to passdb/pdb_smbpasswd.c
and is not accessed outisde of static internal functions in this
file.  All local password searches should make use of the the SAM_ACCOUNT
struct and the previously mentioned functions.

I'll write some documentation for this later.  The next step is to fix
the TDB passdb backend, then work on spliting the backends out into
share libraries, and finally get the LDAP backend going.

What works and may not:

	o domain logons from Win9x 	works
	o domain logons from WinNT 4	works
	o user and group enumeration
		as implemented by Tim	works
	o file and print access		works
	o changing password from
		Win9x & NT		ummm...i'll fix this tonight :)

If I broke anything else, just yell and I'll fix it.  I think it
should be fairly quite.





-- jerry
0001-01-01 00:00:00 +00:00
Jeremy Allison
98764c5df9 rpc_parse/parse_spoolss.c: Updated comment for old version of W2K.
tdb/tdbutil.c: With varargs uint16 is cast to (int).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b17e23a8ff printing/nt_printing.c: use getpwuid not smbgetpwuid. Canonicalize printernames.
printing/printing.c: Insure fix for malloc of zero.
rpc_parse/parse_misc.c: Enusre UNISTR's are zero filled.
rpc_parse/parse_spoolss.c: Correct INFO_6 - differs between pre-releases of W2K and shipping build.
rpc_server/srv_spoolss_nt.c: Canonicalize printernames.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
ae087bdf31 Merge of printer security descriptor, info level and printerdata
comparison changes from appliance branch.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3d68257850 Only use prs_uint8s on marshalling as we know we're little endian. On
unmarshalling use prs_uint16s. Yes this sucks :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c96a77957b Fixed double btyte-swap problems with bigendian architectures.
Jeremy.
0001-01-01 00:00:00 +00:00
Tim Potter
1b86b9139e Fixes for io_q_setprinter rpc parsing. 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
d8bf81553c last part of W2K support.
the trust domain list reply on netlogon pipe was wrong, interim hack until
we have full trust relationships.

changed some unistr2 to parse the ending NULL char.

added a prs_align_needed() function. much like a prs_align but with a
condition. needed for the unistr2 parsing.

	J.F.
0001-01-01 00:00:00 +00:00
Herb Lewis
bbb24daa25 changes to sync with 2.2. tree
.cvsignore              remove config.h - not in this directory
include/profile.h       profile changes
lib/messages.c          added message to return debug level
libsmb/clierror.c       cast to get rid of compiler warning
libsmb/smbencrypt.c     cast to get rid of compiler warning
profile/profile.c       add flush profile stats changes for profile struct
rpc_parse/parse_samr.c  fix for compiler warning
rpc_server/srv_samr.c   cast to get rid of compiler warning
smbd/ipc.c              profile stats
message.c               profile stats
smbd/negprot.c          profile stats
smbd/nttrans.c          profile stats
smbd/trans2.c           profile stats
utils/smbcontrol.c      new flush stats command
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
94f4024481 a netlogon enum trust query doesn't have a function_code at end.
a sam_user_info_24 doesn't have a uint16 at end
samr_create_user also creates the unix account now
samr_set_userinfo changes the password.

        J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
b655bc281f added samr_set_user_info and info_2.
cleanup of create_user
cleanup of rid/sid mix in samr. now we only have sid.

some prs_align() missing in parse_samr.c

a small debug change in srv_pipe.c

You still can't change a user's password in this commit.
Will be availble in the next one.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
83bfe94771 fixing prs_unistr2(). For the special case of an empty (but existing)
string.

	J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d131ad1ce3 Adding Herb's compile warning fixes to HEAD.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d9d3668fa3 Fixes from Herb - compiler warnings.
Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
416be1b64f fixed samr_create_user(). we now correctly parse the query and the reply.
And we create the disabled account. That means we can create user and
trust accounts remotely !

ifdef out a return in passdb/smbpass.c. I think I didn't break any
security. Jeremy could you check if I didn't make any mistakes ???

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
0f707ac1fb samr unknown 0x32 is in fact samr create user.
so renamed and tidy up of the server function.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
4c63c91858 printer notify code.
It only sends notifies to one client. The broadcasting notify code will
code soon.

	J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
f0aa8f9314 Some code moved back from TNG - updates to LSA stuff. Not yet used but
will be needed soon.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d666b958bc param/loadparm.c: Fix based on Damian's code to stop printer scripts getting overwritten.
rpc_parse/parse_spoolss.c: Tidyup to call function for relstring arrays.
Win2000 now does "Add Printer" successfully !!!!!

Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
cd41d7a354 in a printer_info_6, driver version is 64 bits long and there is a 32 bit
padding before.

	J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
63a7d0fc35 Fixes from JF as I didn't understand the string array sizing code correctly.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e5d98ba9e9 Move towards getting W2k p&p to upload NT4.x drivers. Still doesn't work -
not sure why (JF - a glance at this would be appreciated). Removed code
that JF objected to with enumprinterdata. Added translations to/from
level 6 - but Win2k still not happy... hmmm...
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
fb48efaf83 Implemented DELETEPRINTERDATA (tested with Gerald's Win32 progs).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
2b1f66eb82 Fix for the SID history problem when using a Win2k domain controller
with security=domain. Also fixed to dynamically allocate the SIDs and GIDs.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
55ed0a9b0c Implemented GETFORM tested and working using Gerald's Win32 test progs....
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
596c21a2af Implemented DELETEFORM tested using Gerald's Win32 test code :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3d9b163655 Fixed overrun write error when using debuglevel > 50.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
6d081a9017 Implemented AbortPrinter() from Gerald's Win32 test code. Just purge all
possible printjobs from that printer (I think this is correct).
Added error code returns for print_queue_XXX() functions.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
14e534a890 yipee!
The spoolss AddJob function has an [in,out] buffer not an [in] buffer
(despite the comment in the code to the contrary). Also, we must fail
this function - not just blindly reply "no problem" as AddJob should
always fail on non-local printers.

This fixes a bug where the "print test page" failed about half the
time. I suspect it will also fix a bunch of other intermittent spoolss
bugs where the client (incorrectly) tries to use the AddJob printing
interface.
0001-01-01 00:00:00 +00:00
Gerald Carter
b64ddbd1aa added comment for my own memory purposes
jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
3b14487c7e hack for unmarshalling unistr's on machines with BIG_ENDIAN arch
I think we have a lot more of these bugs lurking (i'm fairly
confident of it).




jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
65ee5f9b6e - fixed memcpy bug in copy_unistr2()
- init_unistr2_from_unistr() does not NULL terminate
  the buffer



--jerry
0001-01-01 00:00:00 +00:00
Jeremy Allison
f94f37dcab Tidied up extra ()'s.
Jeremy
0001-01-01 00:00:00 +00:00
Gerald Carter
bd4c83eb40 fixed a few bugs in new_smb_io_relarraystr().
Marshalling code path now uses spoolss_smb_io_unistr()
also caught a NULL pointer case.

i'll update TNG later.
0001-01-01 00:00:00 +00:00
Gerald Carter
bc154e8522 fix for new_smb_io_relarraystr() and new_smb_io_relstr()
to use spool_smb_io_unistr() as this does not call prs_align()
befrore parsing the UNISTR.

Parsing a void* buffer from an RPC should not be aligned
on 4 byte boundaries.  Don't think this change affects
any marshalling code, only unmarshalling...




jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
236f19659c removed the prs_align in spoolss_smb_io_unistr() (JF, please check)
as it was throwing things off when parsing buffers passed in SPOOLSS
RPCs

fixed the unmarshalling of UNISTR arrays to be double NULL terminated




jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
3fcc59ba92 fixes to prs_unistr UNMARSHALLING only. Problem was due to talloc's
of 0 bytes.



jerry
0001-01-01 00:00:00 +00:00
Jeremy Allison
ceba9f3dcd Fixed the problem with UNISTR marshalling in a buffer5 struct.
The smb_io_unistr() code called a prs_align, this was not being
counted in the size or taken account of in the offset calculation.
Fixed size_ calculation to always return a size a multiple of 4
and also set the offset correctly. This fixes the problem I saw
and will hopefully fix the problem HP reported. JF please check
this change.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
1a145977f0 working on the unmarshalling of dependentfiles to a DRIVER_INFO_3
struct.  Not wuite there.





jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
26a73a70e2 deal with allocation size of 0 in prs_unistr when UNMARSHALLING
jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
8ecd5dd52a More work on AddPrinterDriver() and AddPrinterEx() client RPC's
Also fixed init_unistr() to deal with a NULL source character string.



-jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
1e00ac19cd cleanup in init_unistr2_from_unistr()
--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
3bf9a29f34 All changes related to rpcclient...
- cleaned up some code
- Fixed a few memory leaks of my own making
- Add AddPrinterDriver(); I'm missing some of the semantics
  here as the call is done correctly, but I'm not getting all
  the information right in the DRIVER_INFO_3 struct I think.
  Will work on it tomorrow some more...



--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
7b69cbbde3 it is not my day it seems. :-(
Fixed missing )


j-
0001-01-01 00:00:00 +00:00
Gerald Carter
34d4fb54c3 removed the for() loop to copy the buffer in init_unistr2_from_unistr()
Replaced with a memcpy()



Forgot to commit this a few moments ago


j-
0001-01-01 00:00:00 +00:00
Gerald Carter
4ecd15cd58 Fixed bug in init_unistr2_from_unistr() found by Elrond.
Thanks :-)





j-
0001-01-01 00:00:00 +00:00
Gerald Carter
e15d9befd2 clunky support for calling AddPrinterEx(). The code currently reports
that the call failed, but the printer shows up on the remote NT client.
(note this is the client side call).  I've botched the return value
somewhere and will fix that today.




jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
c8f9e54bea After talking with Jeremy and JF (and staring at packet traces between
NT <-> NT), I've come to realize that UNISTR2 strings should be NULL
terminated.




jerry
0001-01-01 00:00:00 +00:00
Jeremy Allison
d6db29be98 Much though I hate to admit it - JF was completely correct. I cannot
now reproduce the bug I had with adding a printer driver, and PrintMig.exe
crashes if I use my SD code but works with his.
I stand completely corrected :-). - So I'm reverting to his code as it works :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c55bcec817 Tidyup removing many of the 0xC0000000 | NT_STATUS_XXX stuff (only need NT_STATUS_XXX).
Removed IS_BITS_xxx macros as they were just reproducing "C" syntax in a more
obscure way.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
902ada6379 Added John Reilly's enumports/addprinter/delprinter scripting code plus the
fix for the Win9x printer drivers.
Changed command names to add "command" string on the end for some consistancy
with the other scripting commands.
Added '%P' option to tdbpack/unpack to store long comment string.
Made port name be "Samba Printer Port" if no enum port script given.
Fixed prs_uint32_pre code to cope with null args.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
d321d0dddd More work on rpcclient...
* Fixed to work with Jeremy's recent changes re: dunamic
    memory allocation when unmarshalling unistr[2]
  * included EnumPorts level 1
  * more work on AddPrinterEx




--jerry
0001-01-01 00:00:00 +00:00
Tim Potter
4ab75143c4 Fixed read overrun in init_string2() 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
9178d2a1aa remove warnings
J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0ff2ce543e Ok - this is a *BIG* change - but it fixes the problems with static strings
in the RPC code. This change was prompted by trying to save a long (>256)
character comment in the printer properties page.

The new system associates a TALLOC_CTX with the pipe struct, and frees
the pool on return of a complete PDU.

A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx
code, and is freed in the main loop.

This code works with insure, and seems to be free of memory leaks and
crashes (so far) but there are probably the occasional problem with
code that uses UNISTRxx structs on the stack and expects them to contain
storage without doing a init_unistrXX().

This means that rpcclient will probably be horribly broken.
A TALLOC_CTX also needed associating with the struct cli_state also,
to make the prs_xx code there work.

The main interface change is the addition of a TALLOC_CTX to the
prs_init calls - used for dynamic allocation in the prs_XXX calls.

Now this is in place it should make dynamic allocation of all RPC
memory on unmarshall *much* easier to fix.

Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
883f7402d4 Found out that we are crashing spoolss in enumprinterdata.
So fixed enumprinterdatas in rpcclient to debug the server code,
and found that the parsing code was missing 2 prs_align().

We are not crashing NT anymore. :-)

        J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
ac0a145acc A rather big change set ! (listed in no particular order)
- changed the default forms flag to 2
- all short architecture name are uppercased
- get_short_archi() is now case unsensitive
- the drivers TDB is indexed by archi/version/name
- implemented code to move drivers from the upload area to the download
area. Someone else need to look at that code.
- don't return anymore a default driver if it doesn't exist in the TDB.
Instead return an error.
- cleaned prs_unistr.
- #ifdef out jeremy's new SD parsing in printer_info_2
- removed the unused MANGLE_CODE

- #ifdef out the security checking in update_printer() as it doesn't work
for me.

Zap your ntdrivers.tdb, it won't work anymore.

	J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a0ee774fe9 Fixed open handle code in printers - 3 functions were always being done
in order - moved them into open_printer_hnd().
Added saving of comment field.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
a2205c6646 Added functions for enumerating ports on remote print server.
Tim,  You should also look at new_smb_io_printer_info_2()
and see if the change from NULL to &i regarding the secdesc is ok.




jerry
0001-01-01 00:00:00 +00:00
Jeremy Allison
f038a24e9f rpc_parse/parse_prs.c: Removed extraneous ()'s.
rpc_parse/parse_spoolss.c: Fixed the security descriptor marshalling in a INFO_2 struct.
							for some reason SD's should be done inline after the info2, not
							as the last buffer marshall.
rpc_server/srv_spoolss_nt.c: Removed extraneous ()'s.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
f7bc6df3be fixed a bug (my own) in create_ntc_from_cli_state()
--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
3bc9af4c1d removed prs_data(), prs_free_data(), and prs_realloc_data()
as these were unneeded and replaced by the real functions
already in HEAD.

Added a few more functions to parse_spoolss.c to help with the
rpcclient merge from TNG.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
08b41bab17 we are now sure the printer_info_2 timestamp is updated everytime
required.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
493f7d11ac - The printers are indexed by the sharename in both get_a_printer() and
add_a_printer() now.

- correctly unpack the private part of a devmode and remove a memleak

- correctly retrieve the pair(value,data) for getprinterdata

- handle null devicemode in printer_info_2

I still have some bugs but I'm not crashing anymore NT4SP6 d/c build :-)


        J.F.
0001-01-01 00:00:00 +00:00
Gerald Carter
fb0e1fb9e3 #ifndef RPCCLIENT_TEST
use old prs_unistr()
#else
	use new prs_unistr() which handles UNMARSHALL
#endif /* RPCCLIENT_TEST */



jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
4f431ea1f5 included a a new prs_unistr(). Is currently #if'd out (denoted
by RPCCLIENT_TEST) in order to not break anything in the smbd
code (and to give time to review it).  Originally written by JF.
In effect, this checkin makes no changes to parse_prs.c at all.





jerry
0001-01-01 00:00:00 +00:00
Tim Potter
898a483cda Fixes for various compile warnings on Solaris 8. 0001-01-01 00:00:00 +00:00
Tim Potter
3ee111bff7 Fix for passing NULL pointer as an array parameter in
domain_client_validate()
0001-01-01 00:00:00 +00:00
Gerald Carter
61d2aad5dc More rpcclient merge issues:
* fixes some readline bugs from the merge
        * first attempt at commands (spoolenum almost works)
        * no changes to existing functions in HEAD; only additions
          of new functions.  I'll weed out what I can as I go.




--jerry
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
1fae158529 the dummy field in driver_info_6 is before the driver version and not
after.

I don't know who broke all that code, but I'm  ******** (censured)

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
a882dd225e driver_info_6 had a prs_align() that should not have been there.
J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d47329649d Removed unneccessary ()'s afer &'s that made it look like we
don't know how the C language works :-).
Jeremy
0001-01-01 00:00:00 +00:00
Jeremy Allison
f3fe384dc3 Tidy up current spool code - added some JRATEST ifdefs to allow
experimentation with what is making spoolss.exe crash - may be removed
later.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
aa49dc037f Removed extra uint32 field in auto-notify reply. This fixes some spoolss.exe
crashes but there are still more to work on.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8c9ed87436 Changing drivers using the properties page works - but only if getting/setting
security descriptors is disabled (as it is in this code).

If get/set sd's is enabled spooler.exe crashes on NT.

I'll investigate and fix that issue next.

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
151b131ee0 lib/util_sid.c: Uninitialized memory read.
rpc_parse/parse_spoolss.c: Added note about prs_align when marshalling a SEC_DESC...
rpc_server/srv_lsa.c: Tim - your changes broke the display of the 'everyone' group
						when doing file access with no winbindd running. This is a partial
						fix - more when I have analysed this more.
rpc_server/srv_spoolss_nt.c: Fix for the 'change driver' problem ! Hurrah !

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
2a9e645cbd Fixes for Win2k "add printer driver" INFO_LEVEL_6 was wrong, also some
memory fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
1871d4a3f6 parsing code for reply[open|close]printer in preparation of the event
stuff.

	J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e1b1b6fb67 Luke, I am moving the code back into passdb/passdb.c, this the correct
place to do this, not in smbd/passwd.c

Please don't change this without asking first, I have run this past
Andrew so talk to him (I'm on vacation next week).

I also removed the g_newXXX macros. There are essentially a private C extension,
not used anywhere else in the code, and add no functionality over malloc(XX)
and make the code harder to understand (everyone knows what malloc does).

Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
bd34f65239 dynamic allocation of NET_USER_INFO_3 gids.
jeremy, the intent is to call se_access_check() with usr-sid, grp-sid,
array-of-group-rids (but array-of-group-sids would do).

please do look at smbd/lanman.c's api_NetWkstaGetInfo, it will show you
that we really do need to store the entire NET_USER_INFO_3 structure.

then again, api_NetWkstaGetInfo is only used by win9x so who cares :)
0001-01-01 00:00:00 +00:00
Jeremy Allison
6c7adeab0f Moved tdb functions that access parse structs into parse_prs.c
to prevent builkd breaking.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
341d07c516 Cause printer SD's to be displayed correctly (full control).
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
8ef41f31c5 Fixing get/set of security descriptors.
Removed ugly hack for NT printing.
Fixed up tdb parse stuff memory leaks.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
34b63896ab Memory leak fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
03cd4aa144 Some tidyup fixes (memory leaks etc.). Still no progress with the
"no driver" issue. I'm banging my head against comparitive packet
dumps right now...
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
6506e6f470 simple increment bug in uniarray_2_dosarray 0001-01-01 00:00:00 +00:00
Andrew Tridgell
417a88fc6a no space was being reserved for the security descriptor in the parse
buffer
0001-01-01 00:00:00 +00:00
Andrew Tridgell
b152d75ea6 sec_desc_size() needs to handle a null secdesc 0001-01-01 00:00:00 +00:00
Jeremy Allison
ac383bb765 More memory leak and PANIC action fixes.
This is *horrible* code :-(.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
48a8031826 Fixed null pointer indirect in addprinterex. Still working on problem
with extra directory layer in NT drivers.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3cdcfa6325 More insure found memory leak and corruption fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
eba31e4e80 Back to building. Now to test with insure.
Added some frees needed to stop memory leaks.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c2099cfb03 Getting back to a compilable state (not there yet but close).
Added patches for random -> sys_random.
Added set_effective_xxx patches for AFS code.
Memory allocation changes in spoolss code.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
7030b7f06a init_unistr takes a const 2nd arg
(ps: I hate const)
0001-01-01 00:00:00 +00:00
Luke Leighton
726c359d1d moved notif_y_table struct to spoolss_nt.c only used there.
#ifdef'd driver-code out with define RELIES_ON_SMBD_SPECIFIC_CODE because
spoolssd doesn't link with smbd/*.c (find_service("print$") is not
possible).
0001-01-01 00:00:00 +00:00
Luke Leighton
3f976e7139 hack to get setprinter working, level2, null sec desc. 0001-01-01 00:00:00 +00:00
Luke Leighton
f9f2a04fdb security descs in spoolss. needs parse_sec.c nttrans.c broken. 0001-01-01 00:00:00 +00:00
Shirish Kalele
590d9ece84 Fixed memory leak in RPC parsing code.
Problem in prs_set_buffer_size() was Realloc returns a NULL when newsize is zero (equivalent to a free()). We were returning a failure here without resetting the buffer_size or the data_p pointer in the prs_struct. And we weren't checking for a failure from prs_set_buffer_size(). So realloc's to zero size were not reflected in the prs_struct: memory leak.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
4fef181af3 a fairly big change in spoolss.
got rid of the forms, drivers and printers files in the nt drivers
directory and instead use a single tdb

note that this is _not_ all finished.
0001-01-01 00:00:00 +00:00
Shirish Kalele
15e7d8f6c5 Added the NETDFS pipe to allow remote administration of the msdfs symlinks
on the samba server.
0001-01-01 00:00:00 +00:00
Jeremy Allison
aa1a4f46da Fixed bug I introduced last night (sorry). Now truncate incoming prs_struct
buffer size to exact size of incoming data to prevent read overruns into slop
space.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
1c3193aa1c Fixed bug where mallocd size of prs_struct could be larger than
incoming packet. Ensure new alloced memory is zeroed before use.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b090cff4b5 Synced up srv_samr with HP changes. Added error checking to original code
- what a concept :-). All this code will be replaced with TNG stuff anyway,
so not a big deal....
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
a148cb9962 Added Shirish's reg changes to HEAD. Sync up with 2.2.0 backport.
Also added prs_xx error return checks to new code in rpc_parse/parse_reg.c
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
87d9bac3a1 don't call prs_dump() here 0001-01-01 00:00:00 +00:00
Andrew Tridgell
a42da20536 update grow_size in prs_grow 0001-01-01 00:00:00 +00:00
Andrew Tridgell
0e7819bb45 make prs_dump() store up to 100 variants of each msg type 0001-01-01 00:00:00 +00:00
Andrew Tridgell
4de7202da4 changed uniarray_2_ascarray to uniarray_2_dosarray 0001-01-01 00:00:00 +00:00
Jeremy Allison
eefbfb5e16 Added unicode_to_dos_char() function to address converting single UNICODE
characters to one or more DOS codepage characters.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
974813f0d4 added spool_io_printer_driver_info_level_6()
thsi function and the associated header structure were autogenerated
using a little awk based code geerator I wroe ths evening. I'll commit
that next ...
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d178c00aae more merging
it is now at the stage that winbindd can compile in the head branch,
but not link
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f76c037255 the beginnings of a new scheme I've working on to allow an easier
head/tng merge.

It goes something like this:

- headers from tng get copied over one at a time

- the old headers get renamed to *_old.h

- server side code that used the old headers gets a
  #define OLD_NTDOMAIN 1
  #undef OLD_NTDOMAIN
  at the start and end of the code

- mkproto.awk recognises these special defines and does magic stuff so
  that each .c file sees the right headers

- we start moving the rpc client libraries from tng to head.

if this goes OK then, in theory, we should be able to move the client
side rpc code from tng to head without disturbing the existing head
server side code. Then when that works we can consider merging the
server side.

it remains to be seen if this scheme will work. So far I've moved
rpc_samr.h and don't seem to have broken anything.

Note this this is still a very delicate operation, as at every step of
the way I want to keep head fully functional. Please don't take part
unless you discuss it with me first.
0001-01-01 00:00:00 +00:00
Jeremy Allison
577ddbfbec Insure uninitialized memory read fixes.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e72a571853 added support for deleting printers into the spoolss system 0001-01-01 00:00:00 +00:00
Shirish Kalele
99d07e1352 Added info level 1005 to netsharegetinfo (is the share a DFS root)
Added dfs_server announcement in set_default_server_announce_type()
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d7cd7c88fd moved trans2.h and nterr.h into includes.h with all our other includes 0001-01-01 00:00:00 +00:00
Jeremy Allison
c2aa6d66b3 rpc_parse/parse_rpc.c: Changes from TNG (thanks Luke) for NTLMSSP parsing.
smbd/reply.c: Fixed typo in debug.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
9a118cd4a2 Modified interfaces and added checks around *all* *alloc calls
so that errors are returned on memory allocation failure.
Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
cef44398f9 off by one error ...
J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
396f73c11b changed all the status code to ERROR_xxx instead of NT_STATUS_xx which are
wrong in the spoolss case.

fxed a bug in the job notify code (that's the polite answer), the truth is
different: there is a bug in the NT spooler service, including SP6a and
NT2K.

changed the default lpcommand in the LPRNG case.

	J.F.
0001-01-01 00:00:00 +00:00
Tim Potter
b912fb7dd2 Fixed spelling of Andrew's name. (-: 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
c212fbe009 rewrote getprinterdriver level 3, now correctly handle the dependent
files.
A number of memleak fixed
some error return values fixed.

	J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
53721fbc7d rpc_parse/parse_spoolss.c: Added checks on mallocs/overflow checks on all prs_xx
calls.
smbd/connection.c: Fix from David Lee <T.D.Lee@durham.ac.uk>.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
f02999dbf7 acconfig.h configure configure.in: Added check for UT_SYSLEN for utmp code.
include/byteorder.h: Added alignment macros.
include/nameserv.h: Added defines for msg_type field options - from rfc1002.
lib/time.c: Typo fix.
lib/util_unistr.c: Updates from UNICODE branch.
printing/nt_printing.c: bzero -> memset.
smbd/connection.c: Added check for UT_SYSLEN for utmp code.

Other fixes : Rollback of unapproved commit from Luke.
Please *ask* next time before doing large changes to HEAD.

Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
cfaea90529 added the following message to all dce/rpc client/server code, except
the spoolss code (it's cut from TNG) and the smb-dce/rpc interface
code that jeremy has been working up to TNG-functionality.

i also want this message to go into SAMBA_2_0 and SAMBA_2_0_RELEASE,
because it is intolerable that potentially good modifications be made
to code that is going to be thrown away, and people waste their time
fixing bugs and adding enhancements that have already been carried
out already, up to two years ago in the TNG branch.

/*
 * THIS CODE IS OUT-OF-DATE BY TWO YEARS, IS LEGACY DESIGN AND VERY, VERY,
 * INCOMPLETE.  PLEASE DO NOT MAKE ANY FURTHER ENHANCEMENTS TO THIS CODE
 * UNLESS THEY ARE ALSO CARRIED OUT IN THE SAMBA_TNG BRANCH.
 *
 * PLEASE DO NOT TREAT THIS CODE AS AUTHORITATIVE IN *ANY* WAY.
 *
 * REPEAT, PLEASE DO NOT MAKE ANY MODIFICATIONS TO THIS CODE WITHOUT
 * FIRST CHECKING THE EQUIVALENT MODULE IN SAMBA_TNG, UPDATING THAT
 * FIRST, *THEN* CONSIDER MAKING THE SAME MODIFICATION IN THIS BRANCH
 *
 * YOU WILL, ALMOST GUARANTEED, FIND THAT THE BUG-FIX OR ENHANCEMENT THAT
 * YOU THINK IS NECESSARY, HAS ALREADY BEEN IMPLEMENTED IN SAMBA_TNG.
 * IF IT HAS NOT, YOUR BUG-FIX OR ENHANCEMENT *MUST* GO INTO SAMBA_TNG
 * AS THE SAMBA_TNG CODE WILL REPLACE THIS MODULE WITHOUT REFERENCE TO
 * ANYTHING IN IT, WITH THE POSSIBLE RISK THAT THE BUG-FIX OR ENHANCEMENT
 * MAY BE LOST.
 *
 * PLEASE OBSERVE AND RESPECT THIS SIMPLE REQUEST.
 *
 * THANK YOU.
 *
 * lkcl@samba.org
 */
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
4847f7b17b oops ! forgot smb.h in last commit
added info level 1 parsing code for addprinter(ex)

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
07f2e194ba parse correctly getprinterdriver2
found a stupid bug in enumprinters
fixed some memleaks
found a coredump in enumprinterdata
getprinterdriverdir responds correctly now.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
87da4404ab getprinter level 0: was to short, found most of the fields, undocumented,
undecoded, nothing in MSDN, but now it works :-)

cleanup of error codes.
fixed some dfs declarations function.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
025cdb345f changed prs_unistr to parse empty and non-empty strings the same way.
fixed typo in SPOOLSS_SYNT
some cleanup of unused functions
wrote make_spoolss_enumprinter and make_spoolss_openprinterex for
rpcclient as I'm trying to keep in sync the parsing code between HEAD and
TNG.

Will commit changes to TNG after lunch.

	J.F.
0001-01-01 00:00:00 +00:00
Jeremy Allison
066898689f Fixes from Luke, back-ported from TNG to Win2k. Correctly return FAULT_PDU on
unknown rpc calls. Win2k now correctly shows the owners of files.
Jeremy.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
d7bcfe17ce added enumprintprocessordatatypes
now NT is happy and the "always send data in RAW mode" is checked

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
b76ae1f92f rewrote enumprinterdata. still a bug in it but reproducing it hard and
borring.

I need a client test program urgently!!!

rewrote setprinter, doesn't coredump anymore, and no memleak.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
aa9054d14b converted a couple of bzero() to memset()
rewrote the printer notify code, so now it's compatible with SP5 and fully
dynamic. No more limits on printers and job lists.

removed the make_xxx() functions as they are not used and broken

fixed a bug in the open handle function.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
f9c2080111 more rewrite ...
comitting before starting on new functions.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
3d6d386375 fix the reply of rpc_alter_context
OpenPrinterEx is now decoding correctly the query
most of the EnumXXX use the new_buffer struct.
check the (un)marshalling return code.

conclusion: still a long way to go. all the client code has to be
rewritten, and I still wonder how to implement correctly the notify stuff.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
2f544a8077 Hum, I should remove my gloves when I'm in front of an xterm :)
fixed a stupid bug in unistr2_to_ascii that I introduced

fixed getprinterdata()
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
81e375bbbe spoolss definitions.
also added some prs_struct functions, 'cause I'm handling buffers as
prs_struct.

	J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
bd9d4cdde9 First commit of the spoolss code to the HEAD branch.
still needs a lot of cleaning/debuging.

	J.F.
0001-01-01 00:00:00 +00:00
Luke Leighton
adbf97c0a9 made cvs main up-to-date with samba_tng, with addition of process id to
msrpc loop-back interface.
0001-01-01 00:00:00 +00:00
Luke Leighton
55035b8984 SAMR_R_UNKNOWN_38 is 3 uint16 params (4-byte aligned) followed by status code. 0001-01-01 00:00:00 +00:00
Jeremy Allison
4914d2f161 Added HP change.
Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
3362fcdfa4 modified smbd/msrpc credential transfer system. user session key
is *missing* from samba cvs main, therefore it is set to all zeros.
this will cause, amongst other things, administrator-changing-user-passwords,
and setting up new accounts, to fail, as the user's password can only be
decoded with the session key (in this case, the administrator's usr sess key).

it's never a perfect world, is it?
0001-01-01 00:00:00 +00:00
Luke Leighton
8976e26d46 simple mods to add msrpc pipe redirection. default behaviour: fall back
to using internal msrpc code in smbd.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
d7b2087865 2nd phase of head branch sync with SAMBA_2_0 - this delets all the files that were in the head branch but weren't in SAMBA_2_0 0001-01-01 00:00:00 +00:00
Andrew Tridgell
453a822a76 first pass at updating head branch to be to be the same as the SAMBA_2_0 branch 0001-01-01 00:00:00 +00:00
Luke Leighton
caa5052522 final part of "first" phase converting over to msrpc daemon architecture.
done a minimal amout of clean-up in the Makefile, removing unnecessary
modules from the link stage.  this is not complete, yet, and will
involve some changes, for example to smbd, to remove dependencies on
the password database API that shouldn't be there.  for example,
smbd should not ever call getsmbpwXXX() it should call the Samr or Lsa
API.

this first implementation has minor problems with not reinstantiating
the same services as the caller.  the "homes" service is a good example.
0001-01-01 00:00:00 +00:00
Luke Leighton
aa3c659a8d delineation between smb and msrpc more marked. smbd now constructs
pdus, and then feeds them over either a "local" function call or a "remote"
function call to an msrpc service.  the "remote" msrpc daemon, on the
other side of a unix socket, then calls the same "local" function that
smbd would, if the msrpc service were being run from inside smbd.

this allows a transition from local msrpc services (inside the same smbd
process) to remote (over a unix socket).

removed reference to pipes_struct in msrpc services.  all msrpc processing
functions take rpcsrv_struct which is a structure containing state info
for the msrpc functions to decode and create pdus.

created become_vuser() which does everything not related to connection_struct
that become_user() does.

removed, as best i could, connection_struct dependencies from the nt spoolss
printing code.

todo: remove dcinfo from rpcsrv_struct because this stores NETLOGON-specific
info on a per-connection basis, and if the connection dies then so does
the info, and that's a fairly serious problem.

had to put pretty much everything that is in user_struct into parse_creds.c
to feed unix user info over to the msrpc daemons.  why?  because it's
expensive to do unix password/group database lookups, and it's definitely
expensive to do nt user profile lookups, not to mention pretty difficult
and if you did either of these it would introduce a complication /
unnecessary interdependency.  so, send uid/gid/num_groups/gid_t* +
SID+num_rids+domain_group_rids* + unix username + nt username + nt domain
+ user session key etc.  this is the MINIMUM info identified so far that's
actually implemented.  missing bits include the called and calling
netbios names etc.  (basically, anything that can be loaded into
standard_sub() and standard_sub_basic()...)
0001-01-01 00:00:00 +00:00
Luke Leighton
5e68403bbb parsing code for transferring unix and nt security credentials over-the-wire.
at present, a unix password is missing from the unix credentials, but is
not _actually_ expected to be needed.  weeelll... maybe :-)

this is used to transfer credentials between smbd and msrpc daemons, down
a unix socket, so that the unix and nt credentials can be inherited by
an msrpc daemon called up from smbd.
0001-01-01 00:00:00 +00:00
Luke Leighton
30c7fdd6ef ABOUT TIME!!!!!!!!
damn, this one is bad.

started, at least two days ago, to add an authentication mechanism to
the smbd<->msrpc redirector/relay, such that sufficient unix / nt
information could be transferred across the unix socket to do a
become_user() on the other side of the socket.

it is necessary that the msrpc daemon inherit the same unix and nt
credentials as the smbd process from which it was spawned, until
such time as the msrpc daemon receives an authentication request
of its own, whereupon the msrpc daemon is responsible for authenticating
the new credentials and doing yet another become_user() etc sequence.
0001-01-01 00:00:00 +00:00
Luke Leighton
2245b0c6d1 the first independent msrpc daemon - lsarpcd.
one horrible cut / paste job from smbd, plus a code split of shared
components between the two.

the job is not _yet_ complete, as i need to be able to do a become_user()
call for security reasons.  i picked lsarpcd first because you don't
_need_ security on it (microsoft botched so badly on this one, it's not
real.  at least they fixed this in nt5 with restrictanonymous=0x2).
fixing this involves sending the current smb and unix credentials down
the unix pipe so that the daemon it eventually goes to can pick them
up at the other end.

i can't believe this all worked!!!
0001-01-01 00:00:00 +00:00
Luke Leighton
c98c666906 damn, that took a while. nt login password was being stored incorrectly
in private .mac file (oops).  ntlogin test now works.
0001-01-01 00:00:00 +00:00
Luke Leighton
cef258f1c9 fixing joining to domain plus something weird going down with nt logins... 0001-01-01 00:00:00 +00:00
Luke Leighton
7846818432 improving createuser account command to be able to add workstations
and then set a default random password.
0001-01-01 00:00:00 +00:00
Luke Leighton
44dd3efa63 first attempt at getting \PIPE\NETLOGON working. it's pretty horrible. 0001-01-01 00:00:00 +00:00
Luke Leighton
7a69633058 well, i stuffed up the spooler commands. 0001-01-01 00:00:00 +00:00
Luke Leighton
4c3556fae7 this one's a handle-based one (missed in the first round). 0001-01-01 00:00:00 +00:00
Luke Leighton
8ce93b80d3 cool! completed a samr* API that _would_ look like an msdn samr* api...
if microsoft bothered to publish it.  actually, there are good reasons
for not publishing it: people might write programs for it, and then
those programs wouldn't work on nt5, for example...
0001-01-01 00:00:00 +00:00
Luke Leighton
45e92258e7 registry API moved over to new format. reg_connect() is the top-level
function, which takes \\server_name.

tested a _few_ functions.  found that regcreatekey receives a Fault PDU.
0001-01-01 00:00:00 +00:00
Luke Leighton
7cacf8bd02 service control manager API completed. svcenum -i works, but does not
do so twice.  possible memory corruption, revolving around getopt().
0001-01-01 00:00:00 +00:00
Luke Leighton
eaac0923e0 rewrote policy handle code to be generic (it's needed for client-side too)
attempted to fix regsetsec command
0001-01-01 00:00:00 +00:00
Luke Leighton
9193f0eff5 attempted a svcset command. password is encrypted / messed up, therefore
command fails.
0001-01-01 00:00:00 +00:00
Luke Leighton
d5869df371 adding svcctl 0x1b function 0001-01-01 00:00:00 +00:00
Luke Leighton
e88e7d529b shuffling msrpc code around so that it can be used independently of rpcclient 0001-01-01 00:00:00 +00:00
Luke Leighton
a51f62f4cf dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT()
some of the server-side stuff.  Realloc() was being used, so it
Realloc()d some random area of memory.  oops.dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT()
some of the server-side stuff.  Realloc() was being used, so it
Realloc()d some random area of memory.  oops.dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT()
some of the server-side stuff.  Realloc() was being used, so it
Realloc()d some random area of memory.  oops.
0001-01-01 00:00:00 +00:00
Luke Leighton
9795e5948c nt5rc2 falling over because the LsaQueryInfoPolicy() response _must_
have the string max length = string length + 1.

if not, then it gets its knickers in a twist over whether the string
is NULL-terminated or not.

four days.

four days i spent on this one.
0001-01-01 00:00:00 +00:00
Luke Leighton
3152bde7d8 - surprise! the number of UNICODE strings that didn't have alignment
after them is incredible.  how did we get away with this for so long?
0001-01-01 00:00:00 +00:00
Luke Leighton
569babb393 added \PIPE\browser plus experimental brsinfo command. you wouldn't
believe the XXXX that MIGHT be involved in getting nt5rc2 to join
a samba domain...
0001-01-01 00:00:00 +00:00
Luke Leighton
c3913f8ae2 added samuserset2 rpcclient command to test ACB_XXX bit-setting on
samr opcode 0x25.  _yet_ another failed attempt to get nt5rc2 to join
a samba domain.  what _is_ it with this stuff, dammit?
0001-01-01 00:00:00 +00:00
Luke Leighton
3df7c903c5 updating reg_value_info() parsing code to take BUFFER2 instead of just
a char*.  now copes with multiple types.
0001-01-01 00:00:00 +00:00