Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zpool command complains about /etc/exports.d #10785

Closed
richardelling opened this issue Aug 23, 2020 · 3 comments · Fixed by #10934
Closed

zpool command complains about /etc/exports.d #10785

richardelling opened this issue Aug 23, 2020 · 3 comments · Fixed by #10934
Assignees
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@richardelling
Copy link
Contributor

System information

Type Version/Name
Distribution Name N/A
Distribution Version N/A
Linux Kernel N/A
Architecture N/A
ZFS Version post c15d36c
SPL Version

Describe the problem you're observing

If the /etc/exports.d directory does not exist, then libshare_nfs_init() attempts to
create it. This can and should fail for non-root users. However, attempts
to run zpool as a non-root user are rewarded with

user$ zpool list
failed to create /etc/exports.d: Permission denied
no pools available

Describe how to reproduce the problem

  1. Verify the /etc/exports.d directory does not exist
  2. As a non-root user, type zpool list

Include any warning/errors/backtraces from the system logs

@richardelling
Copy link
Contributor Author

@grwilson I noticed this when testing zpool_influxdb #10786 and was surprised that it seems libzfs_init() causes this.

@grwilson
Copy link
Member

@richardelling thanks for filing the issue, I'm working on fixing this and will open a PR soon.

@grwilson grwilson linked a pull request Sep 16, 2020 that will close this issue
12 tasks
@gyakovlev
Copy link
Contributor

it also affects grub in a funny way https://bugs.gentoo.org/742503
gentoo package builds are sandboxed, so if grub built with libzfs, it triggers sandbox violation, because some libzfs linked binaries are run during build.

@behlendorf behlendorf added the Type: Defect Incorrect behavior (e.g. crash, hang) label Sep 18, 2020
behlendorf pushed a commit that referenced this issue Sep 25, 2020
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.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Wilson <gwilson@delphix.com>
Closes #10785
Closes #10934
behlendorf pushed a commit that referenced this issue Oct 1, 2020
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.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Wilson <gwilson@delphix.com>
Closes #10785
Closes #10934
jsai20 pushed a commit to jsai20/zfs that referenced this issue Mar 30, 2021
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.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Wilson <gwilson@delphix.com>
Closes openzfs#10785
Closes openzfs#10934
sempervictus pushed a commit to sempervictus/zfs that referenced this issue May 31, 2021
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.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Wilson <gwilson@delphix.com>
Closes openzfs#10785
Closes openzfs#10934
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants