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

285 Commits

Author SHA1 Message Date
Andrew Tridgell
96c795cea7 reverted this patch till I sort out the craziness with UNIHDR
(This used to be commit e3d00fa47d)
2003-01-17 06:15:18 +00:00
Andrew Tridgell
ec879eacc2 This removes the 3rd argument from init_unistr2(). There were 240
calls to init_unistr2() in the code and every one of them got the 3rd
argument incorrect, so I thought it best just to remove the argument.

The incorrect usage was caused by callers using strlen() to determine
the length of the string. The 3rd argument to init_unistr2() was
supposed to be the character length, not the byte length of the
string, so for non-english this could come out wrong.

I also removed the bogus 'always allocate at least 256 bytes'
hack. There may be some code that relies on this, but if there is then
the code is broken and needs fixing.
(This used to be commit b9eff31b14)
2003-01-17 04:58:45 +00:00
Tim Potter
6d5724f93b Rename a local variable to avoid a warning.
(This used to be commit 232116d2db)
2003-01-07 03:39:22 +00:00
Jeremy Allison
0fdf60f051 Finish adding strings to all talloc_init() calls.
Jeremy.
(This used to be commit 784d15761c)
2002-12-23 23:53:56 +00:00
Martin Pool
aabcd65020 CR1333: Fix memory leak when unpacking some structures.
* (pytdbunpack_item): PyList_Append creates an additional reference to
  the appended object.  Therefore, release the initial reference after
  it's added to the list.
(This used to be commit 1e63dc101a)
2002-12-12 05:24:55 +00:00
Martin Pool
022a853781 * Ignore .pyc and .pyo files produced as a side-effect of running
Python examples.
(This used to be commit 3bb4bd3ed6)
2002-12-12 04:44:47 +00:00
Tim Potter
fad3464ffe Some more tweaking for compilation of py_tdbpack.
(This used to be commit 89be695b29)
2002-12-11 01:25:18 +00:00
Tim Potter
8623ca6f82 FUNCTION_MACRO change broke the Python modules.
Also fix up string pasting (I thought this should only be a warning?)
(This used to be commit 739285ff69)
2002-12-04 23:31:47 +00:00
Herb Lewis
73bf5369b8 use FILE_MACRO instead of __FILE__
use FUNCTION_MACRO instead of __FUNCTION_
(This used to be commit 243763d6eb)
2002-12-03 21:49:00 +00:00
Tim Potter
9c7891e964 Fixed silly bug.
(This used to be commit 191c1596f5)
2002-11-29 02:44:09 +00:00
Jeremy Allison
f069aaa671 Fix comment - 850 -> iso8859-1
Jeremy.
(This used to be commit 6639693746)
2002-11-27 21:00:55 +00:00
Jeremy Allison
cb51beac60 Remove use of 'F' - make 'f' and 'p' do unix (iso8859-1) encoding.
Jeremy.
(This used to be commit e88bbec2a0)
2002-11-27 20:58:45 +00:00
Tim Potter
0de32d4533 Fix some argument checking bugs found by testsuite.
(This used to be commit 93306f581e)
2002-11-25 00:25:31 +00:00
Tim Potter
9e745ada4c Added some extra code to test absence/presence of LM and NT passwords.
(This used to be commit 6f1d48555f)
2002-11-22 06:51:14 +00:00
Tim Potter
b7b7ff55cc Fixed some compiler warnings.
(This used to be commit 9e871cc256)
2002-11-22 06:18:03 +00:00
Tim Potter
d1bedec87c Fixed some globals that escaped the recent globalcide.
(This used to be commit 4580e16908)
2002-11-22 06:15:43 +00:00
Martin Pool
abc32ea850 Add support for new 'F' format, which is a string in the default
codepage.
(This used to be commit ff1244c457)
2002-11-22 01:12:23 +00:00
Tim Potter
d797c7986e Fix typo in docstring.
(This used to be commit 9f9347bc03)
2002-11-19 01:02:43 +00:00
Martin Pool
477025a6f6 Rename unpack_* functions to be consistent
Decode CP850 strings when unpacking

Add variable giving default encoding name
(This used to be commit 8cbaea2afa)
2002-11-12 22:23:36 +00:00
Martin Pool
9b7c4c1c81 Rename pytdbpack_unpack -> pytdbunpack
(This used to be commit e62baf3a76)
2002-11-12 22:08:59 +00:00
Martin Pool
5d3bc0bc83 Just reorder functions to put related ones together
(This used to be commit 7863c948b7)
2002-11-12 22:07:11 +00:00
Martin Pool
664a5061e0 Remove dead code for packing buffers which has now been reimplemented.
(This used to be commit 001779dffd)
2002-11-12 22:00:57 +00:00
Martin Pool
7031a02c01 Remove dead code for packing buffers which has now been reimplemented.
(This used to be commit 62ca27d140)
2002-11-12 21:42:36 +00:00
Martin Pool
cf671ca0df Remove non-integer Pointer values, which are no longer supported.
(This used to be commit 4a18526257)
2002-11-12 21:40:37 +00:00
Martin Pool
5fabbb0573 Rewrite all the packing stuff so that it converts 'f' strings to CP850
on encoding.  (Tough luck if your Samba codepage is not 850.)  It's
much cleaner and possibly more efficient now too: just build one big
list of strings, then zip it up at the end.

Still need to do this for unpacking.
(This used to be commit 2480d385db)
2002-11-09 01:47:54 +00:00
Tim Potter
f0718b6b35 Added enumprinterkey function.
Stub for deleteprinterkey.
(This used to be commit 64e04380f7)
2002-11-06 23:36:07 +00:00
Tim Potter
f4766f4900 Moved function to parse a list of unicode strings into util file.
It's now used in parsing printer driver structures and the response
from the enumprinterkey rpc.
(This used to be commit acecee6f2b)
2002-11-06 23:34:12 +00:00
Martin Pool
6b0761b327 pytdbpack_unpack: Clean up, and correct the handling of '$'.
(This used to be commit dd73568f97)
2002-11-06 01:59:57 +00:00
Martin Pool
618db4e739 Add another test case for repeated-unpack ('$')
(This used to be commit 2a492c4854)
2002-11-06 01:50:31 +00:00
Martin Pool
d7eac6c356 pytdbpack_pack_data: Allow first argument to be any kind of Number,
not just an Integer.  Coerce appropriately.
(This used to be commit 248067931a)
2002-11-05 21:26:35 +00:00
Martin Pool
17356de921 pytdbpack_pack_data: If the first argument to a 'B' code is not an
Integer, raise an error rather than just returning Null, which breaks
the interpreter.
(This used to be commit db67c5f7e5)
2002-11-05 21:22:14 +00:00
Martin Pool
af7ecaf61b pytdbpack_pack_data: Oops, since B is separately encoded as buffer and
length we need separate counters traversing the format and value
sequences to pack them.
(This used to be commit 49a0ba46e6)
2002-11-05 02:54:07 +00:00
Martin Pool
97d34f85c7 Update test cases.
(This used to be commit db2c393dd4)
2002-11-05 02:52:01 +00:00
Martin Pool
d6d94ee143 pytdbpack_unpack: Handle unpacking Buffers into (LEN, DATA): form list
by appending, rather than preallocating.
(This used to be commit d72b144e03)
2002-11-05 00:24:32 +00:00
Martin Pool
e6aa69bac7 Add more test cases that now work.
(This used to be commit 7827536c15)
2002-11-04 23:10:47 +00:00
Martin Pool
3f9dac6948 pytdbpack_pack_data: Allow 'd' and 'w' formats to take either Integer
or Long arguments.
(This used to be commit 2085595565)
2002-11-04 23:08:53 +00:00
Martin Pool
0011607aca Make sure uint32 unpacking is unsigned, and generates a Python long so
that it can represent all the unsigned values
(This used to be commit 2593e15883)
2002-11-04 22:59:48 +00:00
Martin Pool
2137acf498 Re-add some tests which do work with both implementations
(This used to be commit a9c2817c79)
2002-11-04 22:50:24 +00:00
Martin Pool
a5a1e068bd Comment out test cases where the old and new parser are different.
(This used to be commit 6be885da2c)
2002-11-04 22:48:06 +00:00
Martin Pool
feb15f90fe pytdbpack_calc_reqd_len: Correct calculation of packed length of
string types
(This used to be commit 30525aee33)
2002-11-04 22:29:03 +00:00
Martin Pool
859850faf7 Change to representing buffers ('B') as (LEN, STRING) in Python,
rather than as just a string.  Makes the code more messy, but needed
for compatibility with existing PSA Python code which seems to be too
knotty to separate out.
(This used to be commit 20d88a7d1e)
2002-11-04 22:22:12 +00:00
Martin Pool
70cdcfb5b3 test_pack_extra: Add additional cases.
test_pack_failures: Remove cases for which old code is too lax.
(This used to be commit 631945a03a)
2002-11-04 22:01:25 +00:00
Martin Pool
5c2b4a8a5a test_pack_extra: Better way of testing packing with extra values.
(This used to be commit 12c3bb99a5)
2002-11-04 21:57:53 +00:00
Martin Pool
fe61a53991 pytdbpack_calc_reqd_len: It's no longer an error to supply more data
values than are consumed.
(This used to be commit 0c1cfe5598)
2002-11-04 21:56:24 +00:00
Martin Pool
ba09904001 Doc
(This used to be commit 21e4186642)
2002-11-04 20:34:50 +00:00
Martin Pool
b700eafad9 test_pack_extra: The old code does not complain when there are too
many data values for the format.  Test that the new code behaves the
same way.
(This used to be commit b0143e77d6)
2002-11-04 20:34:25 +00:00
Martin Pool
f10a55e3be test_pack_failures: The old code does not complain when there are too
many data values for the format, so we don't test that here.

test_large: New test case for packing/unpack a thousand values.
(This used to be commit 04cad599f4)
2002-11-04 20:30:09 +00:00
Martin Pool
c56f478ded pytdbpack_calc_reqd_len: Make exception be thrown correctly when a
non-string is used with a string format code.  (It was being generated
but not thrown.)

Also call checked versions of some functions rather than FAST_*
versions.
(This used to be commit 1b681bd524)
2002-11-04 20:22:03 +00:00
Martin Pool
dc847082f3 test_pack_failures: The old and new code is not exactly the same about
error detection, so now we don't care what exact error is returned as
long as we get something.
(This used to be commit 5ade138bb8)
2002-11-04 20:04:16 +00:00
Martin Pool
06b055cea3 test_pack: Coercing a dictionary to a sequence as it is packed is not
compatible with the old code, and so it is removed from the test case.
(This used to be commit ed0e4a670d)
2002-11-04 19:54:06 +00:00