From owner-dev-commits-ports-all@freebsd.org Thu May 6 05:49:49 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF96D637B30; Thu, 6 May 2021 05:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FbN2P3jrJz3kmy; Thu, 6 May 2021 05:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 707FB12DE9; Thu, 6 May 2021 05:49:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1465nnev032106; Thu, 6 May 2021 05:49:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1465nnRd032105; Thu, 6 May 2021 05:49:49 GMT (envelope-from git) Date: Thu, 6 May 2021 05:49:49 GMT Message-Id: <202105060549.1465nnRd032105@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: 6d9bd7171b6b - main - misc/librepo: Fix missing symbol 'flistxattr' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d9bd7171b6b5b3c4d9360be35c46fc2b02f5fff Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 May 2021 05:49:49 -0000 The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=6d9bd7171b6b5b3c4d9360be35c46fc2b02f5fff commit 6d9bd7171b6b5b3c4d9360be35c46fc2b02f5fff Author: Yuri Victorovich AuthorDate: 2021-05-06 05:47:17 +0000 Commit: Yuri Victorovich CommitDate: 2021-05-06 05:49:42 +0000 misc/librepo: Fix missing symbol 'flistxattr' flistxattr is a function from Linux's xattr API that isn't available on FreeBSD and is mapped to FreeBSD syscalls. flistxattr mapping was missing since some port update. Reported by: Rick Miller --- misc/librepo/Makefile | 1 + misc/librepo/files/xattr.c | 21 +++++++++++++++++++++ misc/librepo/files/xattr.h | 1 + 3 files changed, 23 insertions(+) diff --git a/misc/librepo/Makefile b/misc/librepo/Makefile index a247554909b4..333c18cc44b9 100644 --- a/misc/librepo/Makefile +++ b/misc/librepo/Makefile @@ -1,5 +1,6 @@ PORTNAME= librepo DISTVERSION= 1.14.0 +PORTREVISION= 1 CATEGORIES= misc MAINTAINER= yuri@FreeBSD.org diff --git a/misc/librepo/files/xattr.c b/misc/librepo/files/xattr.c index b89e82cf3df0..34ae5fce5ef6 100644 --- a/misc/librepo/files/xattr.c +++ b/misc/librepo/files/xattr.c @@ -10,6 +10,16 @@ // code below is adopted and simplified from the 'xattr' python module https://github.com/xattr/xattr/blob/master/xattr/lib_build.c +static void convert_bsd_list(char *namebuf, size_t size) { + size_t offset = 0; + while(offset < size) { + int length = (int) (unsigned char)namebuf[offset]; + memmove(namebuf+offset, namebuf+offset+1, length); + namebuf[offset+length] = '\0'; + offset += length+1; + } +} + int fsetxattr(int fd, const char *name, const void *value, size_t size, int flags) { int rv = 0; @@ -24,6 +34,17 @@ int fsetxattr(int fd, const char *name, const void *value, size_t size, int flag return rv; } +ssize_t flistxattr(int fd, char *namebuf, size_t size) { + ssize_t rv = 0; + + rv = extattr_list_fd(fd, EXTATTR_NAMESPACE_USER, namebuf, size); + + if (rv > 0 && namebuf) + convert_bsd_list(namebuf, rv); + + return rv; +} + ssize_t fgetxattr(int fd, const char *name, void *value, size_t size) { return extattr_get_fd(fd, EXTATTR_NAMESPACE_USER, name, value, size); } diff --git a/misc/librepo/files/xattr.h b/misc/librepo/files/xattr.h index 633417b953b3..8304b9a9660e 100644 --- a/misc/librepo/files/xattr.h +++ b/misc/librepo/files/xattr.h @@ -1,4 +1,5 @@ int fsetxattr(int fd, const char *name, const void *value, size_t size, int flags); +ssize_t flistxattr(int fd, char *namebuf, size_t size); ssize_t fgetxattr(int fd, const char *name, void *value, size_t size); int fremovexattr(int fd, const char *name);