data/tlm.conf
tests/tlm-test.conf
src/daemon/tlm
+src/sessiond/tlm-sessiond
+src/utils/tlm-client
tests/config/configtest
tests/daemon/daemontest
/* Define to 1 if you have the <security/pam_appl.h> header file. */
#undef HAVE_SECURITY_PAM_APPL_H
+/* Define to 1 if you have the <security/pam_misc.h> header file. */
+#undef HAVE_SECURITY_PAM_MISC_H
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tlm 0.0.3.
+# Generated by GNU Autoconf 2.69 for tlm 0.0.4.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
# Identity of this package.
PACKAGE_NAME='tlm'
PACKAGE_TARNAME='tlm'
-PACKAGE_VERSION='0.0.3'
-PACKAGE_STRING='tlm 0.0.3'
+PACKAGE_VERSION='0.0.4'
+PACKAGE_STRING='tlm 0.0.4'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures tlm 0.0.3 to adapt to many kinds of systems.
+\`configure' configures tlm 0.0.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of tlm 0.0.3:";;
+ short | recursive ) echo "Configuration of tlm 0.0.4:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-tlm configure 0.0.3
+tlm configure 0.0.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by tlm $as_me 0.0.3, which was
+It was created by tlm $as_me 0.0.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='tlm'
- VERSION='0.0.3'
+ VERSION='0.0.4'
cat >>confdefs.h <<_ACEOF
done
+for ac_header in security/pam_misc.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "security/pam_misc.h" "ac_cv_header_security_pam_misc_h" "$ac_includes_default"
+if test "x$ac_cv_header_security_pam_misc_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SECURITY_PAM_MISC_H 1
+_ACEOF
+
+else
+ as_fn_error $? "\"pam-misc is required\"" "$LINENO" 5
+fi
+
+done
+
TLM_CFLAGS="$GLIB_CFLAGS $GIO_CFLAGS $GMODULE_CFLAGS -D_POSIX_C_SOURCE=\"200809L\" -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -Wall -Werror"
TLM_LIBS="$GLIB_LIBS $GIO_LIBS $GMODULE_LIBS"
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by tlm $as_me 0.0.3, which was
+This file was extended by tlm $as_me 0.0.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-tlm config.status 0.0.3
+tlm config.status 0.0.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
-AC_INIT([tlm], [0.0.3], [])
+AC_INIT([tlm], [0.0.4], [])
AC_CONFIG_SRCDIR([src/daemon/tlm-main.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_CONDITIONAL(HAVE_LIBTLM_NFC, [test x$have_libtlm_nfc = xyes])
AC_CHECK_HEADERS([security/pam_appl.h],,[AC_MSG_ERROR("pam-devel is required")])
+AC_CHECK_HEADERS([security/pam_misc.h],,[AC_MSG_ERROR("pam-misc is required")])
TLM_CFLAGS="$GLIB_CFLAGS $GIO_CFLAGS $GMODULE_CFLAGS -D_POSIX_C_SOURCE=\"200809L\" -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -Wall -Werror"
TLM_LIBS="$GLIB_LIBS $GIO_LIBS $GMODULE_LIBS"
tlm.conf.in \
tlm.service \
tlm-login \
- tlm-login.debian
+ tlm-default-login
sysconf_DATA = tlm.conf
tlm.conf.in \
tlm.service \
tlm-login \
- tlm-login.debian
+ tlm-default-login
sysconf_DATA = tlm.conf
all: all-am
--- /dev/null
+#%PAM-1.0
+auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
+auth required pam_permit.so
+account required pam_nologin.so
+account include system-auth
+password include system-auth
+
+session include system-auth
+session required pam_systemd.so
+session required pam_loginuid.so
+session required pam_namespace.so
+session optional pam_keyinit.so force revoke
+session required pam_smack.so
+++ /dev/null
-auth required pam_env.so readenv=1
-auth required pam_env.so readenv=1 envfile=/etc/default/locale
-auth required pam_permit.so
-#@include common-auth
-account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so nullok
-#@include common-account
-#session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close
-#session required pam_permit.so
-#session required pam_limits.so
-#session required pam_loginuid.so
-#session required pam_unix.so
-#session optional pam_systemd.so
-#session optional pam_ck_connector.so nox11
-@include common-session
-#session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open
-@include common-password
#
# Prepare default/guest users before auto-login
# Default: off
-#PREPARE_DEFAULT=1
+PREPARE_DEFAULT=1
#
# PAM service file to use
PAM_SERVICE=tlm-login
#
+# PAM service file for default user
+PAM_DEFAULT_SERVICE=tlm-default-login
+#
# Default (guest) username or template to use
# %S - seat number
# %I - seat id string
# Default: "guest"
-DEFAULT_USER=app
+#DEFAULT_USER=guest
#
# Session command : The command run after successfull login
# Default: $SHELL
#
# Do not launch anything, let systemd handle it through PAM
# Default: off
-PAUSE_SESSION=1
+#PAUSE_SESSION=1
#
#
# Seat specific settings where the group name is seat id
+tlm (0.0.4-1) unstable; urgency=low
+
+ * Added separate PAM configuration file for default user
+
+ -- Imran Zaman <imran.zaman@intel.com> Tue, 26 Aug 2014 19:04:53 +0200
+
+tlm (0.0.3-2) unstable; urgency=low
+
+ * session: set umask when logging in
+ * session: with pause session, set environment before PAM open session
+ * updated gitignore file
+ * Fixed white spaces
+
+ -- Imran Zaman <imran.zaman@intel.com> Tue, 26 Aug 2014 19:04:53 +0200
+
tlm (0.0.3-1) unstable; urgency=low
* Create a new process (tlm-sessiond) for each session
+* Wed Sep 03 2014 Jussi Laako <jussi.laako@linux.intel.com>
+- Added separate PAM configuration file for default user
+
+* Tue Aug 26 2014 Imran Zaman <imran.zaman@intel.com>
+- session: set umask when logging in
+- session: with pause session, set environment before PAM open session
+- updated gitignore file
+- Fixed white spaces
+
* Mon Aug 04 2014 Imran Zaman <imran.zaman@intel.com>
- Updated pam configuration file and fixed bug related to dbus arguments
Name: tlm
Summary: Login manager for Tizen
-Version: 0.0.3
+Version: 0.0.4
Release: 1
Group: System/Service
License: LGPL-2.1+
BuildRequires: pkgconfig(libgum)
BuildRequires: pkgconfig(elementary)
BuildRequires: pam-devel
+%if %{debug_build} == 1
+BuildRequires: gtk-doc
+%endif
+
%description
%{summary}.
%build
%if %{debug_build} == 1
+./autogen.sh
%configure --enable-gum --enable-gtk-doc --enable-examples --enable-debug
%else
%configure --enable-gum --enable-examples
install -m 644 data/tlm.service %{buildroot}%{_unitdir}
install -m 755 -d %{buildroot}%{_sysconfdir}/pam.d
install -m 644 data/tlm-login %{buildroot}%{_sysconfdir}/pam.d/
+install -m 644 data/tlm-default-login %{buildroot}%{_sysconfdir}/pam.d/
%post
/usr/bin/systemctl daemon-reload
-%postun -p /sbin/ldconfig
+%postun
+/sbin/ldconfig
/usr/bin/systemctl disable tlm
/usr/bin/systemctl daemon-reload
%{_unitdir}/tlm.service
%config(noreplace) %{_sysconfdir}/tlm.conf
%config %{_sysconfdir}/pam.d/tlm-login
+%config %{_sysconfdir}/pam.d/tlm-default-login
%files devel
Name: tlm
Summary: Login manager for Tizen
Version: 0.0.3
-Release: 1
+Release: 2
Group: System/Daemons
License: LGPL-2.1+
Source: %{name}-%{version}.tar.gz
%changelog
+* Wed Sep 03 2014 Jussi Laako <jussi.laako@linux.intel.com>
+- Added separate PAM configuration file for default user
+
+* Tue Aug 26 2014 Imran Zaman <imran.zaman@intel.com>
+- session: set umask when logging in
+- session: with pause session, set environment before PAM open session
+- updated gitignore file
+- Fixed white spaces
+
* Mon Jul 21 2014 Imran Zaman <imran.zaman@intel.com>
- Update to 0.0.3; create a new process (tlm-sessiond) for each session
</dt>
<dd></dd>
<dt>
+<a class="link" href="tlm-General-configuration.html#TLM-CONFIG-GENERAL-DEFAULT-PAM-SERVICE:CAPS" title="TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE">TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE</a>, macro in <a class="link" href="tlm-General-configuration.html" title="General configuration">General configuration</a>
+</dt>
+<dd></dd>
+<dt>
<a class="link" href="tlm-General-configuration.html#TLM-CONFIG-GENERAL-DEFAULT-USER:CAPS" title="TLM_CONFIG_GENERAL_DEFAULT_USER">TLM_CONFIG_GENERAL_DEFAULT_USER</a>, macro in <a class="link" href="tlm-General-configuration.html" title="General configuration">General configuration</a>
</dt>
<dd></dd>
</dt>
<dd></dd>
<dt>
-<a class="link" href="tlm-Errors.html#TlmError" title="enum TlmError">TlmError</a>, enum in <a class="link" href="tlm-Errors.html" title="Errors">Errors</a>
+<a class="link" href="tlm-Errors.html#TLM-ERROR:CAPS" title="TLM_ERROR">TLM_ERROR</a>, macro in <a class="link" href="tlm-Errors.html" title="Errors">Errors</a>
</dt>
<dd></dd>
<dt>
-<a class="link" href="tlm-Errors.html#TLM-ERROR:CAPS" title="TLM_ERROR">TLM_ERROR</a>, macro in <a class="link" href="tlm-Errors.html" title="Errors">Errors</a>
+<a class="link" href="tlm-Errors.html#TlmError" title="enum TlmError">TlmError</a>, enum in <a class="link" href="tlm-Errors.html" title="Errors">Errors</a>
</dt>
<dd></dd>
<dt>
<ANCHOR id="TLM-CONFIG-GENERAL-AUTO-LOGIN:CAPS" href="tlm/tlm-General-configuration.html#TLM-CONFIG-GENERAL-AUTO-LOGIN:CAPS">
<ANCHOR id="TLM-CONFIG-GENERAL-PREPARE-DEFAULT:CAPS" href="tlm/tlm-General-configuration.html#TLM-CONFIG-GENERAL-PREPARE-DEFAULT:CAPS">
<ANCHOR id="TLM-CONFIG-GENERAL-PAM-SERVICE:CAPS" href="tlm/tlm-General-configuration.html#TLM-CONFIG-GENERAL-PAM-SERVICE:CAPS">
+<ANCHOR id="TLM-CONFIG-GENERAL-DEFAULT-PAM-SERVICE:CAPS" href="tlm/tlm-General-configuration.html#TLM-CONFIG-GENERAL-DEFAULT-PAM-SERVICE:CAPS">
<ANCHOR id="TLM-CONFIG-GENERAL-DEFAULT-USER:CAPS" href="tlm/tlm-General-configuration.html#TLM-CONFIG-GENERAL-DEFAULT-USER:CAPS">
<ANCHOR id="TLM-CONFIG-GENERAL-SETUP-TERMINAL:CAPS" href="tlm/tlm-General-configuration.html#TLM-CONFIG-GENERAL-SETUP-TERMINAL:CAPS">
<ANCHOR id="TLM-CONFIG-GENERAL-TERMINATE-TIMEOUT:CAPS" href="tlm/tlm-General-configuration.html#TLM-CONFIG-GENERAL-TERMINATE-TIMEOUT:CAPS">
</tr>
<tr>
<td class="define_keyword">#define</td>
+<td class="function_name"><a class="link" href="tlm-General-configuration.html#TLM-CONFIG-GENERAL-DEFAULT-PAM-SERVICE:CAPS" title="TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE">TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE</a></td>
+</tr>
+<tr>
+<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="tlm-General-configuration.html#TLM-CONFIG-GENERAL-DEFAULT-USER:CAPS" title="TLM_CONFIG_GENERAL_DEFAULT_USER">TLM_CONFIG_GENERAL_DEFAULT_USER</a></td>
</tr>
<tr>
</div>
<hr>
<div class="refsect2">
+<a name="TLM-CONFIG-GENERAL-DEFAULT-PAM-SERVICE:CAPS"></a><h3>TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE</h3>
+<pre class="programlisting">#define TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE "DEFAULT_PAM_SERVICE"
+</pre>
+<p>PAM service file to use for default user authentication and session setup. Default value: "tlm-default-login".</p>
+</div>
+<hr>
+<div class="refsect2">
<a name="TLM-CONFIG-GENERAL-DEFAULT-USER:CAPS"></a><h3>TLM_CONFIG_GENERAL_DEFAULT_USER</h3>
<pre class="programlisting">#define TLM_CONFIG_GENERAL_DEFAULT_USER "DEFAULT_USER"
</pre>
<keyword type="macro" name="TLM_CONFIG_GENERAL_AUTO_LOGIN" link="tlm-General-configuration.html#TLM-CONFIG-GENERAL-AUTO-LOGIN:CAPS"/>
<keyword type="macro" name="TLM_CONFIG_GENERAL_PREPARE_DEFAULT" link="tlm-General-configuration.html#TLM-CONFIG-GENERAL-PREPARE-DEFAULT:CAPS"/>
<keyword type="macro" name="TLM_CONFIG_GENERAL_PAM_SERVICE" link="tlm-General-configuration.html#TLM-CONFIG-GENERAL-PAM-SERVICE:CAPS"/>
+ <keyword type="macro" name="TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE" link="tlm-General-configuration.html#TLM-CONFIG-GENERAL-DEFAULT-PAM-SERVICE:CAPS"/>
<keyword type="macro" name="TLM_CONFIG_GENERAL_DEFAULT_USER" link="tlm-General-configuration.html#TLM-CONFIG-GENERAL-DEFAULT-USER:CAPS"/>
<keyword type="macro" name="TLM_CONFIG_GENERAL_SETUP_TERMINAL" link="tlm-General-configuration.html#TLM-CONFIG-GENERAL-SETUP-TERMINAL:CAPS"/>
<keyword type="macro" name="TLM_CONFIG_GENERAL_TERMINATE_TIMEOUT" link="tlm-General-configuration.html#TLM-CONFIG-GENERAL-TERMINATE-TIMEOUT:CAPS"/>
TLM_CONFIG_GENERAL_AUTO_LOGIN
TLM_CONFIG_GENERAL_PREPARE_DEFAULT
TLM_CONFIG_GENERAL_PAM_SERVICE
+TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE
TLM_CONFIG_GENERAL_DEFAULT_USER
TLM_CONFIG_GENERAL_SETUP_TERMINAL
TLM_CONFIG_GENERAL_TERMINATE_TIMEOUT
+* Wed Sep 03 2014 Jussi Laako <jussi.laako@linux.intel.com>
+- Added separate PAM configuration file for default user
+
+* Tue Aug 26 2014 Imran Zaman <imran.zaman@intel.com>
+- session: set umask when logging in
+- session: with pause session, set environment before PAM open session
+- updated gitignore file
+- Fixed white spaces
+
* Mon Aug 04 2014 Imran Zaman <imran.zaman@intel.com>
- Updated pam configuration file and fixed bug related to dbus arguments
Name: tlm
Summary: Login manager for Tizen
-Version: 0.0.3
+Version: 0.0.4
Release: 1
Group: System/Service
License: LGPL-2.1+
BuildRequires: pkgconfig(libgum)
BuildRequires: pkgconfig(elementary)
BuildRequires: pam-devel
+%if %{debug_build} == 1
+BuildRequires: gtk-doc
+%endif
+
%description
%{summary}.
%build
%if %{debug_build} == 1
+./autogen.sh
%configure --enable-gum --enable-gtk-doc --enable-examples --enable-debug
%else
%configure --enable-gum --enable-examples
install -m 644 data/tlm.service %{buildroot}%{_unitdir}
install -m 755 -d %{buildroot}%{_sysconfdir}/pam.d
install -m 644 data/tlm-login %{buildroot}%{_sysconfdir}/pam.d/
+install -m 644 data/tlm-default-login %{buildroot}%{_sysconfdir}/pam.d/
%post
/usr/bin/systemctl daemon-reload
-%postun -p /sbin/ldconfig
+%postun
+/sbin/ldconfig
/usr/bin/systemctl disable tlm
/usr/bin/systemctl daemon-reload
%{_unitdir}/tlm.service
%config(noreplace) %{_sysconfdir}/tlm.conf
%config %{_sysconfdir}/pam.d/tlm-login
+%config %{_sysconfdir}/pam.d/tlm-default-login
%files devel
#define TLM_CONFIG_GENERAL_PAM_SERVICE "PAM_SERVICE"
/**
+ * TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE:
+ *
+ * PAM service file to use for default user authentication and session setup. Default value: "tlm-default-login".
+ */
+#define TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE "DEFAULT_PAM_SERVICE"
+
+/**
* TLM_CONFIG_GENERAL_DEFAULT_USER:
*
* Default username for autologin. Default value: "guest".
"tlm-login");
}
+ /* default user PAM service => tlm-default-login */
+ if (!tlm_config_has_key (self,
+ TLM_CONFIG_GENERAL,
+ TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE)) {
+ tlm_config_set_string (self,
+ TLM_CONFIG_GENERAL,
+ TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE,
+ "tlm-default-login");
+ }
+
/* default user => guest */
if (!tlm_config_has_key (self,
TLM_CONFIG_GENERAL,
_disconnect_seat (self, TLM_SEAT (dead));
if (self->priv->active_request &&
G_OBJECT(self->priv->active_request->seat) == dead) {
- self->priv->active_request->seat = NULL;
+ self->priv->active_request->seat = NULL;
}
if (G_OBJECT(self->priv->seat) == dead)
- self->priv->seat = NULL;
+ self->priv->seat = NULL;
}
static void
request->dbus_request = dbus_req;
request->seat = seat;
if (request->seat) {
- _connect_seat (self, request->seat);
- g_object_weak_ref (G_OBJECT (request->seat),
- (GWeakNotify)_on_seat_dispose, self);
+ _connect_seat (self, request->seat);
+ g_object_weak_ref (G_OBJECT (request->seat),
+ (GWeakNotify)_on_seat_dispose, self);
}
return request;
}
if (request->dbus_request) {
tlm_dbus_login_adapter_request_completed (request->dbus_request, NULL);
tlm_dbus_utils_dispose_request (request->dbus_request);
- request->dbus_request = NULL;
+ request->dbus_request = NULL;
}
if (request->seat) {
- _disconnect_seat (self, request->seat);
- g_object_weak_unref (G_OBJECT (request->seat),
- (GWeakNotify)_on_seat_dispose, self);
- request->seat = NULL;
+ _disconnect_seat (self, request->seat);
+ g_object_weak_unref (G_OBJECT (request->seat),
+ (GWeakNotify)_on_seat_dispose, self);
+ request->seat = NULL;
}
g_free (request);
}
/* check for active request */
if (self->priv->active_request &&
G_OBJECT (self->priv->active_request->dbus_request->dbus_adapter) ==
- dead) {
+ dead) {
DBG ("removing the request for dead dbus adapter");
_dispose_request (self, self->priv->active_request);
self->priv->active_request = NULL;
dbus_req = req->dbus_request;
if (!_is_request_supported (self, dbus_req->type)) {
WARN ("Request not supported -- req-type %d flags %d",
- dbus_req->type, self->priv->enable_flags);
+ dbus_req->type, self->priv->enable_flags);
err = TLM_GET_ERROR_FOR_ID (TLM_ERROR_DBUS_REQ_NOT_SUPPORTED,
"Dbus request not supported");
goto _finished;
seat = self->priv->seat;
if (!seat && self->priv->manager) {
seat = tlm_manager_get_seat (self->priv->manager,
- dbus_req->seat_id);
+ dbus_req->seat_id);
req->seat = seat;
/* NOTE: When no seat is set at dbus object creation time,
* seat is connected on per dbus request basis and then
* disconnected when the dbus request is completed or aborted */
if (seat) {
- _connect_seat (self, seat);
- g_object_weak_ref (G_OBJECT (seat),
- (GWeakNotify)_on_seat_dispose, self);
+ _connect_seat (self, seat);
+ g_object_weak_ref (G_OBJECT (seat),
+ (GWeakNotify)_on_seat_dispose, self);
}
}
switch(dbus_req->type) {
case TLM_DBUS_REQUEST_TYPE_LOGIN_USER:
ret = tlm_seat_create_session (seat, NULL, dbus_req->username,
- dbus_req->password, dbus_req->environment);
+ dbus_req->password, dbus_req->environment);
break;
case TLM_DBUS_REQUEST_TYPE_LOGOUT_USER:
ret = tlm_seat_terminate_session (seat);
break;
case TLM_DBUS_REQUEST_TYPE_SWITCH_USER:
ret = tlm_seat_switch_user (seat, NULL, dbus_req->username,
- dbus_req->password, dbus_req->environment);
+ dbus_req->password, dbus_req->environment);
break;
}
if (!ret) {
}
}
if (!self->priv->active_request)
- _process_next_request_in_idle (self);
+ _process_next_request_in_idle (self);
return FALSE;
}
/* Login/switch request should only be completed on session created
* signal from seat */
if (!self->priv->active_request ||
- !self->priv->active_request->dbus_request ||
+ !self->priv->active_request->dbus_request ||
self->priv->active_request->dbus_request->type ==
- TLM_DBUS_REQUEST_TYPE_LOGOUT_USER)
+ TLM_DBUS_REQUEST_TYPE_LOGOUT_USER)
return;
_complete_request (self, self->priv->active_request, NULL);
if (!self->priv->active_request ||
!self->priv->active_request->dbus_request ||
self->priv->active_request->dbus_request->type !=
- TLM_DBUS_REQUEST_TYPE_LOGOUT_USER)
+ TLM_DBUS_REQUEST_TYPE_LOGOUT_USER)
return FALSE;
_disconnect_dbus_adapter (self, TLM_DBUS_LOGIN_ADAPTER (
- self->priv->active_request->dbus_request->dbus_adapter));
+ self->priv->active_request->dbus_request->dbus_adapter));
_complete_request (self, self->priv->active_request, NULL);
self->priv->active_request = NULL;
self->priv->active_request = NULL;
if (self->priv->request_queue) {
- g_queue_foreach (self->priv->request_queue,
+ g_queue_foreach (self->priv->request_queue,
(GFunc) _clear_request, self);
- g_queue_free (self->priv->request_queue);
+ g_queue_free (self->priv->request_queue);
self->priv->request_queue = NULL;
}
_stop_dbus_server (self);
if (self->priv->manager) {
- g_object_weak_unref (G_OBJECT (self->priv->manager),
- (GWeakNotify)_on_manager_dispose, self);
+ g_object_weak_unref (G_OBJECT (self->priv->manager),
+ (GWeakNotify)_on_manager_dispose, self);
self->priv->manager = NULL;
}
if (self->priv->seat) {
- g_object_weak_unref (G_OBJECT (self->priv->seat),
- (GWeakNotify)_on_seat_dispose, self);
+ g_object_weak_unref (G_OBJECT (self->priv->seat),
+ (GWeakNotify)_on_seat_dispose, self);
self->priv->seat = NULL;
}
DBG("disposing dbus_observer DONE: %p", self);
DBG ("%p", dbus_observer);
if (manager) {
- dbus_observer->priv->manager = manager;
- g_object_weak_ref (G_OBJECT (manager), (GWeakNotify)_on_manager_dispose,
- dbus_observer);
+ dbus_observer->priv->manager = manager;
+ g_object_weak_ref (G_OBJECT (manager), (GWeakNotify)_on_manager_dispose,
+ dbus_observer);
}
/* NOTE: When no seat is set at dbus object creation time,
* seat is connected on per dbus request basis and then
if (seat) {
dbus_observer->priv->seat = seat;
g_object_weak_ref (G_OBJECT (seat), (GWeakNotify)_on_seat_dispose,
- dbus_observer);
+ dbus_observer);
}
dbus_observer->priv->enable_flags = enable_flags;
g_hash_table_remove (manager->priv->seats, seat_id);
if (g_hash_table_size (manager->priv->seats) == 0) {
- DBG ("signalling stopped");
+ DBG ("signalling stopped");
g_signal_emit (manager, signals[SIG_MANAGER_STOPPED], 0);
}
static void
_disconnect_session_signals (
TlmSeat *seat);
-static void
-_destroy_dbus_observer (
- TlmDbusObserver **dbus_observer);
static void
_reset_next (TlmSeatPrivate *priv)
g_signal_emit (self, signals[SIG_SESSION_CREATED], 0, self->priv->id);
- _destroy_dbus_observer (&self->priv->prev_dbus_observer);
+ g_clear_object (&self->priv->prev_dbus_observer);
}
static void
DBG ("no relogin or switch user");
return;
}
- _destroy_dbus_observer (&priv->dbus_observer);
+ g_clear_object (&priv->dbus_observer);
if (tlm_config_get_boolean (priv->config,
TLM_CONFIG_GENERAL,
error->code == TLM_ERROR_SESSION_TERMINATION_FAILURE) {
DBG ("Destroy the session in case of creation/termination failure");
_close_active_session (self);
- _destroy_dbus_observer (&self->priv->dbus_observer);
+ g_clear_object (&self->priv->dbus_observer);
}
}
G_CALLBACK(_handle_error), seat);
}
-static void
-_destroy_dbus_observer (
- TlmDbusObserver **dbus_observer)
-{
- DBG ("destroy dbus obs: %p", *dbus_observer);
- if (*dbus_observer) {
- g_object_unref (*dbus_observer);
- *dbus_observer = NULL;
- }
-}
-
static gboolean
_create_dbus_observer (
TlmSeat *seat,
DBG("disposing seat: %s", seat->priv->id);
- _destroy_dbus_observer (&seat->priv->dbus_observer);
- _destroy_dbus_observer (&seat->priv->prev_dbus_observer);
+ g_clear_object (&seat->priv->dbus_observer);
+ g_clear_object (&seat->priv->prev_dbus_observer);
_disconnect_session_signals (seat);
if (seat->priv->session)
if (!service) {
service = tlm_config_get_string (priv->config,
priv->id,
- TLM_CONFIG_GENERAL_PAM_SERVICE);
+ username ? TLM_CONFIG_GENERAL_PAM_SERVICE : TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE);
if (!service)
service = tlm_config_get_string (priv->config,
TLM_CONFIG_GENERAL,
- TLM_CONFIG_GENERAL_PAM_SERVICE);
+ username ? TLM_CONFIG_GENERAL_PAM_SERVICE : TLM_CONFIG_GENERAL_DEFAULT_PAM_SERVICE);
}
if (!username) {
const gchar *name_tmpl =
{
TlmSessionRemote *self = TLM_SESSION_REMOTE (object);
switch (property_id) {
- case PROP_CONFIG:
+ case PROP_CONFIG:
self->priv->config = g_value_dup_object (value);
break;
case PROP_SEATID:
TlmSessionRemote *self = TLM_SESSION_REMOTE (object);
switch (property_id) {
- case PROP_CONFIG:
- g_value_set_object (value, self->priv->config);
- break;
- case PROP_SEATID:
- case PROP_USERNAME:
- case PROP_SERVICE:
- case PROP_SESSIONID: {
- if (self->priv->dbus_session_proxy) {
- g_object_get_property (G_OBJECT(self->priv->dbus_session_proxy),
- pspec->name, value);
- }
- break;
+ case PROP_CONFIG:
+ g_value_set_object (value, self->priv->config);
+ break;
+ case PROP_SEATID:
+ case PROP_USERNAME:
+ case PROP_SERVICE:
+ case PROP_SESSIONID: {
+ if (self->priv->dbus_session_proxy) {
+ g_object_get_property (G_OBJECT(self->priv->dbus_session_proxy),
+ pspec->name, value);
+ }
+ break;
}
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
return G_SOURCE_CONTINUE;
case SIGKILL:
DBG ("child %u didn't respond to SIGKILL, "
- "process is stuck in kernel", priv->cpid);
+ "process is stuck in kernel", priv->cpid);
priv->timer_id = 0;
if (self->priv->can_emit_signal) {
GError *error = TLM_GET_ERROR_FOR_ID (
tlm_session_remote_terminate (
TlmSessionRemote *self)
{
- g_return_if_fail (self && TLM_IS_SESSION_REMOTE(self));
+ g_return_val_if_fail (self && TLM_IS_SESSION_REMOTE(self), FALSE);
TlmSessionRemotePrivate *priv = TLM_SESSION_REMOTE_PRIV(self);
if (!priv->is_sessiond_up) {
return TRUE;
}
-
libtlm_session_daemon_la_LIBADD = \
$(top_builddir)/src/common/libtlm-common.la \
$(top_builddir)/src/common/dbus/libtlm-dbus-glue.la \
- -lpam \
+ -lpam -lpam_misc \
$(TLM_LIBS)
libtlm_session_daemon_la_SOURCES = \
libtlm_session_daemon_la_LIBADD = \
$(top_builddir)/src/common/libtlm-common.la \
$(top_builddir)/src/common/dbus/libtlm-dbus-glue.la \
- -lpam \
+ -lpam -lpam_misc \
$(TLM_LIBS)
libtlm_session_daemon_la_SOURCES = \
return FALSE;
}
-static void
+static void
_install_sighandlers (GMainLoop *main_loop)
{
GSource *source = NULL;
/*
* This file is part of tlm (Tizen Login Manager)
*
- * Copyright (C) 2013 Intel Corporation.
+ * Copyright (C) 2013-2014 Intel Corporation.
*
* Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com>
* Jussi Laako <jussi.laako@linux.intel.com>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
-#include <string.h>
+#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <security/pam_appl.h>
+#include <security/pam_misc.h>
#include <gio/gio.h>
#include "tlm-auth-session.h"
TlmAuthSessionPrivate *priv = TLM_AUTH_SESSION_PRIV (auth_session);
switch (property_id) {
- case PROP_SERVICE:
+ case PROP_SERVICE:
priv->service = g_value_dup_string (value);
break;
case PROP_USERNAME:
TlmAuthSessionPrivate *priv = TLM_AUTH_SESSION_PRIV (auth_session);
switch (property_id) {
- case PROP_SERVICE:
+ case PROP_SERVICE:
g_value_set_string (value, priv->service);
break;
case PROP_USERNAME:
tlm_auth_session_init (TlmAuthSession *auth_session)
{
TlmAuthSessionPrivate *priv = TLM_AUTH_SESSION_PRIV (auth_session);
-
+
priv->service = priv->username = NULL;
auth_session->priv = priv;
WARN ("PAM authentication failure: %s",
pam_strerror (priv->pam_handle, res));
if (error)
- *error = TLM_GET_ERROR_FOR_ID (TLM_ERROR_PAM_AUTH_FAILURE,
- "pam authenticaton failed : %s",
- pam_strerror (priv->pam_handle, res));
+ *error = TLM_GET_ERROR_FOR_ID (TLM_ERROR_PAM_AUTH_FAILURE,
+ "pam authenticaton failed : %s",
+ pam_strerror (priv->pam_handle, res));
return FALSE;
}
tlm_auth_session_open (TlmAuthSession *auth_session, GError **error)
{
int res;
- g_return_val_if_fail (auth_session &&
+ g_return_val_if_fail (auth_session &&
TLM_IS_AUTH_SESSION(auth_session), FALSE);
TlmAuthSessionPrivate *priv = TLM_AUTH_SESSION_PRIV (auth_session);
res = pam_setcred (priv->pam_handle, PAM_ESTABLISH_CRED);
if (res != PAM_SUCCESS) {
- WARN ("Failed to establish pam credentials: %s",
- pam_strerror (priv->pam_handle, res));
+ WARN ("Failed to establish pam credentials: %s",
+ pam_strerror (priv->pam_handle, res));
return FALSE;
}
res = pam_open_session (priv->pam_handle, 0);
if (res != PAM_SUCCESS) {
WARN ("Failed to open pam session: %s",
- pam_strerror (priv->pam_handle, res));
+ pam_strerror (priv->pam_handle, res));
return FALSE;
}
res = pam_setcred (priv->pam_handle, PAM_REINITIALIZE_CRED);
if (res != PAM_SUCCESS) {
- WARN ("Failed to reinitialize pam credentials: %s",
- pam_strerror (priv->pam_handle, res));
+ WARN ("Failed to reinitialize pam credentials: %s",
+ pam_strerror (priv->pam_handle, res));
pam_close_session (priv->pam_handle, 0);
return FALSE;
}
gchar **
tlm_auth_session_get_envlist (TlmAuthSession *auth_session)
{
- g_return_val_if_fail(TLM_IS_AUTH_SESSION(auth_session), NULL);
+ g_return_val_if_fail(TLM_IS_AUTH_SESSION (auth_session), NULL);
- return (gchar **)pam_getenvlist(auth_session->priv->pam_handle);
+ return (gchar **) pam_getenvlist(auth_session->priv->pam_handle);
}
+
+void
+tlm_auth_session_set_env (TlmAuthSession *auth_session, const gchar *key,
+ const gchar *value)
+{
+ g_return_if_fail (TLM_IS_AUTH_SESSION (auth_session));
+
+ pam_misc_setenv (auth_session->priv->pam_handle, key, value, 0);
+}
+
/*
* This file is part of tlm (Tizen Login Manager)
*
- * Copyright (C) 2013 Intel Corporation.
+ * Copyright (C) 2013-2014 Intel Corporation.
*
* Contact: Amarnath Valluri <amarnath.valluri@linux.intel.com>
* Jussi Laako <jussi.laako@linux.intel.com>
gchar **
tlm_auth_session_get_envlist (TlmAuthSession *auth_session);
+void
+tlm_auth_session_set_env (TlmAuthSession *auth_session, const gchar *key,
+ const gchar *value);
+
G_END_DECLS
#endif /* _TLM_AUTH_SESSION_H */
data = tlm_dbus_utils_hash_table_from_variant (environment);
g_object_get (self->priv->dbus_session, "seatid", &seatid,
- "username", &username, "service", &service, NULL);
+ "username", &username, "service", &service, NULL);
tlm_session_start (self->priv->session, seatid, service, username,
- password, data);
+ password, data);
g_hash_table_unref (data);
g_free (seatid);
gchar *sessionid;
gboolean can_emit_signal;
gboolean is_child_up;
+ gboolean session_pause;
};
static void
tlm_session_dispose (GObject *self)
{
TlmSession *session = TLM_SESSION(self);
- DBG("disposing session: %s", session->priv->service);
- session->priv->can_emit_signal = FALSE;
-
- if (session->priv->is_child_up) {
- tlm_session_terminate (session);
- while (session->priv->is_child_up)
- g_main_context_iteration(NULL, TRUE);
- DBG ("child DESTROYED");
- }
+ TlmSessionPrivate *priv = session->priv;
+ DBG("disposing session: %s", priv->service);
+ priv->can_emit_signal = FALSE;
+
+ tlm_session_terminate (session);
+ while (priv->is_child_up)
+ g_main_context_iteration(NULL, TRUE);
g_clear_object (&session->priv->config);
g_free (priv->seat_id);
priv->seat_id = g_value_dup_string (value);
break;
- case PROP_SERVICE:
+ case PROP_SERVICE:
priv->service = g_value_dup_string (value);
break;
case PROP_USERNAME:
case PROP_SEAT:
g_value_set_string (value, priv->seat_id);
break;
- case PROP_SERVICE:
+ case PROP_SERVICE:
g_value_set_string (value, priv->service);
break;
case PROP_USERNAME:
g_object_class_install_properties (g_klass, N_PROPERTIES, pspecs);
signals[SIG_SESSION_CREATED] = g_signal_new ("session-created",
- TLM_TYPE_SESSION, G_SIGNAL_RUN_LAST,
+ TLM_TYPE_SESSION, G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL, G_TYPE_NONE,
1, G_TYPE_STRING);
signals[SIG_SESSION_TERMINATED] = g_signal_new ("session-terminated",
- TLM_TYPE_SESSION, G_SIGNAL_RUN_LAST,
+ TLM_TYPE_SESSION, G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL, G_TYPE_NONE,
0, G_TYPE_NONE);
signals[SIG_AUTHENTICATED] = g_signal_new ("authenticated",
- TLM_TYPE_SESSION, G_SIGNAL_RUN_LAST,
+ TLM_TYPE_SESSION, G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL, G_TYPE_NONE,
0, G_TYPE_NONE);
signals[SIG_SESSION_ERROR] = g_signal_new ("session-error",
- TLM_TYPE_SESSION, G_SIGNAL_RUN_LAST,
+ TLM_TYPE_SESSION, G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL, G_TYPE_NONE,
1, G_TYPE_ERROR);
tlm_session_init (TlmSession *session)
{
TlmSessionPrivate *priv = TLM_SESSION_PRIV (session);
-
+
priv->service = NULL;
priv->env_hash = NULL;
priv->auth_session = NULL;
}
static void
-_setenv_to_session (gpointer key, gpointer val, gpointer user_data)
+_setenv_to_session (const gchar *key, const gchar *val,
+ TlmSessionPrivate *user_data)
{
- /*TlmSessionPrivate *priv = (TlmSessionPrivate *) user_data;*/
- setenv ((const char *) key, (const char *) val, 1);
+ TlmSessionPrivate *priv = (TlmSessionPrivate *) user_data;
+ if (priv->session_pause)
+ tlm_auth_session_set_env (priv->auth_session,
+ (const gchar *) key,
+ (const gchar *) val);
+ else
+ setenv ((const char *) key, (const char *) val, 1);
}
static gboolean
_set_environment (TlmSessionPrivate *priv)
{
gchar **envlist = tlm_auth_session_get_envlist(priv->auth_session);
- const gchar *home_dir=NULL, *shell=NULL;
+ const gchar *home_dir = NULL, *shell = NULL;
if (envlist) {
- gchar **env = 0;
- for (env = envlist; *env != NULL; ++env) {
- DBG ("ENV : %s", *env);
- putenv(*env);
- g_free (*env);
- }
- g_free (envlist);
+ gchar **env = 0;
+ for (env = envlist; *env != NULL; ++env) {
+ DBG ("ENV : %s", *env);
+ putenv(*env);
+ g_free (*env);
+ }
+ g_free (envlist);
}
const gchar *path = tlm_config_get_string (priv->config,
TLM_CONFIG_GENERAL_SESSION_PATH);
if (!path)
path = "/usr/local/bin:/usr/bin:/bin";
- setenv ("PATH", path, 1);
+ _setenv_to_session ("PATH", path, priv);
- setenv ("USER", priv->username, 1);
- setenv ("LOGNAME", priv->username, 1);
+ _setenv_to_session ("USER", priv->username, priv);
+ _setenv_to_session ("LOGNAME", priv->username, priv);
home_dir = tlm_user_get_home_dir (priv->username);
- if (home_dir) setenv ("HOME", home_dir, 1);
+ if (home_dir) _setenv_to_session ("HOME", home_dir, priv);
shell = tlm_user_get_shell (priv->username);
- if (shell) setenv ("SHELL", shell, 1);
- setenv ("XDG_SEAT", priv->seat_id, 1);
+ if (shell) _setenv_to_session ("SHELL", shell, priv);
+ _setenv_to_session ("XDG_SEAT", priv->seat_id, priv);
const gchar *xdg_data_dirs =
tlm_config_get_string (priv->config,
TLM_CONFIG_GENERAL_DATA_DIRS);
if (!xdg_data_dirs)
xdg_data_dirs = "/usr/share:/usr/local/share";
- setenv ("XDG_DATA_DIRS", xdg_data_dirs, 1);
+ _setenv_to_session ("XDG_DATA_DIRS", xdg_data_dirs, priv);
if (priv->env_hash)
g_hash_table_foreach (priv->env_hash,
- _setenv_to_session,
+ (GHFunc) _setenv_to_session,
priv);
return TRUE;
priv = session->priv;
if (!priv->username)
priv->username = g_strdup (tlm_auth_session_get_username (
- priv->auth_session));
+ priv->auth_session));
DBG ("session ID : %s", priv->sessionid);
priv->child_pid = fork ();
//close all open descriptors other than stdin, stdout, stderr
open_max = sysconf (_SC_OPEN_MAX);
for (fd = 3; fd < open_max; fd++)
- fcntl (fd, F_SETFD, FD_CLOEXEC);
+ fcntl (fd, F_SETFD, FD_CLOEXEC);
uid_t target_uid = tlm_user_get_uid (priv->username);
gid_t target_gid = tlm_user_get_gid (priv->username);
DBG (" state:\n\truid=%d, euid=%d, rgid=%d, egid=%d (%s)",
getuid(), geteuid(), getgid(), getegid(), priv->username);
_set_environment (priv);
+ umask(0700);
home = getenv("HOME");
if (home) {
DBG ("changing directory to : %s", home);
- if (chdir (home) < 0)
+ if (chdir (home) < 0)
WARN ("Failed to change directroy : %s", strerror (errno));
} else WARN ("Could not get home directory");
- if (tlm_config_get_boolean (priv->config,
- TLM_CONFIG_GENERAL,
- TLM_CONFIG_GENERAL_PAUSE_SESSION,
- FALSE)) {
- pause ();
- exit (0);
- return; /* this should be unreachable */
- }
-
shell = tlm_config_get_string (priv->config,
TLM_CONFIG_GENERAL,
TLM_CONFIG_GENERAL_SESSION_CMD);
password);
if (!priv->auth_session) {
- error = TLM_GET_ERROR_FOR_ID (TLM_ERROR_SESSION_CREATION_FAILURE,
- "Unable to create PAM sesssion");
- g_signal_emit (session, signals[SIG_SESSION_ERROR], 0, error);
- g_error_free (error);
- return FALSE;
+ error = TLM_GET_ERROR_FOR_ID (TLM_ERROR_SESSION_CREATION_FAILURE,
+ "Unable to create PAM sesssion");
+ g_signal_emit (session, signals[SIG_SESSION_ERROR], 0, error);
+ g_error_free (error);
+ return FALSE;
}
tlm_auth_session_putenv (priv->auth_session, "XDG_SEAT", priv->seat_id);
if (!tlm_auth_session_authenticate (priv->auth_session, &error)) {
- if (error) {
- //consistant error message flow
- GError *err = TLM_GET_ERROR_FOR_ID (
- TLM_ERROR_SESSION_CREATION_FAILURE,
- "%d:%s", error->code, error->message);
- g_error_free (error);
- error = err;
- } else {
+ if (error) {
+ //consistant error message flow
+ GError *err = TLM_GET_ERROR_FOR_ID (
+ TLM_ERROR_SESSION_CREATION_FAILURE,
+ "%d:%s", error->code, error->message);
+ g_error_free (error);
+ error = err;
+ } else {
error = TLM_GET_ERROR_FOR_ID (TLM_ERROR_SESSION_CREATION_FAILURE,
"Unable to authenticate PAM sesssion");
- }
- g_signal_emit (session, signals[SIG_SESSION_ERROR], 0, error);
- g_error_free (error);
- return FALSE;
+ }
+ g_signal_emit (session, signals[SIG_SESSION_ERROR], 0, error);
+ g_error_free (error);
+ return FALSE;
}
g_signal_emit (session, signals[SIG_AUTHENTICATED], 0);
+ priv->session_pause = tlm_config_get_boolean (priv->config,
+ TLM_CONFIG_GENERAL,
+ TLM_CONFIG_GENERAL_PAUSE_SESSION,
+ FALSE);
+ if (priv->session_pause) {
+ _set_environment (priv);
+ umask(0700);
+ }
+
if (!tlm_auth_session_open (priv->auth_session, &error)) {
- if (!error) {
- error = TLM_GET_ERROR_FOR_ID (TLM_ERROR_SESSION_CREATION_FAILURE,
- "Unable to open PAM sesssion");
- }
- g_signal_emit (session, signals[SIG_SESSION_ERROR], 0, error);
- g_error_free (error);
- return FALSE;
+ if (!error) {
+ error = TLM_GET_ERROR_FOR_ID (TLM_ERROR_SESSION_CREATION_FAILURE,
+ "Unable to open PAM sesssion");
+ }
+ g_signal_emit (session, signals[SIG_SESSION_ERROR], 0, error);
+ g_error_free (error);
+ return FALSE;
}
priv->sessionid = g_strdup (tlm_auth_session_get_sessionid (
- priv->auth_session));
+ priv->auth_session));
tlm_utils_log_utmp_entry (priv->username);
- _exec_user_session (session);
+ if (!priv->session_pause)
+ _exec_user_session (session);
g_signal_emit (session, signals[SIG_SESSION_CREATED], 0, priv->sessionid);
return TRUE;
}
$(TLM_CFLAGS) \
-DTLM_BIN_DIR='"$(bindir)"' \
$(DEPS_CFLAGS)
-
+
tlm_client_LDADD = \
$(DEPS_LIBS) \
$(top_builddir)/src/common/libtlm-common.la \
exit
fi
+currdir=`pwd`;
+echo "CURR dir = $currdir"
+
mkdir -p $2 && \
cd $2 && \
git rm -f -r *; rm -rf packaging;
cp dists/rpm/tizen/packaging/tlm.spec packaging/ && \
cp dists/rpm/tizen/packaging/tlm.manifest packaging/ && \
cp dists/rpm/tizen/packaging/tlm.changes packaging/ && \
-git add -f *;
+cp $currdir/.gitignore $2/;
+git add -f *; git add .gitignore;