1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-29 21:47:30 +03:00

93 Commits

Author SHA1 Message Date
Gerald Carter
9d2e585e5e commit sign only patch from Andrew; bug 167; tested using 2k & XP clientspreviously joined to the Samba domain -
Gerald Carter
c17a7dc9a1 sync 3.0 into HEAD for the last time -
Simo Sorce
3101c236b8 port latest changes from SAMBA_3_0 tree -
Gerald Carter
adb98e7b7c trying to get HEAD building again. If you want the code
prior to this merge, checkout HEAD_PRE_3_0_0_BETA_3_MERGE
-
Volker Lendecke
d5f1082753 parse_string is only used for the authentication negotiators.
It can itself determine the length of the string it has to
transfer. Andrew B., could you take a look at the length calculation?
Is that safe?

Thanks,

Volker
-
Jeremy Allison
ec82e8e9f4 Fixes to make SCHANNEL work against a W2K DC. Still need to fix
multi-PDU encode/decode with SCHANNEL. Also need to test against WNT DC.
Jeremy.
-
Volker Lendecke
41e92409e1 Put the core schannel functions to parse_prs.c. They are also used by
schannel clients.

Volker
-
Andrew Bartlett
37436b0aae Fix signed/unsigned issues - mostly 'i' counters.
Fix an inconpatible poitner type that caused the IA64 not to build

Andrew Bartlett
-
Jeremy Allison
4c3ee228fc Ensure that only parse_prs.c access internal members of the prs_struct.
Needed to move to disk based i/o later.
Jeremy.
-
Tim Potter
6ed4d80baa Remove dead function. -
Andrew Bartlett
92a777d0ea BIG patch...
This patch makes Samba compile cleanly with -Wwrite-strings.
 - That is, all string literals are marked as 'const'.  These strings are
always read only, this just marks them as such for passing to other functions.

What is most supprising is that I didn't need to change more than a few lines of code (all
in 'net', which got a small cleanup of net.h and extern variables).  The rest
is just adding a lot of 'const'.

As far as I can tell, I have not added any new warnings - apart from making all
of tdbutil.c's function const (so they warn for adding that const string to
struct).

Andrew Bartlett
-
Jeremy Allison
19f86f1f72 Lots of fixes for error paths where tdb_fetch() data need freeing.
Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>.
Jeremy.
-
Tim Potter
2d227bdce2 Display debug data we are marshalling/unmarshalling a UNISTR in a
similar format to UNISTR2.
-
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
-
Gerald Carter
f57640720e 8-byte alignment needed for beginning driver_info_level_6.
Verified by looking at NT4 and 2k servers.  First time
for everything I guess.
-
Jeremy Allison
4ed134426d Typo...
Jeremy.
-
Jeremy Allison
374182a9ba Added prs_align_uint16 for SD aligns.
Jeremy.
-
Simo Sorce
897e64d2e0 more debug classess activated -
Andrew Bartlett
3e93b216dd Add a touch of const -
Tim Potter
ddb5753e36 Added dos_errstr() function. Not all errors in list yet. -
Tim Potter
1f007d3ed4 Renamed get_nt_error_msg() to nt_errstr(). -
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Jeremy Allison
9a969069f1 Added prs_mem_clear(). Clear memory on buffer reallocation. That way
we're not returning what the client gave us.
Jeremy.
-
Jeremy Allison
6deb4caca5 Always clear malloced memory for parse structs.
Jeremy.
-
Martin Pool
92a3ab274e Add prs_dump_before to dump everything from the start of the prs
buffer up to the current position, and use this to dump pipe buffers
just before parsing.
-
Jean-François Micouleau
bfbe7f377e samr_querydom_info level 1: found the meaning of the unknow fields. And
discovered that our reply is short by 4 bytes since day 1 of this code.

Added a decode function to rpcclient too.

splitted the STRING2 fields filling while trying to understand the win9x
userlist bug. (didn't fix the bug, but the reply looks closer to NT).

        J.F.
-
Martin Pool
5c892badbc Doxygen demo for Tim. -
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. -
Simo Sorce
94b0fde8a8 move to SAFE_FREE() -
Tim Potter
3245714243 Merge prs_hash1() function from tng. -
Andrew Tridgell
dcd6e735f7 the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work -
Jeremy Allison
94747b4639 Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
-
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.
-
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.
-
Jeremy Allison
c3a1904564 Merged JF's fixes into HEAD. These are for string parsing and SAMR fixes.
Jeremy.
-
Jeremy Allison
94fdffb355 As prs_alloc_mem now zeros memory, remove superfluous memsets after it.
Jeremy.
-
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.
-
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.
-
Tim Potter
71e5e802b7 return NULL instead of return False in char *prs_mem_get(); -
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.
-
Jean-François Micouleau
83bfe94771 fixing prs_unistr2(). For the special case of an empty (but existing)
string.

	J.F.
-
Jeremy Allison
d131ad1ce3 Adding Herb's compile warning fixes to HEAD.
Jeremy.
-
Jeremy Allison
3d9b163655 Fixed overrun write error when using debuglevel > 50.
Jeremy.
-
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
-
Gerald Carter
3fcc59ba92 fixes to prs_unistr UNMARSHALLING only. Problem was due to talloc's
of 0 bytes.



jerry
-
Gerald Carter
26a73a70e2 deal with allocation size of 0 in prs_unistr when UNMARSHALLING
jerry
-
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.
-
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.
-
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.
-
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.
-