[pacman-dev] [PATCH] Disable directory ownership warnings

Andrew Gregory andrew.gregory.8 at gmail.com
Wed Feb 4 05:11:17 UTC 2015


On 02/04/15 at 02:53pm, Allan McRae wrote:
> There was a lot of confusion regarding these warnings, particularly for
> packages that create users post_install and then chown the directories.
> 
> Signed-off-by: Allan McRae <allan at archlinux.org>
> ---

 add.c: In function ‘extract_single_file’:
 add.c:231:9: error: unused variable ‘entrygid’ [-Werror=unused-variable]
    gid_t entrygid = archive_entry_gid(entry);
         ^
 add.c:230:9: error: unused variable ‘entryuid’ [-Werror=unused-variable]
    uid_t entryuid = archive_entry_uid(entry);

Also, this doesn't need to remove the permission check, just the
ownership check.  I don't think there's any valid reason for install
scripts to chmod anything, and we've had that check for quite a while.

apg

>  lib/libalpm/add.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
> index 82461ee..a6b83f5 100644
> --- a/lib/libalpm/add.c
> +++ b/lib/libalpm/add.c
> @@ -231,6 +231,12 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
>  		gid_t entrygid = archive_entry_gid(entry);
>  
>  		/* case 6: existing dir, ignore it */
> +
> +#if 0
> +		/* Disable these warnings until our user management has improved.  Currently
> +		   many packages have to create users in post_install and chown the directories.
> +		   These all resulted in "false-positive" warnings. */
> +
>  		if(lsbuf.st_mode != entrymode) {
>  			/* if filesystem perms are different than pkg perms, warn user */
>  			mode_t mask = 07777;
> @@ -252,6 +258,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
>  					"filesystem: %u:%u  package: %u:%u\n", filename,
>  					lsbuf.st_uid, lsbuf.st_gid, entryuid, entrygid);
>  		}
> +#endif
>  
>  		_alpm_log(handle, ALPM_LOG_DEBUG, "extract: skipping dir extraction of %s\n",
>  				filename);
> -- 
> 2.2.2


More information about the pacman-dev mailing list