Skip to content

Commit

Permalink
Merge pull request #1313 from yast/huha-drop-scripts
Browse files Browse the repository at this point in the history
Drop Obsolete login.defs Scripts USERADD_CMD, USERDEL_PRECMD, USERDEL_POSTCMD, USERADD_CMD
  • Loading branch information
shundhammer authored Oct 2, 2024
2 parents 264c64e + 8aa5743 commit 717d99f
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 89 deletions.
4 changes: 0 additions & 4 deletions library/general/src/lib/cfa/login_defs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class LoginDefs < BaseModel
:fail_delay,
:gid_max,
:gid_min,
:groupadd_cmd,
:home_mode,
:pass_max_days,
:pass_min_days,
Expand All @@ -69,9 +68,6 @@ class LoginDefs < BaseModel
:uid_max,
:uid_min,
:umask,
:useradd_cmd,
:userdel_postcmd,
:userdel_precmd,
:usergroups_enab
].freeze

Expand Down
6 changes: 1 addition & 5 deletions library/general/test/cfa/login_defs_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
fail_delay: "3",
gid_max: "60000",
gid_min: "1000",
groupadd_cmd: "/usr/sbin/groupadd.local",
pass_max_days: "99999",
pass_min_days: "0",
pass_warn_age: "7",
Expand All @@ -77,10 +76,7 @@
sys_uid_max: "499",
sys_uid_min: "100",
uid_max: "60000",
uid_min: "1000",
useradd_cmd: "/usr/sbin/useradd.local",
userdel_postcmd: "/usr/sbin/userdel-post.local",
userdel_precmd: "/usr/sbin/userdel-pre.local"
uid_min: "1000"
}.freeze

ATTRS_VALUES.each do |attr, value|
Expand Down
6 changes: 3 additions & 3 deletions library/general/test/cfa/shadow_config_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@

context "when a conflict is detected" do
before do
allow(config).to receive(:conflicts).and_return([:fail_delay, :useradd_cmd])
allow(config).to receive(:conflicts).and_return([:fail_delay, :encrypt_method])
end

it "logs conflicting attributes" do
expect(config.log).to receive(:warn).with(/overridden: fail_delay, useradd_cmd/)
expect(config.log).to receive(:warn).with(/overridden: fail_delay, encrypt_method/)
config.save
end
end
Expand All @@ -139,7 +139,7 @@
before { config.load }

it "returns override YaST settings" do
expect(config.conflicts).to eq([:useradd_cmd])
expect(config.conflicts).to eq([:encrypt_method])
end
end

Expand Down
25 changes: 0 additions & 25 deletions library/general/test/data/login.defs-example
Original file line number Diff line number Diff line change
Expand Up @@ -225,36 +225,13 @@ ENCRYPT_METHOD SHA512
#
DEFAULT_HOME yes

#
# If defined, this command is run when adding a user.
# It should rebuild any NIS database etc. to add the
# new created account.
#
USERADD_CMD /usr/sbin/useradd.local

#
# If defined, this command is run when removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed (passed as the first argument).
#
# See also USERDEL_PRECMD and USERDEL_POSTCMD below.
#
#USERDEL_CMD /usr/sbin/userdel_local

#
# If defined, this command is run before removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed.
#
USERDEL_PRECMD /usr/sbin/userdel-pre.local

#
# If defined, this command is run after removing a user.
# It should rebuild any NIS database etc. to remove the
# account from it.
#
USERDEL_POSTCMD /usr/sbin/userdel-post.local

#
# Enable setting of the umask group bits to be the same as owner bits
# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
Expand Down Expand Up @@ -295,5 +272,3 @@ FORCE_SHADOW no
# but be aware that the result could depend on the locale settings.
#
CHARACTER_CLASS [A-Za-z_][A-Za-z0-9_.-]*

GROUPADD_CMD /usr/sbin/groupadd.local
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
USERADD_CMD /usr/sbin/useradd.local
UMASK 022
ENCRYPT_METHOD MD5
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
ENCRYPT_METHOD SHA256
USERADD_CMD /usr/local/sbin/useradd.local
23 changes: 0 additions & 23 deletions library/general/test/data/login.defs/custom/usr/etc/login.defs
Original file line number Diff line number Diff line change
Expand Up @@ -225,36 +225,13 @@ ENCRYPT_METHOD SHA512
#
DEFAULT_HOME yes

#
# If defined, this command is run when adding a user.
# It should rebuild any NIS database etc. to add the
# new created account.
#
USERADD_CMD /usr/sbin/useradd.local

#
# If defined, this command is run when removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed (passed as the first argument).
#
# See also USERDEL_PRECMD and USERDEL_POSTCMD below.
#
#USERDEL_CMD /usr/sbin/userdel_local

#
# If defined, this command is run before removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed.
#
USERDEL_PRECMD /usr/sbin/userdel-pre.local

#
# If defined, this command is run after removing a user.
# It should rebuild any NIS database etc. to remove the
# account from it.
#
USERDEL_POSTCMD /usr/sbin/userdel-post.local

#
# Enable setting of the umask group bits to be the same as owner bits
# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
Expand Down
27 changes: 1 addition & 26 deletions library/general/test/data/login.defs/vendor/usr/etc/login.defs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ LOGIN_TIMEOUT 60
# any combination of letters "frwh" (full name, room number, work
# phone, home phone). If not defined, no changes are allowed.
# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
#
#
CHFN_RESTRICT rwh

#
Expand Down Expand Up @@ -225,36 +225,13 @@ ENCRYPT_METHOD SHA512
#
DEFAULT_HOME yes

#
# If defined, this command is run when adding a user.
# It should rebuild any NIS database etc. to add the
# new created account.
#
USERADD_CMD /usr/sbin/useradd.local

#
# If defined, this command is run when removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed (passed as the first argument).
#
# See also USERDEL_PRECMD and USERDEL_POSTCMD below.
#
#USERDEL_CMD /usr/sbin/userdel_local

#
# If defined, this command is run before removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed.
#
USERDEL_PRECMD /usr/sbin/userdel-pre.local

#
# If defined, this command is run after removing a user.
# It should rebuild any NIS database etc. to remove the
# account from it.
#
USERDEL_POSTCMD /usr/sbin/userdel-post.local

#
# Enable setting of the umask group bits to be the same as owner bits
# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
Expand Down Expand Up @@ -296,5 +273,3 @@ FORCE_SHADOW no
#
#CHARACTER_CLASS [A-Za-z_][A-Za-z0-9_.-]*[A-Za-z0-9_.$-]\?
CHARACTER_CLASS [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_][ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-]*[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.$-]\?

GROUPADD_CMD /usr/sbin/groupadd.local
7 changes: 7 additions & 0 deletions package/yast2.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Oct 1 13:28:34 UTC 2024 - Stefan Hundhammer <shundhammer@suse.com>

- Removed obsolete USERADD_CMD, USERDEL_PRECMD, USERDEL_POSTCMD,
GROUPADD_CMD (bsc#1231006)
- 5.0.10

-------------------------------------------------------------------
Wed Jul 10 12:19:16 UTC 2024 - Stefan Hundhammer <shundhammer@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2
Version: 5.0.9
Version: 5.0.10

Release: 0
Summary: YaST2 Main Package
Expand Down

0 comments on commit 717d99f

Please sign in to comment.