[users] Add a *permissions* setting for overriding useradd

This commit is contained in:
Adriaan de Groot 2024-09-11 15:36:54 +02:00
parent e57aab2008
commit f5c425345b
3 changed files with 10 additions and 0 deletions

View File

@ -259,6 +259,9 @@ public:
const QStringList& forbiddenLoginNames() const;
const QStringList& forbiddenHostNames() const;
int homePermissions() const { return m_homeDirPermissions; }
int homeUMask() const { return m_homeDirPermissions >= 0 ? ( ( ~m_homeDirPermissions ) & 0777 ) : -1; }
public Q_SLOTS:
/** @brief Sets the user's shell if possible
*

View File

@ -214,9 +214,15 @@ allowWeakPasswordsDefault: false
# contains "root" and "nobody", but may be extended to list other special
# names for a given distro (eg. "video", or "mysql" might not be a valid
# end-user login name).
# - *home_permissions* Home directory of the user is given **approximately**
# this set of permissions. Write the permissions in octal. If not set,
# there is no default and no permission-setting is done (uses defaults of
# `useradd` in the target). A umask is computed from these permissions
# and passed to `useradd`.
user:
shell: /bin/bash
forbidden_names: [ root ]
home_permissions: 0700
# Hostname settings

View File

@ -13,6 +13,7 @@ properties:
# User shell, should be path to /bin/sh or so
shell: { type: string }
forbidden_names: { type: array, items: { type: string } }
home_permissions: { type: string }
# Group settings
defaultGroups:
type: array