summaryrefslogtreecommitdiffstats
path: root/src/io.c
Commit message (Collapse)AuthorAgeFilesLines
* archive: honor username/groupname instead of uid/gidTimo Teräs2010-06-121-0/+126
| | | | Take the uid/gid from passwd and group.
* various: use O_CLOEXEC and add some error checkingTimo Teräs2010-06-111-8/+5
|
* db: fix migration and pruning of symlinks to dirsTimo Teras2009-10-261-1/+1
| | | | | | | | the old code treated a symlink to directory as file; it tried to calculate regular has of it. fix this by: 1) using no follow on migration and pruning stats, and 2) the helper function to check if it's point to directory and not calculate hash in that case. fixes #188.
* io: better error handling when writing stuff outTimo Teras2009-08-121-12/+56
| | | | | | also have the output stream support writing to temporary file and do renameat/unlinkat on close depending on if all writes succeeded or not.
* db, audit: audit symlinks (by hash of the link target)Timo Teras2009-08-111-1/+14
|
* io: flag for following symlinks on fstatTimo Teras2009-08-051-2/+6
| | | | | | usually we are interested on the actual file's length. but audit is interested about the link. so add a flag for this and use it in audit.
* apk: use *at instead of chdir+normal file syscallTimo Teras2009-07-311-16/+18
| | | | | | | | 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.
* io: fix corruption of big files on mmap writeTimo Teras2009-07-311-14/+13
| | | | | remember to increment destination pointer; and munmap the proper base address.
* audit: protection mask for "symlinks only"Timo Teras2009-07-301-1/+1
| | | | and use it for /etc/init.d by default. fixes #99.
* io: keep static pointer to copying bufferTimo Teras2009-07-301-6/+6
| | | | so we avoid some malloc/free calls.
* io: fix mmap writing to actually workTimo Teras2009-07-301-4/+6
| | | | | | | apparently it needs to have both PROT_READ and PROT_WRITE. and it needs to be MAP_SHARED for the writing to be effective. oh, and the data needs to be preallocated with ftruncate; otherwise, one gets SIGBUS.
* io: use mmap to write archive entries to diskTimo Teras2009-07-291-11/+28
| | | | avoids some copying and system calls.
* pkg: cleanup the signing codeTimo Teras2009-07-221-0/+1
| | | | | smaller callback and less cases to check. also reintroduce the oneshot digest flag, hopefully correct this time.
* various: more informative error messagesTimo Teras2009-07-221-17/+23
|
* digest: use oneshot context flag where approriateTimo Teras2009-07-171-0/+3
| | | | speeds up digest calculation on some cases.
* various: new style index generationTimo Teras2009-07-161-0/+39
| | | | | | 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.
* gzip: always autoclose the inner streamTimo Teras2009-07-161-1/+1
|
* db: live with sha1 and md5Timo Teras2009-07-141-5/+9
| | | | this also convers scripts file to a tar archive.
* bstream: make tokenizable and load index using bstreamTimo Teras2009-07-141-30/+68
| | | | some fixes on index reading code too.
* io: move csumming away from bstream to gunzipTimo Teras2009-07-131-32/+16
| | | | | in future we want to checksum on gzip boundary basis, not the full file.
* cache: new applet (ref #49)Timo Teras2009-06-291-1/+2
| | | | Administrative tool to download or delete files to/from the cache.
* db: cache packages (ref #49)Timo Teras2009-06-291-0/+58
| | | | | | | | | | | If /etc/apk/cache is a symlink to directory, a copy of all installed packages is stored there, and the index of remote repositories will be there instead of /var/lib/apk. This enables to reconstruct running system during boot. Left as todo: remove cached copy when the package is removed, and additional apk applet to download missing packages to cache and/or remove extra items.
* io: fix mmap bstream fd leakTimo Teras2009-06-111-1/+2
| | | | | We need to close the fd on destruction. This is what the corresponding istream variant does too.
* pkg: clean up writing of dependenciesTimo Teras2009-04-161-0/+10
|
* io: implement write cacheTimo Teras2009-03-171-4/+35
| | | | speeds up writing of package / file database.
* various: make fancy progress bar and update todoTimo Teras2009-01-071-1/+5
|
* io: fix some memory leaksTimo Teras2009-01-061-1/+1
|
* io: apk_ostream stuffTimo Teras2008-11-281-8/+82
|
* io: prepartions for url handlingTimo Teras2008-11-281-13/+22
|
* db: compressed index fileTimo Teras2008-11-271-0/+12
|
* various: use apk_istream apiTimo Teras2008-11-271-0/+29
|
* db: checksum installed files, protect config filesTimo Teras2008-11-141-17/+28
| | | | | | | 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.
* pkg: speed up indexing of version 2 .apksTimo Teras2008-11-071-2/+16
|
* io: implement mmap(2) for reading pkgsTimo Teras2008-11-071-9/+98
|
* use zlib internally to decompressTimo Teras2008-11-071-0/+221