Commit Graph

822 Commits

Author SHA1 Message Date
Panu Matilainen 6962b29bd9 Remove bogus comment on rpmDoDigest() ignoring algorithm 2008-06-02 13:05:46 +03:00
Panu Matilainen 2cbe2c3f5a Document rpmDigestLength() error behavior 2008-06-02 11:48:22 +03:00
Panu Matilainen c227b9ebf9 Remove some leftover doxygen @todo markers 2008-05-22 11:25:15 +03:00
Panu Matilainen b6d8ac89b8 Include stdlib.h for free() 2008-05-21 16:05:29 +03:00
Panu Matilainen 84b29174e6 Rip old, bit-rotten librpmio test programs 2008-05-12 10:44:07 +03:00
Panu Matilainen 41147e5b18 Eliminate static buffer in lua findkey() 2008-05-06 10:02:07 +03:00
Panu Matilainen 0ee67fede8 Temp file handling tweaks
- rename rpmMkTemp() (back) to rpmMkTempFile()
- rpmMkTemp() is now a lower level thin wrapper around mkstemp()
2008-05-03 12:34:19 +03:00
Panu Matilainen 995ebf4b58 Kill of alloca() from tufdio tests
- yes it leaks, who cares
2008-04-30 13:34:28 +03:00
Panu Matilainen 2bd9d3401e Plug a memleak in lzclose() 2008-04-29 17:39:02 +03:00
Panu Matilainen 485d195488 Plug memleak in macro doFoo() 2008-04-29 17:39:02 +03:00
Jindrich Novy 586268cc94 Don't use alloca in rpmGenPath() 2008-04-29 16:08:19 +02:00
Jindrich Novy eff99d08ac Rewrite rpmioMkpath() 2008-04-29 07:23:41 +02:00
Jindrich Novy e22ee46476 Remove alloca() from argv.c 2008-04-28 15:42:18 +02:00
Panu Matilainen 4727c2a0aa Remove unused variable 2008-04-28 10:59:42 +03:00
Panu Matilainen 365ffe20a4 Remove meaningless extern on function declarations in headers 2008-04-24 15:08:09 +03:00
Jindrich Novy 94958a3bfb Main lzma rpmio part based on SuSE patches, thanks for them! 2008-04-22 12:38:51 +02:00
Jindrich Novy 3d8e0ef13a Check for lzma library in configure.ac and reference it in Makefile.am 2008-04-22 12:36:27 +02:00
Panu Matilainen 91123cd043 Rip i386-specific RDTSC support from rpmsw, use gettimeofday() everywhere
- we don't need accuracy beyond what gettimeofday() offers for bleeping
  debugging benchmarks
- we especially don't need hw-specific magic asm voodoo to get unreliable
  timing results (RDTSC isn't reliable with multi-core/hyperthreaded CPU's
  etc etc)
2008-04-21 12:39:18 +03:00
Panu Matilainen 1b972af8a6 Change rpmGlob() argvPtr type to ARGV_t to make it obvious what it is
- also fix incorrect doxygen commentary, it wasn't a contiguous blob
  before either
2008-04-19 16:58:55 +03:00
Panu Matilainen 9ae911eefe Further simplify rpmInitMacros()
- Use argvSplit() for splitting the macro path to components instead of
  manual pointer-parsery.
- If URL's are to be supported or accepted at all (previous code attempted
  to skip them), ':' is a very poor delimiter character.
2008-04-19 16:42:56 +03:00
Panu Matilainen e336146a9e Use argvFree() to free, well, an argv, instead of manual freeing 2008-04-19 16:04:11 +03:00
Panu Matilainen 5ad7fbda00 Simplify rpmGlob() a bit
- use argv*() routines instead of manual argv manipulation
2008-04-19 15:58:47 +03:00
Panu Matilainen cebd0812bc Dynamically allocate buffers in rpmGetPath()
- avoid unbounded copying to static sized buffer
- use rpmExpand() instead of expandMacros() which requires preallocated
  buffer when we've no idea of expanded size
2008-04-19 13:42:04 +03:00
Panu Matilainen 601b4d0e6a Avoid entirely silly rpmio FD_t use
- rdcl() converts to FILE internally anyway, might as well use fopen()
  to begin with...
2008-04-18 16:14:15 +03:00
Panu Matilainen 38a975b157 Remove unnecessary xstrdup() of dynamically allocated buffer
- leftover from when target buffer was static...
2008-04-18 15:39:07 +03:00
Panu Matilainen 94e64fec18 Cosmetics: group operations more logically... 2008-04-18 15:15:05 +03:00
Panu Matilainen 2d8a27ed16 Simplify macro option + argument processing
- eliminate ninja-voodoo pointer-hackery parsing, replace argvSplit() +
  argvJoin() and friends
- eliminate static sized buffers from the processing
2008-04-18 14:59:03 +03:00
Panu Matilainen 2c0f7b54ad Add argvJoin() for combining an argv array into a string 2008-04-18 14:59:03 +03:00
Panu Matilainen 94ff22b129 Eliminate splitString() and freeSplitString()
- use ARGV_t instead, it does the same and more...
2008-04-17 21:56:54 +03:00
Panu Matilainen 119b912773 Add rstrlcpy() string helper function
- adopted from strlcpy() function of OpenBSD originally developed by
  Todd C. Miller <Todd.Miller@courtesan.com>
2008-04-17 17:33:57 +03:00
Panu Matilainen 02939c15fa More accurate filtering of .rpmnew etc when reading macros
- strstr() can give false positives, use rpmFileHasSuffix() instead
2008-04-17 17:33:30 +03:00
Panu Matilainen 64e0af29bd Have gcc check for NULL terminated arglist in rstrscat 2008-04-17 11:11:00 +03:00
Jindrich Novy 9a6be3e53f Use sizeof() instead of direct element count in rpmluaGetVar() 2008-04-17 09:20:20 +02:00
Jindrich Novy ea8029e4e9 Introduce rstrscat()
- concatenates NULL terminated strings to newly (re)allocated memory
- purpose is to prevent overflows caused by writing unknown-sized stuff
to static arrays
2008-04-17 08:57:43 +02:00
Panu Matilainen 2ecd8fc22d Convert to Lua 5.1 library loading style
- luaL_openlibs() to pull in all standard libs
- local extensions need to be registered by calling through Lua
2008-04-16 15:37:52 +03:00
Panu Matilainen d48e6c8380 Start phasing out internal copy of Lua
- don't build internal copy of Lua
- move 3rd party extensions (posix and rexlib) to toplevel luaext/
  directory, built by default (unless --without-lua specified)
- auto*foo checks for external Lua
- minimal tweaks to lposix.c and rpmlua.c to get them build with Lua 5.1
2008-04-16 15:37:52 +03:00
Panu Matilainen 3ffbbeba19 Doxygen parameter name mismatch 2008-04-15 18:52:42 +03:00
Panu Matilainen 0097e6fe95 Plug a memleak in pgpArmorWrap() 2008-04-15 17:54:16 +03:00
Jindrich Novy d43ee53dff Introduce rstrcat() 2008-04-15 16:30:58 +02:00
Panu Matilainen 900cbb7d79 Add argvAddNum() for adding integers to ARGV_t arrays 2008-04-14 16:21:40 +03:00
Panu Matilainen 08375fa2bc Add argvNew() to create an empty argv array
- yes it's silly ;)
2008-04-14 15:58:10 +03:00
Jindrich Novy 2c2d98a08d Prevent buffer overflow in readKeys() 2008-04-14 13:07:58 +02:00
Panu Matilainen 769bc86d6d Simplify url io a lot
- move urlhelper call to urlGetFile()
- have urlOpen() call urlGetFile() instead of going the other way around
  and causing local copies and all sorts of craziness in the process
2008-04-11 11:18:25 +03:00
Panu Matilainen fde961e25b Rewrite rpmMkTempFile() for sanity
- Actually use mkstemp() for creating the temp file and return a FD_t
  dupped from the file descriptor returned by mkstemp().
- Simplify the interface while at it.
- Change callers for the new interface.
- Yes we now require mkstemp() to work, mkstemp() is in POSIX.1-2001 and
  this is year 2008...
2008-04-11 09:05:05 +03:00
Jindrich Novy 1721614d96 Rewrite pgpArmorWrap(), the former one was insecure/hackish 2008-04-08 13:48:39 +02:00
Panu Matilainen 2bb4618fa1 Eliminate four copy-paste versions of nibble(), stick to rpmstring.h
- the one in signature.c wasn't even used...
2008-04-08 12:35:36 +03:00
Panu Matilainen 5ef8b53108 Eliminate several copy-paste hex converters, use pgpHexStr() instead 2008-04-07 14:04:00 +03:00
Panu Matilainen a41079c692 Uh, return allocated pointer, not the end of string... 2008-04-07 13:51:20 +03:00
Panu Matilainen 9bb88f4088 Remove static print buffer from pgpMpiStr(), return malloc'd data instead
- convert callers
- only rpmpgp.c internal needs, move it there and make static?
2008-04-07 13:37:56 +03:00
Panu Matilainen 41a32765bd Merge pgpHexCvt() into pgpHexPrt(), removing it from public headers 2008-04-07 13:29:48 +03:00
Panu Matilainen 8909c05434 Minimally convert all pgpHexCvt() users to use pgpHexStr() instead 2008-04-07 13:26:46 +03:00
Panu Matilainen a3a1a45c51 Remove static print buffer from pgpHexStr, return malloc'ed memory instead
- inlined to get xmalloc() from system.h for consistent malloc fail behavior
- convert callers for new behavior, apart from some debug fprintf()'s
2008-04-07 13:02:18 +03:00
Panu Matilainen a70823b998 argvPrint() doesn't modify argv, make it const 2008-04-07 12:35:37 +03:00
Panu Matilainen 4e0ab74d8d Add ARGI_const_t, use where appropriate 2008-04-07 12:34:07 +03:00
Panu Matilainen c29adcee80 ARGV_t const pendantry
- const on typedef'ed ARGV_t doesn't mean a thing, add a new,
  (exec* compatible) ARGV_const_t and use where appropriate consistently in
  argv.h, rpmcli.h etc
- popt's argv const is the wrong way around for exec() family, add explicit
  ARGV_t casts on popGetArgs() uses where needed
- compiler silence, aaahh...
2008-04-07 12:19:58 +03:00
Panu Matilainen d728ec28dc Remove ARGstr_t typedef, it serves no purpose
- argv strings are just regular strings, the structure is what's special
2008-04-07 12:19:41 +03:00
Panu Matilainen a5533d9604 Remove bogus const from ARGV_t 2008-04-07 12:19:33 +03:00
Panu Matilainen 3c1126b2a5 Missing decompression arguments for bzip in uncompress macro 2008-04-04 15:52:52 +03:00
Panu Matilainen a5a3cfc3ed Rename currentDirectory() to rpmGetCwd() and move to librpmio 2008-04-04 09:53:17 +03:00
Panu Matilainen 999248ab03 Shut up a few silly compiler warnings that have crept in
- missing cast in python header subscript
- (false) warning about uninitialized variable, unused variable in rpmfc
- missing include in rpmio
2008-04-03 08:04:22 +03:00
Jindrich Novy 38b81493b0 Fix off-by one in urlOpen()
- the former implementation didn't take the ending '\0' into account
2008-04-01 16:40:15 +02:00
Panu Matilainen 7ddab3ab8d Dead code removal (macro stuff) 2008-03-31 10:44:23 +03:00
Panu Matilainen 9a4a5c9ef8 Remove bogus consts from pgpDigParams_s structure 2008-03-24 21:05:05 +02:00
Panu Matilainen e1e66978a1 Remove bogus consts from urlinfo_s structure 2008-03-24 20:44:48 +02:00
Panu Matilainen 53bc909971 Remove bunch of double consts. What have I've been thinking? 2008-03-19 09:30:33 +02:00
Panu Matilainen 5c7cccd3b6 Erm, off-by-one in rasprintf()
- should probably change the comment to "simple, stupid and buggy" ;)
2008-03-18 13:22:15 +02:00
Panu Matilainen d07bcfece1 Bump up sonames, we're not exactly ABI compatible with 4.4 anymore.. 2008-03-18 10:28:57 +02:00
Panu Matilainen 053cf9a25e Add custom asprintf() clone to rpmstring 2008-03-18 10:17:03 +02:00
Panu Matilainen c908277be2 Minimal namespacing for locale-insensitive x*() string functions 2008-03-18 09:10:13 +02:00
Panu Matilainen 9df54a8622 More xstr[n]casecmp to rpmstring along the other string-stuff... 2008-03-18 08:55:05 +02:00
Panu Matilainen 5dca5fac8f Add missing popt include 2008-03-17 15:48:25 +02:00
Panu Matilainen f1f6510cee Remove rpmio internal copy of poptParseArgvString() & friends
- the old included version segfaults with funky input and whatnot...
- link rpmio to real popt instead
2008-03-12 15:34:49 +02:00
Panu Matilainen 501197e5ef Stop insecurely covering up for lack of snprintf and vsnprintf
- we require C99 anyway
- snprintf is used unconditionally all around the tree
- if absolutely needed for portability, having insecure wrappers littered
  over the source is not the best way
2008-03-07 13:34:20 +02:00
Panu Matilainen a08ececd83 Log message adjustments
- dont waste translator time by having them translate obscure debug messages
- adjust some suspect looking logging levels
- mark some non-debug messages for translation where missing..
2008-03-07 09:47:51 +02:00
Panu Matilainen 8fde231cac Mark bunch of misc. tables & such read-only in librpmio 2008-03-06 19:27:19 +02:00
Panu Matilainen 17fc6663ef Make rpmio vectors read-only 2008-03-06 19:25:46 +02:00
Panu Matilainen 5b32005575 Further read-only tables in rpmpgp.. 2008-03-06 19:24:56 +02:00
Panu Matilainen 84ff15177d Mark various pgp value tables read-only as they should be 2008-03-06 18:56:38 +02:00
Panu Matilainen 05129f83dc Make bunch of macro internal variables static 2008-02-26 22:24:28 +02:00
Panu Matilainen b010266b0e Remove hidden --nolibio cli switch, avoid exporting noLibio 2008-02-26 22:04:17 +02:00
Panu Matilainen 2579e086c2 Un-inline fd*Digest()
- avoid leaking nss + digest internals all over the place
2008-02-26 21:46:38 +02:00
Panu Matilainen 47a1e05150 Make the rest of rpmio vectors static inside rpmio
- no external needs, gets them out of exported library symbols
2008-02-26 21:02:21 +02:00
Panu Matilainen edc6b13d19 Remove the last remains of unused and unnecesary rpmio rpc vectors 2008-02-26 20:53:38 +02:00
Panu Matilainen 2b39ddc25d Enable variadic checks for rpmExpand(), rpmlog() and rpmGetPath()
Suggested by Michal Marek
2008-02-25 11:03:38 +02:00
Panu Matilainen c46876daa4 Add new header for collecting utility macros
- atm consists of portability wrappers to various gcc extensions like
  __attribute__() to provide additional warnings and checks
- copied from glib to avoid an extra build dependency just for the silly
  macros, renamed to avoid namespace clashing
2008-02-25 11:02:07 +02:00
Panu Matilainen 1df890dd02 Make check-programs build again, assorted type-fiddlings.. 2008-02-04 12:00:30 +02:00
Panu Matilainen e886043a10 Add rpm_off_t type for file size types, use where spotted
- preliminaries for bumping up the max size, use rpm-specific type
  as off_t size varies, header data needs fixed size
2008-02-04 11:27:00 +02:00
Panu Matilainen a23502798f Avoid silly fixed size buffer in urlhelper 2008-02-01 13:25:18 +02:00
Panu Matilainen cc69dd20b8 Allocate macro buffers dynamically
- avoids some entirely needless overflow cases
- somewhat similarly to rpm5.org but use heap instead of stack
2008-02-01 13:00:40 +02:00
Panu Matilainen 56405587f4 Allocate various macro buffers from heap not stack 2008-02-01 12:11:03 +02:00
Panu Matilainen 54ab76019e Define + use MACROBUFSIZ for macro expansion buffer size
- double the buffer size while at it...
2008-02-01 11:36:13 +02:00
Panu Matilainen d3d60512bd Macro shell expansion fixes (rhbz#431009) 2008-02-01 11:09:13 +02:00
Panu Matilainen eb5dc35c19 Include spring-cleaning
- put some consistency into include ordering
- everything (apart from bits missed ;) is now ordered like this
  1. "system.h"
  2. other system includes
  3. rpm public headers
  4. rpm private headers
  5. "debug.h"
2008-01-30 17:05:29 +02:00
Panu Matilainen 90fbda7103 Move FD_t to rpmtypes.h, used all over .. 2008-01-30 12:20:59 +02:00
Panu Matilainen e39b131750 More missing system includes for size_t & friends 2008-01-28 13:43:32 +02:00
Panu Matilainen 80ca9f368f Add missing system includes to rpmmacro.h 2008-01-28 11:45:38 +02:00
Panu Matilainen 95b03441cc Rename isCompressed() -> rpmFileIsCompressed() for namespacing 2008-01-27 16:39:40 +02:00
Panu Matilainen 8e2965886f Couple of missing doxygen groupings 2008-01-27 16:13:47 +02:00
Panu Matilainen a0a972702a Detect lzma magic if it exists, otherwise dumb check for .lzma filename
- Newer lzma-utils make a magic header in archives, current stable versions
  don't. Guessing based on common compression flags used by current lzma
  versions is feeble and futile...
2008-01-27 16:11:46 +02:00
Panu Matilainen f0f392cce6 Helper function for checking given suffix on path 2008-01-27 16:00:06 +02:00