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

utils/nfs-ls.py is hanging #36

Open
jbd opened this issue Jul 31, 2020 · 1 comment
Open

utils/nfs-ls.py is hanging #36

jbd opened this issue Jul 31, 2020 · 1 comment

Comments

@jbd
Copy link
Contributor

jbd commented Jul 31, 2020

Hello,

If I run nfs-ls from libnfs using my user, I've got this expected result (secure mount):

$ nfs-ls nfs://127.0.0.1/usr
Failed to mount nfs share : mount_cb: RPC error: Mount failed with error MNT3ERR_ACCES(13) Permission denied(13)

It is working as root.

If I try nfs-ls.py, it is working as root, but it hangs with an unprivileged user:

$ python utils/nfs-ls.py nfs://127.0.0.1/usr
nfs <libnfs.NFS object at 0x7feeb93da040>

It hangs here. Here is the traceback after hitting ctrl-c:

nfs <libnfs.NFS object at 0x7feeb93da040>
^CTraceback (most recent call last):
  File "utils/nfs-ls.py", line 31, in <module>
    ls(sys.argv[1])
  File "utils/nfs-ls.py", line 21, in ls
    for ent in nfs.listdir("."):
  File "/home/jbdenis/Code/libnfs-python/env/lib/python3.8/site-packages/libnfs/__init__.py", line 223, in listdir
    ret = nfs_opendir(self._nfs, path, d)
  File "/home/jbdenis/Code/libnfs-python/env/lib/python3.8/site-packages/libnfs/libnfs.py", line 327, in nfs_opendir
    return _libnfs.nfs_opendir(nfs, path, nfsdir)
KeyboardInterrupt

Is that working as expected or should it be considered as a bug ?

Using python 2.7, it looks the same, with an additional segmentation fault:

$ python utils/nfs-ls.py nfs://127.0.0.1/usr
('nfs', <libnfs.NFS object at 0x7f72b6d4bcd0>)
^CTraceback (most recent call last):
  File "utils/nfs-ls.py", line 31, in <module>
    ls(sys.argv[1])
  File "utils/nfs-ls.py", line 21, in ls
    for ent in nfs.listdir("."):
  File "/home/jbdenis/Code/libnfs-python/env/lib/python2.7/site-packages/libnfs/__init__.py", line 223, in listdir
    ret = nfs_opendir(self._nfs, path, d)
  File "/home/jbdenis/Code/libnfs-python/env/lib/python2.7/site-packages/libnfs/libnfs.py", line 327, in nfs_opendir
    return _libnfs.nfs_opendir(nfs, path, nfsdir)
KeyboardInterrupt
Segmentation fault

Thank you !

jbd added a commit to jbd/libnfs-python that referenced this issue Aug 1, 2020
This should prevent the behavior seen in sahlberg#36.
@jbd
Copy link
Contributor Author

jbd commented Aug 1, 2020

I don't know if it is an ideal behavior, but it fails early and explicitly with this patch: #37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant