Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Google Authenticator with pam as a package for TOTP in ssh #4852

Merged
merged 11 commits into from
Dec 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cross/google-authenticator-libpam/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
PKG_NAME = google-authenticator-libpam
PKG_VERS = 1.09
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/google/google-authenticator-libpam/archive/refs/tags
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)
hgy59 marked this conversation as resolved.
Show resolved Hide resolved

BUILD_DEPENDS = cross/linux-pam

HOMEPAGE = https://github.com/google/google-authenticator-libpam
COMMENT = PAM module for two-factor authentication logging into servers via SSH, OpenVPN, etc.
LICENSE = Apache-2.0

GNU_CONFIGURE = 1
PRE_CONFIGURE_TARGET = google-authenticator-libpam_pre_configure

ADDITIONAL_CPPFLAGS = -O2

include ../../mk/spksrc.cross-cc.mk

.PHONY: google-authenticator-libpam_pre_configure
google-authenticator-libpam_pre_configure:
$(RUN) ./bootstrap.sh
2 changes: 2 additions & 0 deletions cross/google-authenticator-libpam/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin:bin/google-authenticator
lib:lib/security/pam_google_authenticator.so
3 changes: 3 additions & 0 deletions cross/google-authenticator-libpam/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
google-authenticator-libpam-1.09.tar.gz SHA1 7138354a071291e794aebb988e280449d8ceea0e
google-authenticator-libpam-1.09.tar.gz SHA256 ab1d7983413dc2f11de2efa903e5c326af8cb9ea37765dacb39949417f7cd037
google-authenticator-libpam-1.09.tar.gz MD5 c0a5624f53d64f851775fe7e94732651
30 changes: 30 additions & 0 deletions cross/linux-pam/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
PKG_NAME = Linux-PAM
PKG_VERS = 1.5.2
PKG_EXT = tar.xz
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/linux-pam/linux-pam/releases/download/v$(PKG_VERS)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

HOMEPAGE = https://github.com/linux-pam/linux-pam
COMMENT = Linux PAM (Pluggable Authentication Modules for Linux) project.
LICENSE = 3-Clause BSD

GNU_CONFIGURE = 1
CONFIGURE_ARGS = --disable-regenerate-docu
CONFIGURE_ARGS += --disable-db
CONFIGURE_ARGS += --disable-nls

POST_INSTALL_TARGET = linux-pam_post_install_target

ADDITIONAL_CPPFLAGS = -O2
# some toolchains are missing the following definitions in
# {sysroot}/usr/include/linux/prctl.h
ADDITIONAL_CPPFLAGS += -DPR_SET_NO_NEW_PRIVS=36 -DPR_GET_NO_NEW_PRIVS=37

include ../../mk/spksrc.cross-cc.mk

.PHONY: linux-pam_post_install_target
# fix installation include folder
linux-pam_post_install_target:
install -m 755 -d $(INSTALL_DIR)$(INSTALL_PREFIX)/include/security
mv $(wildcard $(INSTALL_DIR)$(INSTALL_PREFIX)/include/*pam*.h) $(INSTALL_DIR)$(INSTALL_PREFIX)/include/security
9 changes: 9 additions & 0 deletions cross/linux-pam/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
lnk:lib/libpam.so
lnk:lib/libpam.so.0
lib:lib/libpam.so.0.85.1
lnk:lib/libpam_misc.so
lnk:lib/libpam_misc.so.0
lib:lib/libpam_misc.so.0.82.1
lnk:lib/libpamc.so
lnk:lib/libpamc.so.0
lib:lib/libpamc.so.0.82.1
3 changes: 3 additions & 0 deletions cross/linux-pam/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Linux-PAM-1.5.2.tar.xz SHA1 8d20308cbf17823e9b88b01c2c70df3e1ad9d654
Linux-PAM-1.5.2.tar.xz SHA256 e4ec7131a91da44512574268f493c6d8ca105c87091691b8e9b56ca685d4f94d
Linux-PAM-1.5.2.tar.xz MD5 895e8adfa14af334f679bbeb28503f66
4 changes: 3 additions & 1 deletion mk/spksrc.patch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ endif
ifeq ($(strip $(PATCHES)),)
ifeq ($(strip $(ARCH)),)
PATCHES = $(wildcard patches/*.patch)
else
else ifneq ($(filter cross diyspk spk,$(shell basename $(dir $(abspath $(dir $$PWD))))),)
PATCHES = $(sort $(foreach group,ARM_ARCHS ARMv5_ARCHS ARMv7_ARCHS ARMv7L_ARCHS ARMv8_ARCHS PPC_ARCHS i686_ARCHS x64_ARCHS, \
$(foreach arch,$($(group)), \
$(if $(filter $(ARCH),$(arch)),$(sort $(wildcard patches/*.patch patches/kernel-$(subst +,,$(TC_KERNEL))/*.patch patches/DSM-$(TCVERSION)/*.patch patches/$(shell echo ${group} | cut -f1 -d'_'| tr '[:upper:]' '[:lower:]')/*.patch patches/$(shell echo ${group} | cut -f1 -d'_'| tr '[:upper:]' '[:lower:]')-$(TCVERSION)/*.patch patches/$(arch)/*.patch patches/$(arch)-$(TCVERSION)/*.patch)),))))
else
PATCHES = $(sort $(wildcard patches/*.patch))
endif
endif

Expand Down
12 changes: 6 additions & 6 deletions mk/spksrc.tc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ include ../../mk/spksrc.checksum.mk
extract: checksum
include ../../mk/spksrc.extract.mk

patch: extract
fix: extract
include ../../mk/spksrc.tc-fix.mk

patch: fix
include ../../mk/spksrc.patch.mk

vers: patch
Expand All @@ -51,13 +54,10 @@ include ../../mk/spksrc.tc-vers.mk
flag: vers
include ../../mk/spksrc.tc-flags.mk

fix: flag
include ../../mk/spksrc.tc-fix.mk

all: fix $(TC_LOCAL_VARS_CMAKE) $(TC_LOCAL_VARS_MK)

.PHONY: $(TC_LOCAL_VARS_MK)
$(TC_LOCAL_VARS_MK): fix
$(TC_LOCAL_VARS_MK): flag
env $(MAKE) --no-print-directory tc_vars > $@ 2>/dev/null;

.PHONY: $(TC_LOCAL_VARS_CMAKE)
Expand Down Expand Up @@ -112,7 +112,7 @@ endif
echo "set(BUILD_SHARED_LIBS $(BUILD_SHARED_LIBS))"

.PHONY: tc_vars
tc_vars:
tc_vars: flag
@echo TC_ENV := ; \
echo TC_ENV += SYSROOT=\"$(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)\" ; \
for tool in $(TOOLS) ; \
Expand Down
30 changes: 30 additions & 0 deletions spk/google-authenticator-libpam/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
SPK_NAME = google-authenticator-libpam
SPK_VERS = 1.09
SPK_REV = 1
SPK_ICON = src/google-authenticator.png

DEPENDS = cross/google-authenticator-libpam

MAINTAINER = Soraxas
DESCRIPTION = google-authenticator PAM module for two-factor authentication for logging into servers via SSH, etc. To activate this module you have to manually configure the pam module and related configurations. Please follow the instructions on the SynoCommunity Wiki page.
DISPLAY_NAME = Google Authenticator for libpam
STARTABLE = no
CHANGELOG = "Initial package release."

HOMEPAGE = https://github.com/google/google-authenticator-libpam
SUPPORTURL = https://github.com/SynoCommunity/spksrc/wiki/Google-Authenticator-PAM
LICENSE = Apache-2.0
LICENSE_FILE = $(WORK_DIR)/$(SPK_NAME)-$(SPK_VERS)/LICENSE

WIZARDS_DIR = src/wizard/

# As DSM has google-authenticator installed, create a SynoCommunity specific link
CUSTOM_AUTHENTICATOR_NAME = sc-google-authenticator
POST_STRIP_TARGET = google-authenticator-libpam_extra_install
SPK_COMMANDS = bin/$(CUSTOM_AUTHENTICATOR_NAME)

include ../../mk/spksrc.spk.mk

.PHONY: google-authenticator-libpam_extra_install
google-authenticator-libpam_extra_install:
$(RUN) ; cd $(STAGING_DIR)/bin; ln -sf google-authenticator $(CUSTOM_AUTHENTICATOR_NAME)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions spk/google-authenticator-libpam/src/wizard/install_uifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"step_title": "How to use this package",
"items": [
{
"desc": "For instructions on how to use this package with your device, please visit our wiki page <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Google-Authenticator-PAM\">Google-Authenticator-PAM</a>."
}
]
}
]
14 changes: 14 additions & 0 deletions toolchain/syno-88f6281-5.2/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# libc/usr/include/linux/quota.h
#
--- arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-88f6281-6.1/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# libc/usr/include/linux/quota.h
#
--- arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-88f6281-6.2.2/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# libc/usr/include/linux/quota.h
#
--- arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-88f6281-6.2.3/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# libc/usr/include/linux/quota.h
#
--- arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-88f6281-6.2.4/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# libc/usr/include/linux/quota.h
#
--- arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-88f6281-6.2/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# libc/usr/include/linux/quota.h
#
--- arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ arm-marvell-linux-gnueabi/libc/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-evansport-6.1/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# sys-root/usr/include/linux/quota.h
#
--- i686-pc-linux-gnu/sys-root/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ i686-pc-linux-gnu/sys-root/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-evansport-6.2.2/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# sys-root/usr/include/linux/quota.h
#
--- i686-pc-linux-gnu/sys-root/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ i686-pc-linux-gnu/sys-root/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-evansport-6.2.3/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# sys-root/usr/include/linux/quota.h
#
--- i686-pc-linux-gnu/sys-root/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ i686-pc-linux-gnu/sys-root/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-evansport-6.2.4/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# sys-root/usr/include/linux/quota.h
#
--- i686-pc-linux-gnu/sys-root/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ i686-pc-linux-gnu/sys-root/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-evansport-6.2/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# sys-root/usr/include/linux/quota.h
#
--- i686-pc-linux-gnu/sys-root/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ i686-pc-linux-gnu/sys-root/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-ppc853x-5.2/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# include/linux/quota.h
#
--- powerpc-none-linux-gnuspe/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ powerpc-none-linux-gnuspe/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-qoriq-6.1/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# sysroot/usr/include/linux/quota.h
#
--- powerpc-e500v2-linux-gnuspe/sysroot/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ powerpc-e500v2-linux-gnuspe/sysroot/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-qoriq-6.2.2/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# sysroot/usr/include/linux/quota.h
#
--- powerpc-e500v2-linux-gnuspe/sysroot/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ powerpc-e500v2-linux-gnuspe/sysroot/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
14 changes: 14 additions & 0 deletions toolchain/syno-qoriq-6.2.3/patches/fix_sysroot_quota_h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# fix the signature of quotactl function to match the declaration in
# sysroot/usr/include/linux/quota.h
#
--- powerpc-e500v2-linux-gnuspe/sysroot/usr/include/sys/quota.h.orig 2017-08-23 04:25:40.000000000 +0200
+++ powerpc-e500v2-linux-gnuspe/sysroot/usr/include/sys/quota.h 2021-09-25 09:48:32.456671500 +0200
@@ -217,7 +217,7 @@

__BEGIN_DECLS

-extern int quotactl (int __cmd, const char *__special, int __id,
+extern long quotactl (unsigned int __cmd, const char *__special, int __id,
caddr_t __addr) __THROW;

__END_DECLS
Loading