Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iopsys
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Feed
iopsys
Commits
2be4eeeb
Verified
Commit
2be4eeeb
authored
3 months ago
by
Vivek Dutta
Browse files
Options
Downloads
Patches
Plain Diff
linux-pam: 1.7.0
parent
a49407ad
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
linux-pam/Makefile
+38
-0
38 additions, 0 deletions
linux-pam/Makefile
linux-pam/files/pam_faillock.uci_default
+43
-0
43 additions, 0 deletions
linux-pam/files/pam_faillock.uci_default
with
81 additions
and
0 deletions
linux-pam/Makefile
0 → 100644
+
38
−
0
View file @
2be4eeeb
include
$(TOPDIR)/rules.mk
PKG_NAME
:=
linux-pam
PKG_VERSION
:=
1.7.0
PKG_RELEASE
:=
1
PKG_SOURCE_PROTO
:=
git
PKG_SOURCE_URL
:=
https://github.com/linux-pam/linux-pam.git
PKG_SOURCE_VERSION
:=
v
$(
PKG_VERSION
)
PKG_MIRROR_HASH
:=
skip
include
$(INCLUDE_DIR)/package.mk
include
$(INCLUDE_DIR)/meson.mk
define
Package/linux-pam
SECTION
:=
libs
CATEGORY
:=
Libraries
TITLE
:=
Linux PAM Module
DEPENDS
:=
+libpam
endef
MESON_ARGS
+=
\
-Dprefix
=
/usr
\
-Ddefault_library
=
shared
\
-Ddocs
=
disabled
\
-Deconf
=
disabled
\
-Dselinux
=
disabled
\
-Dnis
=
disabled
\
-Dexamples
=
false
\
-Dxtests
=
false
define
Package/linux-pam/install
$(INSTALL_DIR)
$(1)/usr/lib/security
$(INSTALL_DIR)
$(1)/etc/uci-defaults/
$(INSTALL_BIN)
./files/pam_faillock.uci_default
$(1)/etc/uci-defaults/99-add_pam_faillock
endef
$(
eval
$(
call BuildPackage,linux-pam
))
This diff is collapsed.
Click to expand it.
linux-pam/files/pam_faillock.uci_default
0 → 100644
+
43
−
0
View file @
2be4eeeb
#!/bin/sh
create_faillock_files
()
{
# also create files needed by pam_faillock
touch
/var/log/faillock
chmod
700 /var/log/faillock
touch
/var/log/btmp
chmod
700 /var/log/btmp
}
update_pam_common_auth
()
{
local
file
=
"/etc/pam.d/common-auth"
local
deny
=
6
local
unlock_time
=
300
# update pam_unix.so line
sed
-i
-E
's|^.*pam_unix\.so.*|auth\t sufficient\tpam_unix.so nullok_secure|'
"
$file
"
# Insert pam_faillock lines before and after pam_unix.so
sed
-i
-E
"/pam_unix.so nullok_secure/i auth required pam_faillock.so preauth deny=
$deny
even_deny_root unlock_time=
$unlock_time
"
"
$file
"
sed
-i
-E
"/pam_unix.so nullok_secure/a auth [default=die] pam_faillock.so authfail audit deny=
$deny
even_deny_root unlock_time=
$unlock_time
"
"
$file
"
}
update_pam_common_account
()
{
# update account file
sed
-i
"/pam_unix.so/ i account required pam_faillock.so"
/etc/pam.d/common-account
}
if
[
-f
"/usr/lib/security/pam_faillock.so"
]
;
then
update_pam_common_auth
update_pam_common_account
create_faillock_files
fi
if
[
-f
/etc/config/sshd
]
;
then
uci
-q
set
sshd.@sshd[0].UsePAM
=
1
uci commit sshd
fi
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment