Uploaded image for project: 'VCL'
  1. VCL
  2. VCL-1083

Data in shares mounted under Linux home directories may be deleted

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5.1
    • Component/s: vcld (backend)
    • Labels:
      None

      Description

      This issue mainly affects the new Site Configuration > NFS Mounts feature introduced in VCL 2.5. This feature allows you to specify one or more shares to be automatically mounted on the computer prior to the user logging in. These shares get mounted when the computer is reserved. One of the main benefits of this feature is that it allows NFS shares to be mounted under the home directory of the local user created for the reservation.

      If the user never logs in to the reservation, the computer is sanitized rather than being fully reloaded under most circumstances. The sanitization process involves deleting the local user account and associated home directory created for the user who never logged in.

      Unfortunately, in VCL 2.5 the call to delete the user account and the call to unmount any shares mounted for the NFS Mounts feature are in the wrong order. An attempt is made to delete the user account first and then unmount the shares.

      This is sort of a problem because the Linux userdel command tries to recursively and indiscriminately delete the home directory and everything underneath when passed the -r or --remove argument. There's apparently no check to see if any shares are mounted. (This would make sense since the userdel ultimately will fail if a share is mounted since it is unable to fully delete the home directory since it can't delete the mount point directory.) The end result is the home directory and mount point directory(ies) remain but everything underneath including files under the mounted share(s) that the local root account has write access to are deleted.

      The following appears in vcld.log when this problems occurs:

      |timeout|Linux.pm:delete_user|3134| ---- WARNING ----
      |timeout|Linux.pm:delete_user|3134| 2017-11-15 15:15:26|timeout|Linux.pm:delete_user|3134|failed to delete user '<username>' from <computer>, command: '/usr/sbin/userdel -r <username>', exit status: 12, output:
      |timeout|Linux.pm:delete_user|3134| userdel: error removing directory /home/<username>
      |timeout|Linux.pm:delete_user|3134| ( 0) Linux.pm, delete_user (line: 3134)
      |timeout|Linux.pm:delete_user|3134| (-1) OS.pm, delete_user_accounts (line: 549)
      |timeout|Linux.pm:delete_user|3134| (-2) Linux.pm, sanitize (line: 1501)
      |timeout|Linux.pm:delete_user|3134| (-3) reclaim.pm, call_os_sanitize (line: 319)
      |timeout|Linux.pm:delete_user|3134| (-4) reclaim.pm, process (line: 190)
      |timeout|Linux.pm:delete_user|3134| (-5) vcld, make_new_child (line: 601)
      |timeout|Linux.pm:delete_user|3134| (-6) vcld, main (line: 353)
      

        Attachments

          Activity

            People

            • Assignee:
              arkurth Andrew Kurth
              Reporter:
              arkurth Andrew Kurth
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: