From 8ad83579d01fa02d68aa81fc49dc6abbb458dc04 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 4 May 2018 15:48:07 +0200 Subject: include/pam-freerdp2.h: Exclude PAM prompts via public API so they can be used by e.g. Arctica Greeter. --- configure.ac | 2 +- debian/control | 11 +++++++++++ debian/libpam-freerdp2-dev.install | 1 + debian/libpam-freerdp2.install | 2 ++ include/pam-freerdp2.h | 29 +++++++++++++++++++++++++++++ src/Makefile.am | 12 ++++++++++++ src/pam-freerdp.c | 2 ++ 7 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 debian/libpam-freerdp2-dev.install create mode 100644 debian/libpam-freerdp2.install create mode 100644 include/pam-freerdp2.h diff --git a/configure.ac b/configure.ac index 8d75950..b3daef1 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_INIT([libpam-freerdp2], [1.0.1]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIRS([m4]) -AM_INIT_AUTOMAKE([-Wno-portability]) +AM_INIT_AUTOMAKE([-Wno-portability subdir-objects]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_PROG_CC diff --git a/debian/control b/debian/control index 86457da..a43b051 100644 --- a/debian/control +++ b/debian/control @@ -22,3 +22,14 @@ Description: PAM Module to auth against an RDP server using FreeRDPv2 Auth and session PAM module that uses FreeRDPv2 to authenticate against an RDP server as the remote host and user. Local account required. Most useful with the pam-temp-account module. + +Package: libpam-freerdp2-dev +Architecture: any +Depends: ${shlibs:Depends}, + ${misc:Depends}, +Description: PAM Module to auth against an RDP server using FreeRDPv2 (development files) + Auth and session PAM module that uses FreeRDPv2 to authenticate against + an RDP server as the remote host and user. Local account required. + Most useful with the pam-temp-account module. + . + This package contains the pam_freerdp2.so header files. diff --git a/debian/libpam-freerdp2-dev.install b/debian/libpam-freerdp2-dev.install new file mode 100644 index 0000000..175bba7 --- /dev/null +++ b/debian/libpam-freerdp2-dev.install @@ -0,0 +1 @@ +usr/include/security/ diff --git a/debian/libpam-freerdp2.install b/debian/libpam-freerdp2.install new file mode 100644 index 0000000..46af1b1 --- /dev/null +++ b/debian/libpam-freerdp2.install @@ -0,0 +1,2 @@ +lib/ +usr/lib/ diff --git a/include/pam-freerdp2.h b/include/pam-freerdp2.h new file mode 100644 index 0000000..3635a4f --- /dev/null +++ b/include/pam-freerdp2.h @@ -0,0 +1,29 @@ +/* + * Copyright © 2012-2013 Mike Gabriel + * Copyright © 2012 Canonical Ltd. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + * Author: Mike Gabriel + */ + +#ifndef _PAM_FREERDP2_H_ +#define _PAM_FREERDP2_H_ + +#define PAM_FREERDP2_PROMPT_GUESTLOGIN "login:" +#define PAM_FREERDP2_PROMPT_USER "remote login:" +#define PAM_FREERDP2_PROMPT_HOST "remote host:" +#define PAM_FREERDP2_PROMPT_DOMAIN "remote domain:" +#define PAM_FREERDP2_PROMPT_PASSWORD "password:" + +#endif //_PAM_FREERDP2_H_ diff --git a/src/Makefile.am b/src/Makefile.am index 4eb3aa0..efc3adc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,5 @@ +NULL = + pamlibdir = $(PAMMODULEDIR) pamlib_LTLIBRARIES = pam_freerdp2.la @@ -18,6 +20,11 @@ pam_freerdp2_la_CFLAGS = \ pam_freerdp2_la_LIBADD = \ $(builddir)/libfreerdp2core.la +pam_freerdp2includedir = $(includedir)/security/ +pam_freerdp2include_HEADERS = \ + $(top_srcdir)/include/pam-freerdp2.h \ + $(NULL) + noinst_LTLIBRARIES = \ libfreerdp2core.la @@ -29,9 +36,14 @@ libfreerdp2core_la_CFLAGS = \ $(COVERAGE_CFLAGS) libfreerdp2core_la_LIBADD = \ -lpam +libfreerdp2core_la_CPPFLAGS = \ + -I$(top_srcdir)/include \ + $(NULL) libfreerdp2core_la_LDFLAGS = \ $(COVERAGE_LDFLAGS) + + pkglibexec_PROGRAMS = \ freerdp2-auth-check diff --git a/src/pam-freerdp.c b/src/pam-freerdp.c index 908c54d..e331732 100644 --- a/src/pam-freerdp.c +++ b/src/pam-freerdp.c @@ -36,6 +36,8 @@ #include #include +#include "pam-freerdp2.h" + #include "pam-freerdp-children.h" #include "auth-check-path.h" -- cgit v1.2.3