[Libreoffice-commits] online.git: debian/control loolwsd.spec.in

2019-01-14 Thread Libreoffice Gerrit user
 debian/control  |2 +-
 loolwsd.spec.in |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 889fb7a1ce67d708432a1f4be82f4d7f2805c401
Author: Andras Timar 
AuthorDate: Mon Jan 14 15:17:09 2019 +0100
Commit: Andras Timar 
CommitDate: Mon Jan 14 15:17:20 2019 +0100

build requires m4

Change-Id: I23a102762a43890d5487ea7a6e3adac035fc3b68

diff --git a/debian/control b/debian/control
index c5497b564..fa4b53712 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: loolwsd
 Section: web
 Priority: optional
 Maintainer: Andras Timar 
-Build-Depends: debhelper (>= 9), dh-systemd (>= 1.3), libcap-dev, libcap2-bin, 
libpcre3-dev, libpng-dev, libpoco-dev (>= 1.7.5), linux-libc-dev, nodejs, 
python-polib, python-lxml, fontconfig, libpam-dev, libcppunit-dev, pkg-config, 
devscripts
+Build-Depends: debhelper (>= 9), dh-systemd (>= 1.3), libcap-dev, libcap2-bin, 
libpcre3-dev, libpng-dev, libpoco-dev (>= 1.7.5), linux-libc-dev, nodejs, 
python-polib, python-lxml, fontconfig, libpam-dev, libcppunit-dev, pkg-config, 
devscripts, m4
 Standards-Version: 3.9.7
 
 Package: loolwsd
diff --git a/loolwsd.spec.in b/loolwsd.spec.in
index 929bff10b..c0e8847a4 100644
--- a/loolwsd.spec.in
+++ b/loolwsd.spec.in
@@ -17,7 +17,7 @@ Vendor: %{vendor}
 Summary:LibreOffice Online WebSocket Daemon
 License:MPL
 Source0:loolwsd-@package_vers...@.tar.gz
-BuildRequires:  libcap-devel libpng-devel poco-devel >= 1.7.5
+BuildRequires:  libcap-devel libpng-devel poco-devel >= 1.7.5 m4
 %if 0%{?fedora} || 0%{?rhel} >= 7
 BuildRequires:  libpcap kernel-headers
 %else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: debian/control loolwsd.spec.in loolwsd.xml.in Makefile.am wsd/FileServer.cpp wsd/LOOLWSD.cpp

2018-01-23 Thread Andras Timar
 Makefile.am|2 -
 debian/control |2 -
 loolwsd.spec.in|4 ++
 loolwsd.xml.in |5 +-
 wsd/FileServer.cpp |   89 +++--
 wsd/LOOLWSD.cpp|3 +
 6 files changed, 90 insertions(+), 15 deletions(-)

New commits:
commit a2e25cc7d31f3daa011df7f7b4e40fc540d91d2a
Author: Andras Timar 
Date:   Mon Jan 22 11:57:39 2018 +0100

Add PAM support

Possibilities are endless. With a simple /etc/pam.d/loolwsd config below,
the user which runs loolwsd ('lool' in production environment) can login
to admin console with normal linux password.

auth   required pam_unix.so
accountrequired pam_unix.so

Change-Id: I354a7e9b4705e8fe346d17d6b6041d1406198b37
Reviewed-on: https://gerrit.libreoffice.org/48307
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/Makefile.am b/Makefile.am
index 3d751207..d0e2ae2d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,7 +36,7 @@ if !ENABLE_DEBUG
 AM_CPPFLAGS += -DNDEBUG
 endif
 
-AM_LDFLAGS = -pthread -Wl,-E,-rpath,/snap/loolwsd/current/usr/lib $(ZLIB_LIBS)
+AM_LDFLAGS = -pthread -Wl,-E,-rpath,/snap/loolwsd/current/usr/lib -lpam 
$(ZLIB_LIBS)
 
 if ENABLE_SSL
 AM_LDFLAGS += -lssl -lcrypto
diff --git a/debian/control b/debian/control
index b89cb7ca..30bdfe04 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,7 @@
 Source: loolwsd
 Section: web
 Priority: optional
-Maintainer: Tor Lillqvist 
+Maintainer: Andras Timar 
 Build-Depends: debhelper (>= 9), dh-systemd (>= 1.3), libcap-dev, libcap2-bin, 
libpcre3-dev, libpng-dev, libpoco-dev (>= 1.7.5), linux-libc-dev
 Standards-Version: 3.9.7
 
diff --git a/loolwsd.spec.in b/loolwsd.spec.in
index f7355b17..0933b1a3 100644
--- a/loolwsd.spec.in
+++ b/loolwsd.spec.in
@@ -88,6 +88,9 @@ install -D -m 644 sysconfig.loolwsd 
%{buildroot}/var/adm/fillup-templates
 mkdir -p %{buildroot}/etc/cron.d
 echo "#Remove old tiles once every 10 days at midnight" > 
%{buildroot}/etc/cron.d/loolwsd.cron
 echo "0 0 */1 * * root find /var/cache/loolwsd -name \"*.png\" -a -atime +10 
-exec rm {} \;" >> %{buildroot}/etc/cron.d/loolwsd.cron
+mkdir -p %{buildroot}/etc/pam.d
+echo "auth   required pam_unix.so" > %{buildroot}/etc/pam.d/loolwsd
+echo "accountrequired pam_unix.so" >>  %{buildroot}/etc/pam.d/loolwsd
 
 %files
 /usr/bin/loolwsd
@@ -116,6 +119,7 @@ echo "0 0 */1 * * root find /var/cache/loolwsd -name 
\"*.png\" -a -atime +10 -ex
 %endif
 
 %config(noreplace) /etc/cron.d/loolwsd.cron
+%config(noreplace) /etc/pam.d/loolwsd
 %config(noreplace) %attr(640, lool, root) /etc/loolwsd/loolwsd.xml
 %config /etc/loolwsd/loolkitconfig.xcu
 
diff --git a/loolwsd.xml.in b/loolwsd.xml.in
index 1609c7bc..31ab1a07 100644
--- a/loolwsd.xml.in
+++ b/loolwsd.xml.in
@@ -100,8 +100,9 @@
 true
 
 
-
-
+true
+
+
 
 
 
diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index 9f788818..ad4b890d 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -53,6 +54,62 @@ using Poco::Util::Application;
 
 std::map> 
FileServerRequestHandler::FileHash;
 
+namespace {
+
+int functionConversation(int /*num_msg*/, const struct pam_message** /*msg*/,
+ struct pam_response **reply, void *appdata_ptr)
+{
+*reply = (struct pam_response *)malloc(sizeof(struct pam_response));
+(*reply)[0].resp = strdup(static_cast(appdata_ptr));
+(*reply)[0].resp_retcode = 0;
+
+return PAM_SUCCESS;
+}
+
+bool isPamAuthOk(const std::string user, const std::string pass)
+{
+struct pam_conv localConversation { functionConversation, nullptr };
+pam_handle_t *localAuthHandle = NULL;
+int retval;
+
+localConversation.appdata_ptr = const_cast(pass.c_str());
+
+retval = pam_start("loolwsd", user.c_str(), , 
);
+
+if (retval != PAM_SUCCESS)
+{
+LOG_ERR("pam_start returned " << retval);
+return false;
+}
+
+retval = pam_authenticate(localAuthHandle, 0);
+
+if (retval != PAM_SUCCESS)
+{
+   if (retval == PAM_AUTH_ERR)
+   {
+   LOG_ERR("PAM authentication failure for user \"" << user << "\".");
+   }
+   else
+   {
+   LOG_ERR("pam_authenticate returned " << retval);
+   }
+   return false;
+}
+
+LOG_INF("PAM authentication success for user \"" << user << "\".");
+
+retval = pam_end(localAuthHandle, retval);
+
+if (retval != PAM_SUCCESS)
+{
+LOG_WRN("pam_end returned " << retval);
+}
+
+return true;
+}
+}
+
 bool FileServerRequestHandler::isAdminLoggedIn(const HTTPRequest& request,
HTTPResponse )
 {
@@ 

[Libreoffice-commits] online.git: debian/control loolwsd.spec.in

2017-06-28 Thread Andras Timar
 debian/control  |2 +-
 loolwsd.spec.in |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit fdec71ad6963bd91fa56b379bdb0380776efd93a
Author: Andras Timar 
Date:   Wed Jun 28 13:19:31 2017 +0200

build requires /usr/include/linux/seccomp.h

Change-Id: I8277c4af56ac08f09328d3de368deb41f92c6864

diff --git a/debian/control b/debian/control
index d85c95d0..b89cb7ca 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: loolwsd
 Section: web
 Priority: optional
 Maintainer: Tor Lillqvist 
-Build-Depends: debhelper (>= 9), dh-systemd (>= 1.3), libcap-dev, libcap2-bin, 
libpcre3-dev, libpng-dev, libpoco-dev (>= 1.7.5)
+Build-Depends: debhelper (>= 9), dh-systemd (>= 1.3), libcap-dev, libcap2-bin, 
libpcre3-dev, libpng-dev, libpoco-dev (>= 1.7.5), linux-libc-dev
 Standards-Version: 3.9.7
 
 Package: loolwsd
diff --git a/loolwsd.spec.in b/loolwsd.spec.in
index 01bc6be0..f7355b17 100644
--- a/loolwsd.spec.in
+++ b/loolwsd.spec.in
@@ -19,10 +19,10 @@ License:MPL
 Source0:loolwsd-@package_vers...@.tar.gz
 BuildRequires:  libcap-devel libpng-devel poco-devel >= 1.7.5
 %if 0%{?fedora} || 0%{?rhel} >= 7
-BuildRequires:  libpcap
+BuildRequires:  libpcap kernel-headers
 %else
 %if 0%{?suse_version}
-BuildRequires:  libcap-progs systemd-rpm-macros
+BuildRequires:  libcap-progs linux-glibc-devel systemd-rpm-macros
 %endif
 %endif
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits