[pacman-dev] [PATCH 1/5] add test for file type check with -Qk
If a directory has been replaced by a symlink, -Qk currently stats the
symlink target rather than the symlink itself and doesn't check that the
actual file type matches the package file list. This will make it
difficult to discover errors once 4.2 is released and replacing
directories with symlinks is no longer supported.
Signed-off-by: Andrew Gregory
Signed-off-by: Andrew Gregory
This makes llstat's signature differ from lstat's, but we never actually
use it on a const string and this saves a large number of strdup's.
This also allows stripping multiple trailing slashes and corrects a bug
where calling llstat on "/" would result in calling lstat on an empty
string.
Signed-off-by: Andrew Gregory
Paths are constructed directly from package file lists and may contain
trailing slashes, causing lstat to dereference symlinks.
Signed-off-by: Andrew Gregory
Signed-off-by: Andrew Gregory
On 27/06/14 02:52, Andrew Gregory wrote:
If a directory has been replaced by a symlink, -Qk currently stats the symlink target rather than the symlink itself and doesn't check that the actual file type matches the package file list. This will make it difficult to discover errors once 4.2 is released and replacing directories with symlinks is no longer supported.
I like the bug fixing part (lstat directory replaced by symlink), but I am not convinced about the file type checking for directories only being added to -Qk. We should just handle this with -Qkk. So I am "happy" with patches 2-4 in this series (without a detailed review), but think we should skip 1 and 5. I realise that not all Arch packages have MTREE files. I am going to start a rebuild to get this done. Would you be fine keeping -Qk to just file existence checking if that was done? A
On 06/29/14 at 11:39am, Allan McRae wrote:
On 27/06/14 02:52, Andrew Gregory wrote:
If a directory has been replaced by a symlink, -Qk currently stats the symlink target rather than the symlink itself and doesn't check that the actual file type matches the package file list. This will make it difficult to discover errors once 4.2 is released and replacing directories with symlinks is no longer supported.
I like the bug fixing part (lstat directory replaced by symlink), but I am not convinced about the file type checking for directories only being added to -Qk. We should just handle this with -Qkk.
So I am "happy" with patches 2-4 in this series (without a detailed review), but think we should skip 1 and 5.
I realise that not all Arch packages have MTREE files. I am going to start a rebuild to get this done. Would you be fine keeping -Qk to just file existence checking if that was done?
A
The only problem I have with relying on -Qkk is that most of the things it checks are irrelevant to pacman and therefore noise when one just wants to verify that the filesystem matches the database at the level at which pacman operates. apg
On 29/06/14 12:25, Andrew Gregory wrote:
On 06/29/14 at 11:39am, Allan McRae wrote:
On 27/06/14 02:52, Andrew Gregory wrote:
If a directory has been replaced by a symlink, -Qk currently stats the symlink target rather than the symlink itself and doesn't check that the actual file type matches the package file list. This will make it difficult to discover errors once 4.2 is released and replacing directories with symlinks is no longer supported.
I like the bug fixing part (lstat directory replaced by symlink), but I am not convinced about the file type checking for directories only being added to -Qk. We should just handle this with -Qkk.
So I am "happy" with patches 2-4 in this series (without a detailed review), but think we should skip 1 and 5.
I realise that not all Arch packages have MTREE files. I am going to start a rebuild to get this done. Would you be fine keeping -Qk to just file existence checking if that was done?
A
The only problem I have with relying on -Qkk is that most of the things it checks are irrelevant to pacman and therefore noise when one just wants to verify that the filesystem matches the database at the level at which pacman operates.
OK - patches accepted with the minor modification needed to the man page. Allan
participants (2)
-
Allan McRae
-
Andrew Gregory