[pacman-dev] [PATCH] unlink_file: strip trailing slashes
If the user replaces a directory with a symlink, libalpm would get
confused because the trailing slash causes system calls to resolve the
symlink. This leads to errors and a misleading message during upgrades.
Even though libalpm does not support this, it should not be giving
misleading errors.
Also adds an overflow check.
Fixes FS#51377
Signed-off-by: Andrew Gregory
On 10/04/17 09:49, Andrew Gregory wrote:
Subtle problems like this could be avoided by removing the trailing slashes from libalpm's internal file lists. Is there any reason not to remove them and use a field in the file_t struct to indicate type? It already has a mode field that we could use.
At the moment, that is the only way we know something should be a directory from the local db. If the local db contained that information in another format, I'd be happy to remove the trailing slash. A
On 12/04/17 12:00, Allan McRae wrote:
On 10/04/17 09:49, Andrew Gregory wrote:
Subtle problems like this could be avoided by removing the trailing slashes from libalpm's internal file lists. Is there any reason not to remove them and use a field in the file_t struct to indicate type? It already has a mode field that we could use.
At the moment, that is the only way we know something should be a directory from the local db. If the local db contained that information in another format, I'd be happy to remove the trailing slash.
I forgot about mtree files! There a possibility of a package being installed for a long time with no mtree file. To make this change to the local database files, we would need to enforce mtree files being present. At least one release with a deprecation message. A
On 04/12/17 at 12:08pm, Allan McRae wrote:
On 12/04/17 12:00, Allan McRae wrote:
On 10/04/17 09:49, Andrew Gregory wrote:
Subtle problems like this could be avoided by removing the trailing slashes from libalpm's internal file lists. Is there any reason not to remove them and use a field in the file_t struct to indicate type? It already has a mode field that we could use.
At the moment, that is the only way we know something should be a directory from the local db. If the local db contained that information in another format, I'd be happy to remove the trailing slash.
I forgot about mtree files!
There a possibility of a package being installed for a long time with no mtree file. To make this change to the local database files, we would need to enforce mtree files being present. At least one release with a deprecation message.
We should be able to leave the db format alone. I think all we need to do is have the various filelist builders strip the trailing slash, or not add it as the case may be. The major drawback that I see is breaking libalpm front-ends that rely on the current behavior. apg
participants (2)
-
Allan McRae
-
Andrew Gregory