HUE-9522 [useradmin] fix user home folder creation to use umask

Review Request #15528 — Created Oct. 29, 2020 and submitted

quadoss
hue
master
HUE-9522
hue
asnaik, johan, ranade, romain, weixia, yingc
commit f63c013f0ffb69d84afa302794eec107a6608fe7
Author: Mahesh Balakrishnan <mbalakrishnan@cloudera.com>
Date:   Thu Oct 29 20:20:57 2020 -0700

    HUE-9522 [useradmin] fix user home folder creation to use umask

:100644 100644 bc948b4a10 fc23576e3e M	apps/useradmin/src/useradmin/conf.py
:100644 100644 a15cb60377 ec7fd82ca1 M	desktop/conf.dist/hue.ini
:100644 100644 6f207868b5 2b4e908c85 M	desktop/conf/pseudo-distributed.ini.tmpl
:100644 100644 2bc8d80898 ff71af4c94 M	desktop/libs/hadoop/src/hadoop/fs/hadoopfs.py

Tested this on 2 different cluster internally
1. With the default flag, saw the home dir getting created with 755 permission. (correct permission)
2. Changed the fs.permissions.umask-mode in hdfs to 027 and kept the flag as default and saw the new user home dir with 755. (correct permission)
3. Added the flag and set it to false in useradmin under hue safety value in cm (fs.permissions.umask-mode=027), created a new user and saw the permission as 750 (correct permission)

  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
quadoss
romain
  1. Nice!

    And if you want to learn how to easily do some quick unitest (by mocking the dependencies, there is https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/models_tests.py#L56 or I could do a skeletong)

  2. nit: spacing around =

  3. USE_HOME_DIR_PERMISSIONS.get() == True --> USE_HOME_DIR_PERMISSIONS.get()
    
    `int(HOME_DIR_PERMISSIONS.get(), 8) if USE_HOME_DIR_PERMISSIONS.get() else (0o777 & (0o1777 ^ get_umask_mode()))`
  4. 
      
quadoss
quadoss
quadoss
quadoss
Review request changed

Status: Closed (submitted)

Loading...