1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-24 15:17:06 +03:00

27 Commits

Author SHA1 Message Date
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 1e63dc101a5085a46b9632ba657e5d5cd7505751)
2002-12-12 05:24:55 +00:00
Tim Potter
fad3464ffe Some more tweaking for compilation of py_tdbpack.
(This used to be commit 89be695b2997e97dfc40afd17bb61b59b85634e4)
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 739285ff694e9ffd317ad47aec373e2007c20f45)
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 243763d6eb107ab2444d81025232c8fe795baaf1)
2002-12-03 21:49:00 +00:00
Jeremy Allison
f069aaa671 Fix comment - 850 -> iso8859-1
Jeremy.
(This used to be commit 6639693746ba4c8f6622325ac143f8b1b3bd7538)
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 e88bbec2a06bd92b8cfa33efdf166c4fa72cb656)
2002-11-27 20:58:45 +00:00
Martin Pool
abc32ea850 Add support for new 'F' format, which is a string in the default
codepage.
(This used to be commit ff1244c457d0525343bcc7e89a899d8c7d14b8b6)
2002-11-22 01:12:23 +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 8cbaea2afa6faca80eced70d625359165afaa10c)
2002-11-12 22:23:36 +00:00
Martin Pool
9b7c4c1c81 Rename pytdbpack_unpack -> pytdbunpack
(This used to be commit e62baf3a76e0e4f642e542812868db614632de00)
2002-11-12 22:08:59 +00:00
Martin Pool
5d3bc0bc83 Just reorder functions to put related ones together
(This used to be commit 7863c948b73785e49d04227e87d8b4b47fd61f58)
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 001779dffd18e1f6a83496c94ead185d4bb42204)
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 62ca27d140d55cbb271b97624023540ae7c18882)
2002-11-12 21:42:36 +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 2480d385db0527b71cc5cd23c4fab4655df84485)
2002-11-09 01:47:54 +00:00
Martin Pool
6b0761b327 pytdbpack_unpack: Clean up, and correct the handling of '$'.
(This used to be commit dd73568f97ad51c93f096001058fd31fa14e88ae)
2002-11-06 01:59:57 +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 248067931a2a8eeee86ea343bddf96d2bd727dbf)
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 db67c5f7e53b231fe217a29a15888e8895ce2229)
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 49a0ba46e6693bb819440d4ab40045afc4a7ae17)
2002-11-05 02:54:07 +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 d72b144e03b9a9cb3d676527ddc5b2d0e1ef42f8)
2002-11-05 00:24:32 +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 2085595565b99295d04a6663aad1ccac5bc1b657)
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 2593e1588355643bb76a9b8869573fe38fd3bc3e)
2002-11-04 22:59:48 +00:00
Martin Pool
feb15f90fe pytdbpack_calc_reqd_len: Correct calculation of packed length of
string types
(This used to be commit 30525aee33237f5b17e1067a96d09b7ee0a516a6)
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 20d88a7d1e2a6d2daca29c5ffff3781197a97b57)
2002-11-04 22:22:12 +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 0c1cfe559877d51090409d67f983a82bbbbaa7e2)
2002-11-04 21:56:24 +00:00
Martin Pool
ba09904001 Doc
(This used to be commit 21e41866425c6f8bf04b08b3edd5bf70caf56e32)
2002-11-04 20:34:50 +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 1b681bd524764deaef657ef41c39d037ac7dcc7b)
2002-11-04 20:22:03 +00:00
Martin Pool
3b8d11fe50 Give better error messages for TypeError, which will arise if e.g. you
try to pack an Int using a string tdbpack format.
(This used to be commit 6139ab3cbca3fc2969d1e578b38394b1f6aeb9c3)
2002-10-21 07:41:08 +00:00
Martin Pool
63f411a3f9 Import my code to do reasonably fast tdbpack/unpack from Python
(This used to be commit 1f7ed8bb863fdacd0b9f3bc2e1e5d72ec7051feb)
2002-09-09 06:30:48 +00:00