summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-17 06:27:12 +0000
committerjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-17 06:27:12 +0000
commit66e963519ad0d42a227442a36bde93de06fce4f7 (patch)
tree863ab30ca0aa12e0cb32ec5aee6db27a38396607 /remoting
parent35d7e967e7182a63a43eaa6d0e3d43e1b727879c (diff)
downloadchromium_src-66e963519ad0d42a227442a36bde93de06fce4f7.zip
chromium_src-66e963519ad0d42a227442a36bde93de06fce4f7.tar.gz
chromium_src-66e963519ad0d42a227442a36bde93de06fce4f7.tar.bz2
Fixed gyp to work with both xcodebuild and ninja.
This also implements the PAM local-login check from issue 11358258. BUG=158631 Review URL: https://chromiumcodereview.appspot.com/11415032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rwxr-xr-xremoting/host/installer/mac/Scripts/remoting_postflight.sh27
-rw-r--r--remoting/host/remoting_me2me_host.cc6
-rw-r--r--remoting/remoting.gyp1
3 files changed, 31 insertions, 3 deletions
diff --git a/remoting/host/installer/mac/Scripts/remoting_postflight.sh b/remoting/host/installer/mac/Scripts/remoting_postflight.sh
index 6016fca..4659735 100755
--- a/remoting/host/installer/mac/Scripts/remoting_postflight.sh
+++ b/remoting/host/installer/mac/Scripts/remoting_postflight.sh
@@ -10,6 +10,7 @@ HELPERTOOLS=/Library/PrivilegedHelperTools
NAME=org.chromium.chromoting
CONFIG_FILE="$HELPERTOOLS/$NAME.json"
PLIST=/Library/LaunchAgents/org.chromium.chromoting.plist
+PAM_CONFIG=/etc/pam.d/chrome-remote-desktop
ENABLED_FILE="$HELPERTOOLS/$NAME.me2me_enabled"
ENABLED_FILE_BACKUP="$ENABLED_FILE.backup"
@@ -33,6 +34,32 @@ if [[ -f "$ENABLED_FILE_BACKUP" ]]; then
mv "$ENABLED_FILE_BACKUP" "$ENABLED_FILE"
fi
+# Create the PAM configuration unless it already exists and has been edited.
+update_pam=1
+CONTROL_LINE="# If you edit this file, please delete this line."
+if [[ -f "$PAM_CONFIG" ]] && ! grep -qF "$CONTROL_LINE" "$PAM_CONFIG"; then
+ update_pam=0
+fi
+
+if [[ "$update_pam" == "1" ]]; then
+ logger Creating PAM config.
+ cat > "$PAM_CONFIG" <<EOF
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+auth required pam_deny.so
+account required pam_permit.so
+password required pam_deny.so
+session required pam_deny.so
+
+# This file is auto-updated by the Chrome Remote Desktop installer.
+$CONTROL_LINE
+EOF
+else
+ logger PAM config has local edits. Not updating.
+fi
+
# Load the service.
# The launchctl command we'd like to run:
# launchctl load -w -S Aqua $PLIST
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 69b71cd..d9fc6f4 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -67,6 +67,7 @@
#if defined(OS_POSIX)
#include <signal.h>
#include "base/file_descriptor_posix.h"
+#include "remoting/host/pam_authorization_factory_posix.h"
#include "remoting/host/posix/signal_handler.h"
#endif // defined(OS_POSIX)
@@ -78,7 +79,6 @@
#if defined(OS_LINUX)
#include <pwd.h>
#include "remoting/host/audio_capturer_linux.h"
-#include "remoting/host/pam_authorization_factory_posix.h"
#endif // defined(OS_LINUX)
// N.B. OS_WIN is defined by including src/base headers.
@@ -429,8 +429,8 @@ void HostProcess::CreateAuthenticatorFactory() {
scoped_ptr<protocol::AuthenticatorFactory> factory(
new protocol::Me2MeHostAuthenticatorFactory(
local_certificate, *key_pair_.private_key(), host_secret_hash_));
-#if defined(OS_LINUX)
- // On Linux, perform a PAM authorization step after authentication.
+#if defined(OS_POSIX)
+ // On Linux and Mac, perform a PAM authorization step after authentication.
factory.reset(new PamAuthorizationFactory(factory.Pass()));
#endif
host_->SetAuthenticatorFactory(factory.Pass());
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index d70bd1a..9b55d5f 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -1714,6 +1714,7 @@
'link_settings': {
'libraries': [
'$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
+ 'libpam.a',
],
},
}],