summaryrefslogtreecommitdiff
path: root/lib/fsm.c
AgeCommit message (Collapse)AuthorFilesLines
2010-01-04Use MAP_FAILED instead of hardwired (void *)-1Panu Matilainen1-4/+4
2010-01-04Re-enable mmap test in configure & fix the code build againPanu Matilainen1-0/+1
- this stuff has been disabled for years, lets see what breaks...
2010-01-04Require lchown() and remove ancient broken chown kludgeryPanu Matilainen1-2/+0
- lchown() is POSIX 2001, we dont care about older / nonconformant stuff
2009-12-23Include <utime.h> where needed instead of system.hPanu Matilainen1-0/+1
- include unconditionally as we dont try to deal with utime() missing
2009-12-16Avoid mucking with fsm->rdbuf in fsmRmdirs() and fsmMkdirs()Panu Matilainen1-6/+2
- we already calculate the string length, just use a variable local array
2009-12-16Remove now unnecessary const-avoidance constructPanu Matilainen1-5/+2
2009-12-16Const-correctness on fsmRmdirs() and fsmMkdirs()Panu Matilainen1-12/+11
- both functions need to copy the data anyway as they modify, just use a helper variable to cleanly avoid the const strings from iterator
2009-12-16Remove bogus const from fsm [o]path members and use of _constfree()Panu Matilainen1-43/+38
- in reality the paths point to allocated memory at all times
2009-12-16Simplify fsmFsPath()Panu Matilainen1-13/+6
2009-12-15Kill of ancient unused kludgery over buggy packagesPanu Matilainen1-6/+0
2009-12-15Kill off stillborn fsm threading stuffPanu Matilainen1-10/+0
2009-12-15Kill off stillborn "not yet" code from 2001Panu Matilainen1-33/+0
2009-10-14Remove cpio stuff from FD_tPanu Matilainen1-12/+9
- only the FSM cares about cpio position, move it there - there's only ever one fd active inside FSM, no need to track it per-fd
2009-08-31Replace equal/not equal uses of str[n]cmp() with rstreq[n] in fsm & psmPanu Matilainen1-8/+8
2009-07-23Kill off lclint remnants everywherePanu Matilainen1-1/+0
- remove ancient and likely irrelevant LCL comments and bogus NULL checks
2009-06-12Add parentheses (as kindly suggested by new gcc...)Panu Matilainen1-1/+1
2009-04-03Make sure installed files have state (rhbz#492947)Panu Matilainen1-2/+0
- rpmfsSetState() doesn't get called for skipped files like %ghost and %config(noreplace), causing incorrect file state ("no state") getting recorded in rpmdb, leading to inapproriate removal/rename on erase, ick - For TR_ADDED, always default file states to RPMFILE_STATE_NORMAL, fsm changes it as necessary for skipped colors and such. Lazy alloc on rpmfsSetState() is not correct as rpmfsSetState() might not get called at all. - originally broken by commit 8d6c4b8c95b59f5a71d90c582c2e98f5c7ed7b9d
2009-02-27Add md5->filedigest aliases (rhbz#487597)Jindrich Novy1-5/+5
- add %verify(nofiledigest) as %verify(nomd5) file attribute alias - reference digests as digests not checksums - make old md5 related symbols obsolete and use newer reference - update man page accordingly
2009-01-08Make rpm_tid_t unsigned type to shut up remaining compiler warningsPanu Matilainen1-1/+1
2008-12-11Add public rpmfi function for retrieving digest algorithm of the setPanu Matilainen1-1/+1
- the information is already available through rpmfiFDigest() but that requires valid iteration index to be active, whereas the digest algo is per info set, not per file
2008-12-11Avoid direct access to rpmfi directory indexesPanu Matilainen1-3/+4
2008-12-11More rpmfi direct access avoidance in fsmPanu Matilainen1-4/+6
- the remaining bits need further accessors / refactoring
2008-12-11Avoid most of direct rpmfi accesses in dnlInitIterator()Panu Matilainen1-9/+10
- need to add an accessor function for fi->dil info
2008-12-11Avoid bunch of now unnecessary direct accesses to rpmfi struct in fsmPanu Matilainen1-7/+6
2008-12-11Use indexed accessors instead of direct rpmfi struct access in fsmMapFCaps()Panu Matilainen1-3/+3
- also rpmts is unused here, remove
2008-12-11Avoid bunch of unnecessary direct fi-> accesses for file and dir countPanu Matilainen1-10/+13
2008-12-11Use indexed rpmfi accessors instead of fiddling with iterator indexPanu Matilainen1-11/+10
- saving and restoring rpmfi iterator index has unwanted side-effects - reverts brokenness from 6fd987b7291fb1306297c193f4ab01bf6cd02618
2008-12-10Move ->actions from rpmfi to rpmfsFlorian Festi1-4/+5
and adjust all code using it also "revert" a4e345455d817ce6c56940600d652ee3ae0aa5d5 "Move file action calculations to rpmfiNew() where possible"
2008-12-10Move the run time part of fstates from rpmfi to rpmfs. Keep fstates in rpmfi ↵Florian Festi1-4/+6
as long as it is a real tag read from the rpmdb.
2008-11-27Eliminate silly rpmfiTypeString()Panu Matilainen1-4/+13
- Transaction elements are install/erase type, not file info sets, rename to rpmteTypeString(). It's only "useful" for fsm internal debugging messages, hide it there.
2008-11-27Eliminate fi->te use in fsmPanu Matilainen1-11/+19
2008-11-27Pass rpmte to fsmSetup()Panu Matilainen1-3/+6
- fsm needs the transaction element for progress notification and element type anyway
2008-11-27Remove bogus consts from fsmSetup() argsPanu Matilainen1-1/+1
- rpmfi is messed with (at least file actions) - const on typedef'ed type doesn't mean a thing anyhow
2008-11-19Make fsmMapAttrs() use rpmfi methods instead of directly accessingPanu Matilainen1-16/+15
- Save rpmfi iteration index on entry, restore on exit to avoid clashing with other users of the given file info set. For now... - Remove unnecessary re-initialization of uid and gid in case not found
2008-11-19Use matching type for fsm->digest to avoid unnecessary castPanu Matilainen1-1/+1
2008-11-18Remove useless default flags and action fields from rpmfiPanu Matilainen1-4/+5
- fi->actions is always allocated so fi->action is never used for anything - fi->flags is just as unused and unnecessary
2008-11-17Add + use internal helper function for setting rpmfi file statesPanu Matilainen1-7/+8
- instead of directly accessing the array from fsm, use a helper function which lazily allocates the state array as needed and sets state - also fixes the silly case of non-installed packages showing their files as "normal", ie installed (now it shows "no state" as it's not relevant)
2008-11-15Eliminate bogus const from fi->apathPanu Matilainen1-1/+1
2008-11-15Lose useless fsm/rpmfi astriplen fieldPanu Matilainen1-4/+1
- only "used" for debugging output, duh...
2008-11-11Cpio flags are only relevant for fsm, get them out of rpmfiPanu Matilainen1-3/+2
2008-11-11Push archivePos from rpmfi to fsmPanu Matilainen1-5/+5
- archive position is only meaningful in fsm context anyway
2008-11-05Remove fperms and dperms from rpmfi structPanu Matilainen1-3/+6
- only fsm internals need and just use straightforward defaults, move the defaults there...
2008-11-05Kill off per-file cpio map flagsPanu Matilainen1-1/+1
- nothing uses/needs them, one less murky fi->foo allocation less - apparently a leftover from initial multilib attempts long long ago
2008-11-05Remove useless rpmfi->gid and uid "defaults"Panu Matilainen1-2/+2
- they were only ever set on src.rpm installation yet overridden by package contents unless src.rpm didn't contain RPMTAG_FILEUSERNAME (and GROUP). Which would mean rpm 1.0 packages or thereabouts, or a malformed package. In that case we just fall back to root uid, it hardly matters
2008-10-29Add fsm and rpmfi machinery for file capabilitiesPanu Matilainen1-0/+35
- new rpmfiFCaps() API to retrieve the info from rpmfi set - fsm internals quite similar to selinux handling - plenty of #ifdef's, another possibility would be adding cap_foo dummies to system.h like for selinux
2008-09-10Don't generate broken cpio in case of hardlink pointing on softlinkJindrich Novy1-4/+4
- thanks to Pixel
2008-07-04Stuff rpmio/ugid.[ch] contents to lib/misc.[ch]Panu Matilainen1-1/+1
- no uses outside librpm itself, and there they can be hidden away from exported ABI whereas in librpmio they cant
2008-07-03Plug leaks in selinux context handling in fsmPanu Matilainen1-2/+6
2008-06-30size_t for "left" is wrong, use rpm_loff_t insteadPanu Matilainen1-2/+2
2008-06-10Use nlink_t for hardlink count typesPanu Matilainen1-7/+7
- avoids some signed vs unsigned comparisons