Commit Graph

18 Commits (5d796b567819ce91740fcdea7cbafecbda65d8f3)

Author SHA1 Message Date
TBK 5d796b5678 use SPDX-License-Identifier in source files 2020-05-07 10:45:42 +03:00
Fredrik Gustafsson d61c009f7a apk: do not manage file ownership as non-root or when asked so
If apk is run as a non-root user, it's not possible to chown files.

Maintainers note: minor wording changes on commit log and man page.

Signed-off-by: Fredrik Gustafsson <fredrigu@axis.com>
2020-04-28 14:48:49 +03:00
Timo Teräs 9dda2d3c21 archive: remove support for old packages without xattr checksums 2020-01-11 03:43:38 +02:00
Timo Teräs 6484ed9849 rework unpacking of packages and harden package file format requirements
A crafted .apk file could to trick apk writing unverified data to
an unexpected file during temporary file creation due to bugs in handling
long link target name and the way a regular file is extracted.

Several hardening steps are implemented to avoid this:
 - the temporary file is now always first unlinked (apk thus reserved
   all filenames .apk.* to be it's working files)
 - the temporary file is after that created with O_EXCL to avoid races
 - the temporary file is no longer directly the archive entry name
   and thus directly controlled by potentially untrusted data
 - long file names and link target names are now rejected
 - hard link targets are now more rigorously checked
 - various additional checks added for the extraction process to
   error out early in case of malformed (or old legacy) file

Reported-by: Max Justicz <max@justi.cz>
2018-09-10 10:59:39 +03:00
Timo Teräs 1817b0a3c3 all: update copyright year statement 2011-09-13 11:53:01 +03:00
Timo Teräs 19419f1a88 io, db: id cache should be specific to database root, not system root
Otherwise we end up using wrong uid/gid mappings when doing install
to alternate system root. Fixes #434.
2010-10-08 15:36:54 +03:00
Timo Teras 58e771303c index, version: support for repository descriptions (fixes #141)
ability embed description information to repository indexes
(e.g. repository name and version) and show it via "apk version -I".
2009-09-03 14:56:24 +04:00
Timo Teras ea90152664 apk: use *at instead of chdir+normal file syscall
this way we never change cwd, and relative filenames are always
parsed consistently. this also helps filename construction in many
places. this patch also changes '--root' to override location of
all configuration to be in the new root. previously it depended
on the file which one was used.
2009-07-31 16:08:09 +03:00
Timo Teras 7b05eef61f tar: make checksumming of inner files conditional
and force checksumming only when unpacking archive. otherwise
it's extra computation for nothing.
2009-07-29 19:16:04 +03:00
Timo Teras 6b471bb614 various: new style index generation
change the index generation to do old index, or the new style index
where package identity is sha1 of control block and it's contained
within an .tar.gz to allow signing in future.
2009-07-16 15:16:05 +03:00
Timo Teras 0f6d96a4f5 gzip: always autoclose the inner stream 2009-07-16 13:47:26 +03:00
Timo Teras 981bc118f8 db: live with sha1 and md5
this also convers scripts file to a tar archive.
2009-07-14 19:14:05 +03:00
Timo Teras 9567337fd2 fetch: new applet to download .apk files
Fixes #24.
2009-04-15 09:56:09 +03:00
Timo Teras 052fbe3f86 various: make fancy progress bar and update todo 2009-01-07 21:45:11 +02:00
Timo Teras a96572fba8 db: compressed index file 2008-11-27 21:06:45 +02:00
Timo Teras 8e23a2ba4e db: checksum installed files, protect config files
Checksum of installed is computed on the fly when extracting them
and it'll be saved to fdb. When installing config files those are
diverted with suffix .apk-new if earlier version of same file with
local changes exist.
2008-11-14 14:26:59 +02:00
Timo Teras aef0f036f0 use zlib internally to decompress 2008-11-07 17:11:08 +02:00
Timo Teras d6c7435242 Initial commit of some stuff written so far. Still in state of flux. Expect
breakage and major changes.
2008-04-17 14:09:13 +00:00