Skip to content

Commit

Permalink
Updates to libs
Browse files Browse the repository at this point in the history
Signed-off-by: Umer Saleem <[email protected]>
  • Loading branch information
usaleem-ix committed Jan 9, 2024
1 parent 887a59d commit f2e05f0
Show file tree
Hide file tree
Showing 15 changed files with 1,041 additions and 28 deletions.
5 changes: 2 additions & 3 deletions contrib/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,9 @@ Depends: openzfs-libnvpair3 (= ${binary:Version}),
openzfs-libuutil3 (= ${binary:Version}),
openzfs-libzfs4 (= ${binary:Version}),
openzfs-libzpool5 (= ${binary:Version}),
openzfs-python3-libzfsacl (= ${binary:Version})
openzfs-python3-libzfsacl (= ${binary:Version}),
python3,
${misc:Depends},
${shlibs:Depends}
${misc:Depends}
Recommends: lsb-base, openzfs-zfs-modules | openzfs-zfs-dkms, openzfs-zfs-zed
Breaks: openrc,
spl (<< 0.7.9-2),
Expand Down
2 changes: 2 additions & 0 deletions contrib/debian/openzfs-python3-libzfsacl.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
usr/lib/python3/dist-packages/libzfsacl-*.egg-info
usr/lib/python3/dist-packages/libzfsacl.cpython-*.so
lib/x86_64-linux-gnu/libzfsacl.so.*
lib/x86_64-linux-gnu/libsunacl.so.*
4 changes: 3 additions & 1 deletion include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ USER_H = \
libzfs_core.h \
libzfsbootenv.h \
libzutil.h \
thread_pool.h
sunacl.h \
thread_pool.h \
zfsacl.h


if CONFIG_USER
Expand Down
2 changes: 1 addition & 1 deletion lib/libzfsacl/sunacl.h → include/sunacl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/

#ifndef SUNACL_H
#define SUNACL_H
#define SUNACL_H extern __attribute__((visibility("default")))

#include <sys/types.h> /* uid_t */

Expand Down
6 changes: 3 additions & 3 deletions lib/libzfsacl/libzfsacl.h → include/zfsacl.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#ifndef __ZFSACL_H__
#define __ZFSACL_H__
#define __ZFSACL_H__ extern __attribute__((visibility("default")))

#include <zfs_config.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>

typedef enum { B_FALSE, B_TRUE } boolean_t;
#define zfsace4 zfsacl_entry
typedef unsigned int uint_t;

/*
Expand Down Expand Up @@ -263,7 +264,6 @@ boolean_t zfsace_set_who(zfsacl_entry_t _entry, zfsace_who_t _who,
zfsace_id_t _aeid);
boolean_t zfsace_set_entry_type(zfsacl_entry_t _entry, zfsace_entry_type_t _tp);


/*
* NFSv4 ACL-wide flags
* used in zfsacl_get_aclflags() and zfsacl_set_aclflags()
Expand Down
2 changes: 2 additions & 0 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ include $(srcdir)/%D%/libunicode/Makefile.am
include $(srcdir)/%D%/libuutil/Makefile.am
include $(srcdir)/%D%/libzfs_core/Makefile.am
include $(srcdir)/%D%/libzfs/Makefile.am
include $(srcdir)/%D%/libzfsacl/zfsacl/Makefile.am
include $(srcdir)/%D%/libzfsacl/Makefile.am
include $(srcdir)/%D%/libzfsbootenv/Makefile.am
include $(srcdir)/%D%/libzpool/Makefile.am
include $(srcdir)/%D%/libzstd/Makefile.am
include $(srcdir)/%D%/libzutil/Makefile.am
if BUILD_LINUX
include $(srcdir)/%D%/libefi/Makefile.am
include $(srcdir)/%D%/libzfsacl/sunacl/Makefile.am
endif


Expand Down
7 changes: 1 addition & 6 deletions lib/libzfsacl/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
dist_noinst_DATA += \
%D%/sunacl.h \
%D%/libzfsacl.h \
%D%/libpyzfsacl.c \
%D%/libsunacl.c \
%D%/libzfsacl_impl_freebsd.c \
%D%/libzfsacl_impl_linux.c
%D%/libpyzfsacl.c

SUBSTFILES += %D%/setup.py

Expand Down
3 changes: 2 additions & 1 deletion lib/libzfsacl/libpyzfsacl.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

#include <stdint.h>
#include <zfsacl.h>
#include <Python.h>
#include "libzfsacl.h"

#define Py_TPFLAGS_HAVE_ITER 0

Expand Down
2 changes: 1 addition & 1 deletion lib/libzfsacl/libzfsacl_impl_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ format_flags(char *str, size_t sz, const zfsacl_entry_t entry, size_t *off)
to_set = '-';
}
str[cnt] = to_set;
cnt += rv;
cnt++;
}

*off += cnt;
Expand Down
10 changes: 3 additions & 7 deletions lib/libzfsacl/setup.py.in
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
from setuptools import setup, Extension, find_packages
import os
import sys

srcdir = '@abs_top_srcdir@/lib/libzfsacl'

topsrcdir = '@abs_top_srcdir@'
relpath_topsrcdir = os.path.relpath(topsrcdir)
if sys.platform.startswith('linux'):
src = ['libzfsacl_impl_linux.c', 'libpyzfsacl.c', 'libsunacl.c']
else:
src = ['libzfsacl_impl_freebsd.c', 'libpyzfsacl.c']
incdir = [topsrcdir, topsrcdir + '/include', topsrcdir + '/lib/libspl/include' ]
src = ['libpyzfsacl.c']

libzfsacl_mod = Extension('libzfsacl', include_dirs=[relpath_topsrcdir],
libzfsacl_mod = Extension('libzfsacl', include_dirs=incdir,
sources=src)

setup(
Expand Down
22 changes: 22 additions & 0 deletions lib/libzfsacl/sunacl/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
libsunacl_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS)

lib_LTLIBRARIES += libsunacl.la
CPPCHECKTARGETS += libsunacl.la

libsunacl_la_CPPFLAGS = $(AM_CPPFLAGS)

dist_libsunacl_la_SOURCES = \
%D%/libsunacl.c

libsunacl_la_LIBADD = \
libzfsacl.la \
libzfs.la

libsunacl_la_LDFLAGS =

if !ASAN_ENABLED
libsunacl_la_LDFLAGS += -Wl,-z,defs
endif

libsunacl_la_LDFLAGS += -version-info 1:0:0

Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@

#include <arpa/inet.h>
#include <assert.h>
#include "libzfsacl.h"
#include "sunacl.h"
#include <zfsacl.h>
#include <sunacl.h>
#include <string.h>


#define ACE_GETACL 4
#define ACE_SETACL 5
#define ACE_GETACLCNT 6

int
static int
acl_from_aces(zfsacl_t aclp, const ace_t *aces, int nentries)
{
int i;
Expand Down Expand Up @@ -126,7 +126,7 @@ acl_from_aces(zfsacl_t aclp, const ace_t *aces, int nentries)
return (0);
}

int
static int
aces_from_acl(ace_t *aces, int *nentries, zfsacl_t aclp)
{
int i;
Expand Down
20 changes: 20 additions & 0 deletions lib/libzfsacl/zfsacl/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
libzfsacl_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS)

lib_LTLIBRARIES += libzfsacl.la
CPPCHECKTARGETS += libzfsacl.la

libzfsacl_la_CPPFLAGS = $(AM_CPPFLAGS)

dist_libzfsacl_la_SOURCES = \
%D%/libzfsacl_impl_linux.c

libzfsacl_la_LIBADD = \
libzfs.la

libzfsacl_la_LDFLAGS =

if !ASAN_ENABLED
libzfsacl_la_LDFLAGS += -Wl,-z,defs
endif

libzfsacl_la_LDFLAGS += -version-info 1:0:0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "libzfsacl.h"
#include "zfsacl.h"
#include <sys/acl.h>

#define BSDACE(zfsace) ((acl_entry_t)zfsace)
Expand Down
Loading

0 comments on commit f2e05f0

Please sign in to comment.