Skip to content

Commit 88d27c6

Browse files
authored
Merge pull request #14366 from teacup-on-rockingchair/sle16_dconf_gnome_patch
Sle16 dconf gnome patch
2 parents c84bbf3 + 241a701 commit 88d27c6

95 files changed

Lines changed: 568 additions & 141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

linux_os/guide/system/software/gnome/enable_dconf_user_profile/ansible/shared.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,4 @@
44
# complexity = low
55
# disruption = medium
66

7-
- name: "Configure GNOME3 DConf User Profile"
8-
ansible.builtin.lineinfile:
9-
dest: "/etc/dconf/profile/gdm"
10-
line: "user-db:user\nsystem-db:gdm"
11-
create: yes
12-
state: present
7+
{{{ ansible_enable_dconf_user_profile(profile="gdm", database="gdm") }}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# platform = multi_platform_sle
22

3-
echo -e 'user-db:user\nsystem-db:gdm' > /etc/dconf/profile/gdm
3+
{{{ bash_enable_dconf_user_profile(profile="gdm", database="gdm") }}}

linux_os/guide/system/software/gnome/gnome_login_screen/dconf_gnome_disable_user_list/ansible/shared.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
create: yes
2222
register: result_lineinfile
2323

24+
{{% if product in ['sle15', 'sle16'] %}}
25+
{{{ ansible_enable_dconf_user_profile(profile="gdm", database="gdm") }}}
26+
{{% endif %}}
27+
2428
- name: Dconf Update
2529
ansible.builtin.command: dconf update
2630
when: result_ini is changed or result_lineinfile is changed

linux_os/guide/system/software/gnome/gnome_login_screen/dconf_gnome_disable_user_list/bash/shared.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@
55
{{{ bash_enable_dconf_user_profile(profile="gdm", database="gdm") }}}
66
{{% endif %}}
77

8+
{{% if product in ['sle15', 'sle16'] %}}
9+
{{{ bash_enable_dconf_user_profile(profile="gdm", database="gdm") }}}
10+
{{% endif %}}
11+
812
{{{ bash_dconf_settings("org/gnome/login-screen", "disable-user-list", "true", dconf_gdm_dir, "00-security-settings", rule_id=rule_id) }}}
913
{{{ bash_dconf_lock("org/gnome/login-screen", "disable-user-list", dconf_gdm_dir, "00-security-settings-lock") }}}

linux_os/guide/system/software/gnome/gnome_login_screen/dconf_gnome_disable_user_list/policy/stig/shared.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ fixtext: |-
1919
Configure {{{ full_name }}} to disable the user list at logon for graphical user interfaces.
2020
2121
Create a database to contain the systemwide screensaver settings (if it does not already exist) with the following command:
22-
Note: The example below is using the database "local" for the system. If the system is using another database in "/etc/dconf/profile/user", the file should be created under the appropriate subdirectory.
22+
Note: The example below is using the database "{{{ dconf_gdm_dir }}}" for the system. If the system is using another database in "/etc/dconf/profile/user", the file should be created under the appropriate subdirectory.
2323
24-
$ sudo touch /etc/dconf/db/local.d/02-login-screen
24+
$ sudo touch /etc/dconf/db/{{{ dconf_gdm_dir }}}/02-login-screen
2525
2626
[org/gnome/login-screen]
2727
disable-user-list=true
2828
2929
Update the system databases:
3030
3131
$ sudo dconf update
32-
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# platform = multi_platform_sle,multi_platform_slmicro
22

3-
if ! (sed -n '/^DISPLAYMANAGER_AUTOLOGIN=\"\"/p' /etc/sysconfig/displaymanager)
4-
then
3+
if ! grep -q '^DISPLAYMANAGER_AUTOLOGIN=""' /etc/sysconfig/displaymanager; then
54
sed -i "s/^DISPLAYMANAGER_AUTOLOGIN=.*/DISPLAYMANAGER_AUTOLOGIN=\"\"/g" /etc/sysconfig/displaymanager
65
fi
76

8-
if ! (sed -n '/^DISPLAYMANAGER_PASSWORD_LESS_LOGIN=\"no\"/p' /etc/sysconfig/displaymanager)
9-
then
7+
if ! grep -q '^DISPLAYMANAGER_PASSWORD_LESS_LOGIN="no"' /etc/sysconfig/displaymanager; then
108
sed -i "s/^DISPLAYMANAGER_PASSWORD_LESS_LOGIN=.*/DISPLAYMANAGER_PASSWORD_LESS_LOGIN=\"no\"/g" /etc/sysconfig/displaymanager
119
fi

linux_os/guide/system/software/gnome/gnome_media_settings/dconf_gnome_disable_automount/ansible/shared.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
# disruption = medium
66
- name: "Disable GNOME3 Automounting - automount"
77
community.general.ini_file:
8+
{{% if product in ['sle15', 'sle16'] %}}
9+
dest: /etc/dconf/db/{{{ dconf_gdm_dir }}}/00-security-settings
10+
{{% else %}}
811
dest: /etc/dconf/db/local.d/00-security-settings
12+
{{% endif %}}
913
section: org/gnome/desktop/media-handling
1014
option: automount
1115
value: "false"
@@ -15,20 +19,18 @@
1519

1620
- name: "Prevent user modification of GNOME3 Automounting - automount"
1721
ansible.builtin.lineinfile:
22+
{{% if product in ['sle15', 'sle16'] %}}
23+
path: /etc/dconf/db/{{{ dconf_gdm_dir }}}/locks/00-security-settings-lock
24+
{{% else %}}
1825
path: /etc/dconf/db/local.d/locks/00-security-settings-lock
26+
{{% endif %}}
1927
regexp: '^/org/gnome/desktop/media-handling/automount$'
2028
line: '/org/gnome/desktop/media-handling/automount'
2129
create: yes
2230
register: result_lineinfile
2331

24-
# apply fix for enable_dconf_user_profile, OVAL checks it
2532
{{% if product in ['sle15', 'sle16'] %}}
26-
- name: "Configure GNOME3 DConf User Profile"
27-
ansible.builtin.lineinfile:
28-
dest: "/etc/dconf/profile/gdm"
29-
line: "user-db:user\nsystem-db:gdm"
30-
create: yes
31-
state: present
33+
{{{ ansible_enable_dconf_user_profile(profile="gdm", database="gdm") }}}
3234
{{% endif %}}
3335

3436
- name: Dconf Update

linux_os/guide/system/software/gnome/gnome_media_settings/dconf_gnome_disable_automount/bash/shared.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
# apply fix for enable_dconf_user_profile, OVAL checks it
99
{{% if product in ['sle15', 'sle16'] %}}
1010
{{{ bash_enable_dconf_user_profile(profile="gdm", database="gdm") }}}
11-
{{% endif %}}
12-
11+
{{{ bash_dconf_settings("org/gnome/desktop/media-handling", "automount", "false", dconf_gdm_dir, "00-security-settings", rule_id=rule_id) }}}
12+
{{{ bash_dconf_lock("org/gnome/desktop/media-handling", "automount", dconf_gdm_dir, "00-security-settings-lock") }}}
13+
{{% else %}}
1314
{{{ bash_dconf_settings("org/gnome/desktop/media-handling", "automount", "false", "local.d", "00-security-settings", rule_id=rule_id) }}}
1415
{{{ bash_dconf_lock("org/gnome/desktop/media-handling", "automount", "local.d", "00-security-settings-lock") }}}
16+
{{% endif %}}

linux_os/guide/system/software/gnome/gnome_media_settings/dconf_gnome_disable_automount/oval/shared.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
</ind:textfilecontent54_test>
2121
<ind:textfilecontent54_object id="obj_dconf_gnome_disable_automount"
2222
version="1">
23+
{{% if product in ['sle15', 'sle16'] %}}
24+
<ind:path>/etc/dconf/db/{{{ dconf_gdm_dir }}}/</ind:path>
25+
{{% else %}}
2326
<ind:path>/etc/dconf/db/local.d/</ind:path>
27+
{{% endif %}}
2428
<ind:filename operation="pattern match">^.*$</ind:filename>
2529
<ind:pattern operation="pattern match">^\[org/gnome/desktop/media-handling\]([^\n]*\n+)+?automount=false$</ind:pattern>
2630
<ind:instance datatype="int">1</ind:instance>
@@ -33,7 +37,11 @@
3337
</ind:textfilecontent54_test>
3438
<ind:textfilecontent54_object id="obj_prevent_user_gnome_automount"
3539
version="1">
40+
{{% if product in ['sle15', 'sle16'] %}}
41+
<ind:path>/etc/dconf/db/{{{ dconf_gdm_dir }}}/locks/</ind:path>
42+
{{% else %}}
3643
<ind:path>/etc/dconf/db/local.d/locks/</ind:path>
44+
{{% endif %}}
3745
<ind:filename operation="pattern match">^.*$</ind:filename>
3846
<ind:pattern operation="pattern match">^/org/gnome/desktop/media-handling/automount$</ind:pattern>
3947
<ind:instance datatype="int">1</ind:instance>

linux_os/guide/system/software/gnome/gnome_media_settings/dconf_gnome_disable_automount/rule.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ description: |-
77
The system's default desktop environment, GNOME3, will mount
88
devices and removable media (such as DVDs, CDs and USB flash drives) whenever
99
they are inserted into the system. To disable automount within GNOME3, add or set
10-
<tt>automount</tt> to <tt>false</tt> in <tt>/etc/dconf/db/local.d/00-security-settings</tt>.
10+
<tt>automount</tt> to <tt>false</tt> in <tt>/etc/dconf/db/{{{ dconf_gdm_dir }}}/00-security-settings</tt>.
1111
For example:
1212
<pre>[org/gnome/desktop/media-handling]
1313
automount=false</pre>
1414
Once the settings have been added, add a lock to
15-
<tt>/etc/dconf/db/local.d/locks/00-security-settings-lock</tt> to prevent user modification.
15+
<tt>/etc/dconf/db/{{{ dconf_gdm_dir }}}/locks/00-security-settings-lock</tt> to prevent user modification.
1616
For example:
1717
<pre>/org/gnome/desktop/media-handling/automount</pre>
1818
After the settings have been set, run <tt>dconf update</tt>.
@@ -51,6 +51,5 @@ ocil: |-
5151
<pre>$ gsettings get org.gnome.desktop.media-handling automount</pre>
5252
If properly configured, the output for <tt>automount</tt> should be <tt>false</tt>.
5353
To ensure that users cannot enable automount in GNOME3, run the following:
54-
<pre>$ grep 'automount' /etc/dconf/db/local.d/locks/*</pre>
54+
<pre>$ grep 'automount' /etc/dconf/db/{{{ dconf_gdm_dir }}}/locks/*</pre>
5555
If properly configured, the output for <tt>automount</tt> should be <tt>/org/gnome/desktop/media-handling/automount</tt>
56-

0 commit comments

Comments
 (0)