diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-11-25 22:39:15 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-11-25 22:39:15 +0000 |
commit | d934827bf44b7cfcf6711964418148fa60877668 (patch) | |
tree | 0625f358789b5e015e49db139cc1dbc9be00428f /sys-fs/zfs/files | |
parent | 2e34d110f164bf74d55fced27fe0000201b3eec5 (diff) |
gentoo resync : 25.11.2020
Diffstat (limited to 'sys-fs/zfs/files')
-rw-r--r-- | sys-fs/zfs/files/0.8.4-initconfdir.patch | 35 | ||||
-rw-r--r-- | sys-fs/zfs/files/2.0.0_rc2-exports-d-permissions.patch | 189 |
2 files changed, 0 insertions, 224 deletions
diff --git a/sys-fs/zfs/files/0.8.4-initconfdir.patch b/sys-fs/zfs/files/0.8.4-initconfdir.patch deleted file mode 100644 index aac40896f39b..000000000000 --- a/sys-fs/zfs/files/0.8.4-initconfdir.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 5dbe98184278878746a5f548fead1d2ef1e98dbe Mon Sep 17 00:00:00 2001 -From: Georgy Yakovlev <gyakovlev@gentoo.org> -Date: Tue, 26 May 2020 16:44:54 -0700 -Subject: [PATCH] 0.8.4 initconfdir - -fix for https://github.com/openzfs/zfs/issues/10375 - ---- - etc/zfs/Makefile.am | 1 + - etc/zfs/Makefile.in | 9 +++++---- - 2 files changed, 6 insertions(+), 4 deletions(-) - -diff --git a/etc/zfs/Makefile.am b/openzfs/etc/zfs/Makefile.am -index 81567a4..5370f41 100644 ---- a/etc/zfs/Makefile.am -+++ b/etc/zfs/Makefile.am -@@ -1,4 +1,5 @@ - pkgsysconfdir = $(sysconfdir)/zfs -+initconfdir = $(DEFAULT_INITCONF_DIR) - - pkgsysconf_DATA = \ - vdev_id.conf.alias.example \ -diff --git a/etc/zfs/Makefile.in b/etc/zfs/Makefile.in -index fb02811..795d3b1 100644 -@@ -571,6 +571,7 @@ udevdir = @udevdir@ - udevruledir = @udevruledir@ - zfsexecdir = @zfsexecdir@ - pkgsysconfdir = $(sysconfdir)/zfs -+initconfdir = $(DEFAULT_INITCONF_DIR) - pkgsysconf_DATA = \ - vdev_id.conf.alias.example \ - vdev_id.conf.sas_direct.example \ --- -2.26.2 - diff --git a/sys-fs/zfs/files/2.0.0_rc2-exports-d-permissions.patch b/sys-fs/zfs/files/2.0.0_rc2-exports-d-permissions.patch deleted file mode 100644 index 4acaf465a7bc..000000000000 --- a/sys-fs/zfs/files/2.0.0_rc2-exports-d-permissions.patch +++ /dev/null @@ -1,189 +0,0 @@ -From fe413a4d901a243d98cfef16ea330f7114a104ea Mon Sep 17 00:00:00 2001 -From: George Wilson <george.wilson@delphix.com> -Date: Tue, 15 Sep 2020 22:57:16 -0400 -Subject: [PATCH] zpool command complains about /etc/exports.d - -If the /etc/exports.d directory does not exist, then we should only -create it when we're performing an action which already requires root -privileges. - -This commit moves the directory creation to the enable/disable code -path which ensures that we have the appropriate privileges. - -Signed-off-by: George Wilson <gwilson@delphix.com> -Closes #10785 ---- - lib/libshare/os/freebsd/nfs.c | 36 +++++++++++------- - lib/libshare/os/linux/nfs.c | 71 ++++++++++++++++++++--------------- - 2 files changed, 64 insertions(+), 43 deletions(-) - -diff --git a/lib/libshare/os/freebsd/nfs.c b/lib/libshare/os/freebsd/nfs.c -index 65f3b11bf9b..5951b9eafa2 100644 ---- a/lib/libshare/os/freebsd/nfs.c -+++ b/lib/libshare/os/freebsd/nfs.c -@@ -228,21 +228,33 @@ nfs_copy_entries(char *filename, const char *mountpoint) - int error = SA_OK; - char *line; - -- /* -- * If the file doesn't exist then there is nothing more -- * we need to do. -- */ - FILE *oldfp = fopen(ZFS_EXPORTS_FILE, "r"); -- if (oldfp == NULL) -- return (SA_OK); -- - FILE *newfp = fopen(filename, "w+"); -+ if (newfp == NULL) { -+ fprintf(stderr, "failed to open %s file: %s", filename, -+ strerror(errno)); -+ fclose(oldfp); -+ return (SA_SYSTEM_ERR); -+ } - fputs(FILE_HEADER, newfp); -- while ((line = zgetline(oldfp, mountpoint)) != NULL) -- fprintf(newfp, "%s\n", line); -- if (ferror(oldfp) != 0) { -- error = ferror(oldfp); -+ -+ /* -+ * The ZFS_EXPORTS_FILE may not exist yet. If that's the -+ * case then just write out the new file. -+ */ -+ if (oldfp != NULL) { -+ while ((line = zgetline(oldfp, mountpoint)) != NULL) -+ fprintf(newfp, "%s\n", line); -+ if (ferror(oldfp) != 0) { -+ error = ferror(oldfp); -+ } -+ if (fclose(oldfp) != 0) { -+ fprintf(stderr, "Unable to close file %s: %s\n", -+ filename, strerror(errno)); -+ error = error != 0 ? error : SA_SYSTEM_ERR; -+ } - } -+ - if (error == 0 && ferror(newfp) != 0) { - error = ferror(newfp); - } -@@ -252,8 +264,6 @@ nfs_copy_entries(char *filename, const char *mountpoint) - filename, strerror(errno)); - error = error != 0 ? error : SA_SYSTEM_ERR; - } -- fclose(oldfp); -- - return (error); - } - -diff --git a/lib/libshare/os/linux/nfs.c b/lib/libshare/os/linux/nfs.c -index a6a9b33d765..1efa321b7bc 100644 ---- a/lib/libshare/os/linux/nfs.c -+++ b/lib/libshare/os/linux/nfs.c -@@ -393,6 +393,14 @@ static char * - nfs_init_tmpfile(void) - { - char *tmpfile = NULL; -+ struct stat sb; -+ -+ if (stat(ZFS_EXPORTS_DIR, &sb) < 0 && -+ mkdir(ZFS_EXPORTS_DIR, 0755) < 0) { -+ fprintf(stderr, "failed to create %s: %s\n", -+ ZFS_EXPORTS_DIR, strerror(errno)); -+ return (NULL); -+ } - - if (asprintf(&tmpfile, "%s%s", ZFS_EXPORTS_FILE, ".XXXXXXXX") == -1) { - fprintf(stderr, "Unable to allocate temporary file\n"); -@@ -481,36 +489,49 @@ nfs_copy_entries(char *filename, const char *mountpoint) - size_t buflen = 0; - int error = SA_OK; - -- /* -- * If the file doesn't exist then there is nothing more -- * we need to do. -- */ - FILE *oldfp = fopen(ZFS_EXPORTS_FILE, "r"); -- if (oldfp == NULL) -- return (SA_OK); -- - FILE *newfp = fopen(filename, "w+"); -+ if (newfp == NULL) { -+ fprintf(stderr, "failed to open %s file: %s", filename, -+ strerror(errno)); -+ fclose(oldfp); -+ return (SA_SYSTEM_ERR); -+ } - fputs(FILE_HEADER, newfp); -- while ((getline(&buf, &buflen, oldfp)) != -1) { -- char *space = NULL; - -- if (buf[0] == '\n' || buf[0] == '#') -- continue; -- -- if ((space = strchr(buf, ' ')) != NULL) { -- int mountpoint_len = strlen(mountpoint); -+ /* -+ * The ZFS_EXPORTS_FILE may not exist yet. If that's the -+ * case then just write out the new file. -+ */ -+ if (oldfp != NULL) { -+ while (getline(&buf, &buflen, oldfp) != -1) { -+ char *space = NULL; - -- if (space - buf == mountpoint_len && -- strncmp(mountpoint, buf, mountpoint_len) == 0) { -+ if (buf[0] == '\n' || buf[0] == '#') - continue; -+ -+ if ((space = strchr(buf, ' ')) != NULL) { -+ int mountpoint_len = strlen(mountpoint); -+ -+ if (space - buf == mountpoint_len && -+ strncmp(mountpoint, buf, -+ mountpoint_len) == 0) { -+ continue; -+ } - } -+ fputs(buf, newfp); - } -- fputs(buf, newfp); -- } - -- if (oldfp != NULL && ferror(oldfp) != 0) { -- error = ferror(oldfp); -+ if (ferror(oldfp) != 0) { -+ error = ferror(oldfp); -+ } -+ if (fclose(oldfp) != 0) { -+ fprintf(stderr, "Unable to close file %s: %s\n", -+ filename, strerror(errno)); -+ error = error != 0 ? error : SA_SYSTEM_ERR; -+ } - } -+ - if (error == 0 && ferror(newfp) != 0) { - error = ferror(newfp); - } -@@ -521,8 +542,6 @@ nfs_copy_entries(char *filename, const char *mountpoint) - filename, strerror(errno)); - error = error != 0 ? error : SA_SYSTEM_ERR; - } -- fclose(oldfp); -- - return (error); - } - -@@ -701,13 +720,5 @@ static const sa_share_ops_t nfs_shareops = { - void - libshare_nfs_init(void) - { -- struct stat sb; -- - nfs_fstype = register_fstype("nfs", &nfs_shareops); -- -- if (stat(ZFS_EXPORTS_DIR, &sb) < 0 && -- mkdir(ZFS_EXPORTS_DIR, 0755) < 0) { -- fprintf(stderr, "failed to create %s: %s\n", -- ZFS_EXPORTS_DIR, strerror(errno)); -- } - } |