1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00
Commit Graph

393 Commits

Author SHA1 Message Date
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