Public bug reported:

Thank you @joalif for troubleshooting the issue and finding the required
commit.

[impact]

When hosting an NFS share that is sharing the home directory of users
(e.g. /home), doing an "ls -l" on a client that has access to this share
will return permission denied errors for each user before showing the
output of the command. Below is an example output of the current version
of ls:

ghadi@nfs-client:/mnt/nfs_clientshare$ ls -l
ls: test_user1: Permission denied
ls: test_user2: Permission denied
total 12
drwxr-x--- 5 ghadi ghadi 4096 May  7 18:17 ghadi
drwxr-x--- 2  1001  1001 4096 Jun 17 15:25 test_user1
drwxr-x--- 2  1002  1002 4096 Jun 17 15:27 test_user2

There has been a patch upstream to resolve this issue that I have
already backported after some modifications to fit the current version
of coreutils being used:
https://cgit.git.savannah.gnu.org/cgit/coreutils.git/commit/?id=b58e321c8d5dd841f4170312692035a66b5ac149

[Test Plan]

1. On the NFS server create a few users and make sure they have a home 
directory:
 $ sudo useradd -m test_user1
 $ sudo useradd -m test_user2

2. Then setup the NFS server and make sure to share /home

3. On the client machine, mount the NFS share and run "ls -l"

4. With the current version of coreutils you will see the following
output:

$ ghadi@nfs-client:/mnt/nfs_clientshare$ ls -l
ls: test_user1: Permission denied
ls: test_user2: Permission denied
total 12
drwxr-x--- 5 ghadi ghadi 4096 May  7 18:17 ghadi
drwxr-x--- 2  1001  1001 4096 Jun 17 15:25 test_user1
drwxr-x--- 2  1002  1002 4096 Jun 17 15:27 test_user2

However in the patched version you will see the following:

$ ghadi@nfs-client:/mnt/nfs_clientshare$ ls -l 
total 12
drwxr-x---  5 ghadi ghadi 4096 May  7 18:17 ghadi
drwxr-x---? 2  1001  1001 4096 Jun 17 15:25 test_user1
drwxr-x---? 2  1002  1002 4096 Jun 17 15:27 test_user2


  
[Where problems could occur]

* The patch adds "?" symbols when it cannot get the metadata which could cause 
issues with some scripts
* Some errors that should be displayed might stop being displayed specially if 
they are related to reading file attributes (operations that involve the 
listxattr syscall)

** Affects: coreutils (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: coreutils (Ubuntu Noble)
     Importance: Undecided
     Assignee: Ghadi Rahme (ghadi-rahme)
         Status: New

** Affects: coreutils (Ubuntu Oracular)
     Importance: Undecided
     Assignee: Ghadi Rahme (ghadi-rahme)
         Status: New

** Affects: coreutils (Ubuntu Plucky)
     Importance: Undecided
     Assignee: Ghadi Rahme (ghadi-rahme)
         Status: New

** Also affects: coreutils (Ubuntu Noble)
   Importance: Undecided
       Status: New

** Also affects: coreutils (Ubuntu Oracular)
   Importance: Undecided
       Status: New

** Also affects: coreutils (Ubuntu Plucky)
   Importance: Undecided
       Status: New

** Changed in: coreutils (Ubuntu Noble)
     Assignee: (unassigned) => Ghadi Rahme (ghadi-rahme)

** Changed in: coreutils (Ubuntu Oracular)
     Assignee: (unassigned) => Ghadi Rahme (ghadi-rahme)

** Changed in: coreutils (Ubuntu Plucky)
     Assignee: (unassigned) => Ghadi Rahme (ghadi-rahme)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2115274

Title:
  ls -l returns permission denied errors on NFS share to /home

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/2115274/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to