Re: [SSSD] [PATCH] added support for older MIT kerberos versions

2009-09-24 Thread Stephen Gallagher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/24/2009 04:17 PM, Stephen Gallagher wrote:
> On 09/24/2009 02:32 PM, Sumit Bose wrote:
>> Hi,
> 
>> this patch make the creation of the Kerberos locator plugin optional and
>> adds support for older versions of MIT Kerberos (and older version of
>> libdbus, too). It also has the promised man page.
> 
>> bye,
>> Sumit
> 
> 
>> 
> 
>> ___
>> sssd-devel mailing list
>> sssd-devel@lists.fedorahosted.org
>> https://fedorahosted.org/mailman/listinfo/sssd-devel
> 
> Ack.
> 

Pushed to master.
___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

- -- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkq8Ht0ACgkQeiVVYja6o6NPwgCgoKVBHalD8NzvFUKZY3r5QLCJ
cBoAn1swSGt0FRROAAB+YVJgsw505/pC
=2nJq
-END PGP SIGNATURE-
___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


Re: [SSSD] fixing ping probe when suspending computers

2009-09-24 Thread Stephen Gallagher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/24/2009 09:50 AM, Stephen Gallagher wrote:
> On 09/24/2009 09:48 AM, Simo Sorce wrote:
>> When a laptop is suspended the clock may be jumping hours, with this
>> patch now we explicitly count failure to pong back, so that at most we
>> may loose one ping due to time jumping and not kill the children right
>> away.
> 
>> Simo.
> 
> 
>> 
> 
>> ___
>> sssd-devel mailing list
>> sssd-devel@lists.fedorahosted.org
>> https://fedorahosted.org/mailman/listinfo/sssd-devel
> 
> Ack
> 

Pushed to master.
___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

- -- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkq8Hs4ACgkQeiVVYja6o6M9XgCcCPBa3nZ3f/ArNv+r8CX3aw3h
Y7sAnifAbT8D0L31ykYBG1C5gtGffOmE
=5Dr7
-END PGP SIGNATURE-
___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


Re: [SSSD] [PATCH] added support for older MIT kerberos versions

2009-09-24 Thread Stephen Gallagher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/24/2009 02:32 PM, Sumit Bose wrote:
> Hi,
> 
> this patch make the creation of the Kerberos locator plugin optional and
> adds support for older versions of MIT Kerberos (and older version of
> libdbus, too). It also has the promised man page.
> 
> bye,
> Sumit
> 
> 
> 
> 
> ___
> sssd-devel mailing list
> sssd-devel@lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/sssd-devel

Ack.

- -- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkq7098ACgkQeiVVYja6o6P64ACfbHpVEePav470HCkcqu1FmEhZ
6ZgAn31RiS28HRFvkXl34aBwqAExU5CB
=6SKy
-END PGP SIGNATURE-
___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


[SSSD] [PATCH] added support for older MIT kerberos versions

2009-09-24 Thread Sumit Bose
Hi,

this patch make the creation of the Kerberos locator plugin optional and
adds support for older versions of MIT Kerberos (and older version of
libdbus, too). It also has the promised man page.

bye,
Sumit
>From 9d001217a014042d8e7a9c1a53ac341cd90b10c3 Mon Sep 17 00:00:00 2001
From: sbose 
Date: Wed, 9 Sep 2009 12:26:07 +0200
Subject: [PATCH] added support for older MIT kerberos versions

- make the build of the locator plugin optional
- added a man page for the locator plugin
- use krb5.h if krb5/krb5.h cannot be found
- added alternatives for missing functions
- set -DDBUS_API_SUBJECT_TO_CHANGE if libdbus version
  is lesser than 1.0.0
---
 contrib/sssd.spec.in  |9 ++-
 server/Makefile.am|   13 +++-
 server/configure.ac   |6 ++
 server/external/krb5.m4   |   28 +
 server/man/sssd_krb5_locator_plugin.8.xml |   89 +
 server/providers/krb5/krb5_auth.c |3 +-
 server/providers/krb5/krb5_auth.h |   10 ++-
 server/providers/krb5/krb5_child.c|   31 +-
 8 files changed, 177 insertions(+), 12 deletions(-)
 create mode 100644 server/man/sssd_krb5_locator_plugin.8.xml

diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index 408d449..786b2e9 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -92,10 +92,16 @@ rm -f \
 
$RPM_BUILD_ROOT/%{_libdir}/krb5/plugins/libkrb5/sssd_krb5_locator_plugin.la \
 $RPM_BUILD_ROOT/%{python_sitearch}/pysss.la
 
+touch locator.filelist
+if test -e 
$RPM_BUILD_ROOT/%{_libdir}/krb5/plugins/libkrb5/sssd_krb5_locator_plugin.so
+then
+echo %{_libdir}/krb5/plugins/libkrb5/sssd_krb5_locator_plugin.so > 
locator.filelist
+fi
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%files
+%files -f locator.filelist
 %defattr(-,root,root,-)
 %doc COPYING
 %{_initrddir}/%{name}
@@ -109,7 +115,6 @@ rm -rf $RPM_BUILD_ROOT
 %{_libexecdir}/%{servicename}/
 %{_libdir}/%{name}/
 %{_libdir}/ldb/memberof.so
-%{_libdir}/krb5/plugins/libkrb5/*
 %dir %{sssdstatedir}
 %attr(700,root,root) %dir %{dbpath}
 %attr(755,root,root) %dir %{pipepath}
diff --git a/server/Makefile.am b/server/Makefile.am
index 6ed405a..41eeefb 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -7,7 +7,9 @@ builddir ?= .
 sssdlibexecdir = $(libexecdir)/sssd
 sssdlibdir = $(libdir)/sssd
 ldblibdir = $(libdir)/ldb
+if BUILD_KRB5_LOCATOR_PLUGIN
 krb5plugindir = @krb5pluginpath@
+endif
 sssdconfdir = $(sysconfdir)/sssd
 dbusintrospectdir = $(datarootdir)/sssd/introspect
 dbuspolicydir = $(sysconfdir)/dbus-1/system.d
@@ -78,8 +80,10 @@ sssdlib_LTLIBRARIES = \
 ldblib_LTLIBRARIES = \
 memberof.la
 
+if BUILD_KRB5_LOCATOR_PLUGIN
 krb5plugin_LTLIBRARIES = \
 sssd_krb5_locator_plugin.la
+endif
 
 noinst_LTLIBRARIES = \
 libsss_crypt.la
@@ -203,8 +207,8 @@ SSSD_LIBS = \
 $(COLLECTION_LIBS) \
 $(DHASH_LIBS) \
 $(REPLACE_LIBS) \
-$(NSS_LIBS) \
-libsss_crypt.la
+libsss_crypt.la \
+$(NSS_LIBS)
 
 PYTHON_BINDINGS_LIBS = \
 $(TALLOC_LIBS) \
@@ -464,6 +468,7 @@ memberof_la_LDFLAGS = \
 -avoid-version \
 -module
 
+if BUILD_KRB5_LOCATOR_PLUGIN
 sssd_krb5_locator_plugin_la_SOURCES = \
 krb5_plugin/sssd_krb5_locator_plugin.c
 sssd_krb5_locator_plugin_la_CFLAGS = \
@@ -472,6 +477,7 @@ sssd_krb5_locator_plugin_la_CFLAGS = \
 sssd_krb5_locator_plugin_la_LDFLAGS = \
 -avoid-version \
 -module
+endif
 
 if BUILD_PYTHON_BINDINGS
 pysss_la_SOURCES = \
@@ -501,7 +507,8 @@ XSLTPROC_FLAGS = --catalogs --xinclude --nonet
 
 dist_man_MANS = man/sss_useradd.8 man/sss_userdel.8 man/sss_usermod.8 \
man/sss_groupadd.8 man/sss_groupdel.8 man/sss_groupmod.8 \
-   man/sssd.8 man/sssd.conf.5 man/sssd-ldap.5 man/sssd-krb5.5
+   man/sssd.8 man/sssd.conf.5 man/sssd-ldap.5 man/sssd-krb5.5 \
+   man/sssd_krb5_locator_plugin.8
 
 SUFFIXES = .1.xml .1 .3.xml .3 .5.xml .5 .8.xml .8
 .1.xml.1:
diff --git a/server/configure.ac b/server/configure.ac
index 475bdca..03d2885 100644
--- a/server/configure.ac
+++ b/server/configure.ac
@@ -67,6 +67,12 @@ m4_include([external/python.m4])
 m4_include([util/signal.m4])
 
 PKG_CHECK_MODULES([DBUS],[dbus-1])
+dnl if test -n "`$PKG_CONFIG --modversion dbus-1 | grep '^0\.'`" ; then
+if ! $PKG_CONFIG --atleast-version 1.0.0 dbus-1; then
+DBUS_CFLAGS="$DBUS_CFLAGS -DDBUS_API_SUBJECT_TO_CHANGE"
+AC_MSG_RESULT([setting -DDBUS_API_SUBJECT_TO_CHANGE])
+fi
+
 if test x$has_dbus != xno; then
 SAFE_LDFLAGS="$LDFLAGS"
 LDFLAGS="$DBUS_LIBS"
diff --git a/server/external/krb5.m4 b/server/external/krb5.m4
index 1ed5064..95cd386 100644
--- a/server/external/krb5.m4
+++ b/server/external/krb5.m4
@@ -9,3 +9,31 @@ if test -x "$KRB5_CONFIG"; then
 else
   AC_MSG_ERROR(no. Please install MIT kerberos devel package)
 fi
+
+SAVE_CFLAGS=$CFLAGS
+SAVE_LIBS=$LIBS
+CFLAGS="$CFLAGS $KRB5_CFLAGS"
+LIBS="$LIBS $KRB5_LIBS"
+AC_CHECK_HEADERS([krb5.h krb5/krb5.h])
+AC_CHE

[SSSD] [PATCH] toggle debug output of sssd_krb5_locator_plugin with an environment variable [was: [PATCH] declare hostip only in debug mode]

2009-09-24 Thread Sumit Bose
On Thu, Sep 24, 2009 at 03:21:49PM +0200, Sumit Bose wrote:
> On Thu, Sep 24, 2009 at 09:09:04AM -0400, Simo Sorce wrote:
> > On Thu, 2009-09-24 at 14:39 +0200, Sumit Bose wrote:
> > > Hi,
> > > 
> > > this patch suppresses a compiler warning when KRB5_PLUGIN_DEBUG is not
> > > set, which is the common case.
> > 
> > Sumit,
> > would it be possible to use an env variable to control debug instead of
> > a compile time define ? That would solve it more neatly and also make it
> > simple to activate debugging at will.
> > 
> > Simo.
> > 
> 
> Thanks, very nice idea. I will set it automatically if the debug level
> of the Kerberos provider is 5 or higher and anyone is free to set it
> explicit when needed.
> 

ok, I have only implemented the explicit way so far, because the
other way might interfere with to debug_to_files scheme.

A man page for the locator plugin will be in another patch I will sent
soon.

bye,
Sumit
>From 1f4a55686ab0e3b9b30dccc266e422d0e6a538a9 Mon Sep 17 00:00:00 2001
From: Sumit Bose 
Date: Thu, 24 Sep 2009 14:28:33 +0200
Subject: [PATCH] toggle debug output of sssd_krb5_locator_plugin with an 
environment variable

---
 server/krb5_plugin/sssd_krb5_locator_plugin.c |   91 +++--
 1 files changed, 55 insertions(+), 36 deletions(-)

diff --git a/server/krb5_plugin/sssd_krb5_locator_plugin.c 
b/server/krb5_plugin/sssd_krb5_locator_plugin.c
index 82ab8e9..7ccdb3f 100644
--- a/server/krb5_plugin/sssd_krb5_locator_plugin.c
+++ b/server/krb5_plugin/sssd_krb5_locator_plugin.c
@@ -17,7 +17,7 @@
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see .
 */
-
+#define _GNU_SOURCE
 #include 
 #include 
 #include 
@@ -33,11 +33,40 @@
 
 #include "providers/krb5/krb5_auth.h"
 
+#define SSSD_KRB5_LOCATOR_DEBUG "SSSD_KRB5_LOCATOR_DEBUG"
+#define DEBUG_KEY "[sssd_krb5_locator] "
+#define DEBUG(body) do { \
+if (ctx->debug) { \
+debug_fn body; \
+} \
+} while(0);
+
 struct sssd_ctx {
 char *sssd_realm;
 struct addrinfo *sssd_kdc_addrinfo;
+bool debug;
 };
 
+void debug_fn(const char *format, ...)
+{
+va_list ap;
+char *s = NULL;
+int ret;
+
+va_start(ap, format);
+
+ret = vasprintf(&s, format, ap);
+if (ret < 0) {
+/* ENOMEM */
+return;
+}
+
+va_end(ap);
+
+fprintf(stderr, DEBUG_KEY "%s", s);
+free(s);
+}
+
 krb5_error_code sssd_krb5_locator_init(krb5_context context,
void **private_data)
 {
@@ -45,14 +74,17 @@ krb5_error_code sssd_krb5_locator_init(krb5_context context,
 const char *dummy;
 int ret;
 
-
-#ifdef KRB5_PLUGIN_DEBUG
-fprintf(stderr,"sssd_krb5_locator_init called\n");
-#endif
-
 ctx = calloc(1,sizeof(struct sssd_ctx));
 if (ctx == NULL) return ENOMEM;
 
+dummy = getenv(SSSD_KRB5_LOCATOR_DEBUG);
+if (dummy == NULL) {
+ctx->debug = false;
+} else {
+ctx->debug = true;
+DEBUG(("sssd_krb5_locator_init called\n"));
+}
+
 dummy = getenv(SSSD_KRB5_REALM);
 if (dummy == NULL) goto failed;
 ctx->sssd_realm = strdup(dummy);
@@ -63,14 +95,10 @@ krb5_error_code sssd_krb5_locator_init(krb5_context context,
 
 ret = getaddrinfo(dummy, "kerberos", NULL, &ctx->sssd_kdc_addrinfo);
 if (ret != 0) {
-#ifdef KRB5_PLUGIN_DEBUG
-fprintf(stderr,"getaddrinfo failed [%d][%s].\n", ret,
- gai_strerror(ret));
+DEBUG(("getaddrinfo failed [%d][%s].\n", ret, gai_strerror(ret)));
 if (ret == EAI_SYSTEM) {
-fprintf(stderr,"getaddrinfo failed [%d][%s].\n", errno,
- strerror(errno));
+DEBUG(("getaddrinfo failed [%d][%s].\n", errno, strerror(errno)));
 }
-#endif
 goto failed;
 }
 
@@ -91,13 +119,11 @@ void sssd_krb5_locator_close(void *private_data)
 {
 struct sssd_ctx *ctx;
 
-#ifdef KRB5_PLUGIN_DEBUG
-fprintf(stderr,"sssd_krb5_locator_close called\n");
-#endif
-
 if (private_data == NULL) return;
 
 ctx = (struct sssd_ctx *) private_data;
+DEBUG(("sssd_krb5_locator_close called\n"));
+
 freeaddrinfo(ctx->sssd_kdc_addrinfo);
 free(ctx->sssd_realm);
 free(ctx);
@@ -122,11 +148,9 @@ krb5_error_code sssd_krb5_locator_lookup(void 
*private_data,
 if (private_data == NULL) return KRB5_PLUGIN_NO_HANDLE;
 ctx = (struct sssd_ctx *) private_data;
 
-#ifdef KRB5_PLUGIN_DEBUG
-fprintf(stderr,"sssd_realm[%s] requested realm[%s] family[%d] "
-   "socktype[%d] locate_service[%d]\n",
-   ctx->sssd_realm, realm, family, socktype, svc);
-#endif
+DEBUG(("sssd_realm[%s] requested realm[%s] family[%d] socktype[%d] "
+  "locate_service[%d]\n", ctx->sssd_realm, realm, family, socktype,
+  svc));
 
 switch (svc) {
 case locate_service_kdc:
@@ -161,33 +185,28

Re: [SSSD] fixing ping probe when suspending computers

2009-09-24 Thread Stephen Gallagher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/24/2009 09:48 AM, Simo Sorce wrote:
> When a laptop is suspended the clock may be jumping hours, with this
> patch now we explicitly count failure to pong back, so that at most we
> may loose one ping due to time jumping and not kill the children right
> away.
> 
> Simo.
> 
> 
> 
> 
> ___
> sssd-devel mailing list
> sssd-devel@lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/sssd-devel

Ack

- -- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkq7eTUACgkQeiVVYja6o6M+BQCeIZRHPGUlLfFYt904JI1eHeie
iD0AnRuikhPul9YnfzxUjPBgRIPwyA2K
=WOXV
-END PGP SIGNATURE-
___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


[SSSD] fixing ping probe when suspending computers

2009-09-24 Thread Simo Sorce
When a laptop is suspended the clock may be jumping hours, with this
patch now we explicitly count failure to pong back, so that at most we
may loose one ping due to time jumping and not kill the children right
away.

Simo.


0001-Handle-suspend-cases.patch
Description: application/mbox
___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


Re: [SSSD] [PATCH] declare hostip only in debug mode

2009-09-24 Thread Sumit Bose
On Thu, Sep 24, 2009 at 09:09:04AM -0400, Simo Sorce wrote:
> On Thu, 2009-09-24 at 14:39 +0200, Sumit Bose wrote:
> > Hi,
> > 
> > this patch suppresses a compiler warning when KRB5_PLUGIN_DEBUG is not
> > set, which is the common case.
> 
> Sumit,
> would it be possible to use an env variable to control debug instead of
> a compile time define ? That would solve it more neatly and also make it
> simple to activate debugging at will.
> 
> Simo.
> 

Thanks, very nice idea. I will set it automatically if the debug level
of the Kerberos provider is 5 or higher and anyone is free to set it
explicit when needed.

bye,
Sumit
___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


[SSSD] [PATCH] Temporarily disable automatic config file reread

2009-09-24 Thread Stephen Gallagher
The backends do not honor the reloadConfig SBUS message right now,
so if an admin changes the sssd.conf file, it will update only the
monitor, potentially leaving the SSSD as a whole in a bad state.

This patch will simply comment out monitor_config_file() for the
time being until https://fedorahosted.org/sssd/ticket/91 is fixed.

-- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
From 00d40204580b418fa71c1390650d8d43a1aaebcc Mon Sep 17 00:00:00 2001
From: Stephen Gallagher 
Date: Thu, 24 Sep 2009 08:59:03 -0400
Subject: [PATCH 1/2] Temporarily disable automatic config file reread

The backends do not honor the reloadConfig SBUS message right now,
so if an admin changes the sssd.conf file, it will update only the
monitor, potentially leaving the SSSD as a whole in a bad state.

This patch will simply comment out monitor_config_file() for the
time being until https://fedorahosted.org/sssd/ticket/91 is fixed.
---
 server/monitor/monitor.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index 44ce5f2..39cc291 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -1864,12 +1864,18 @@ int monitor_process_init(struct mt_ctx *ctx,
 int ret, i;
 struct sss_domain_info *dom;
 
+#if 0
+This feature is incomplete and can leave the SSSD in a bad state if the
+config file is changed while the SSSD is running.
+
+Uncomment this once the backends are honoring reloadConfig()
+
 /* Watch for changes to the confdb config file */
 ret = monitor_config_file(ctx, ctx, config_file, monitor_signal_reconf);
 if (ret != EOK) {
 return ret;
 }
-
+#endif
 /* Watch for changes to the DNS resolv.conf */
 ret = monitor_config_file(ctx, ctx, RESOLV_CONF_PATH,
   monitor_update_resolv);
-- 
1.6.2.5



signature.asc
Description: OpenPGP digital signature
___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


Re: [SSSD] [PATCH] declare hostip only in debug mode

2009-09-24 Thread Simo Sorce
On Thu, 2009-09-24 at 14:39 +0200, Sumit Bose wrote:
> Hi,
> 
> this patch suppresses a compiler warning when KRB5_PLUGIN_DEBUG is not
> set, which is the common case.

Sumit,
would it be possible to use an env variable to control debug instead of
a compile time define ? That would solve it more neatly and also make it
simple to activate debugging at will.

Simo.

___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


[SSSD] [PATCH] declare hostip only in debug mode

2009-09-24 Thread Sumit Bose
Hi,

this patch suppresses a compiler warning when KRB5_PLUGIN_DEBUG is not
set, which is the common case.

bye,
Sumit
>From bc6076e2cf15cfe63afee133921063a12a611eec Mon Sep 17 00:00:00 2001
From: Sumit Bose 
Date: Thu, 24 Sep 2009 14:28:33 +0200
Subject: [PATCH] declare hostip only in debug mode

---
 server/krb5_plugin/sssd_krb5_locator_plugin.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/krb5_plugin/sssd_krb5_locator_plugin.c 
b/server/krb5_plugin/sssd_krb5_locator_plugin.c
index 82ab8e9..18e47c4 100644
--- a/server/krb5_plugin/sssd_krb5_locator_plugin.c
+++ b/server/krb5_plugin/sssd_krb5_locator_plugin.c
@@ -117,12 +117,12 @@ krb5_error_code sssd_krb5_locator_lookup(void 
*private_data,
 int ret;
 struct addrinfo *ai;
 struct sssd_ctx *ctx;
-char hostip[NI_MAXHOST];
 
 if (private_data == NULL) return KRB5_PLUGIN_NO_HANDLE;
 ctx = (struct sssd_ctx *) private_data;
 
 #ifdef KRB5_PLUGIN_DEBUG
+char hostip[NI_MAXHOST];
 fprintf(stderr,"sssd_realm[%s] requested realm[%s] family[%d] "
"socktype[%d] locate_service[%d]\n",
ctx->sssd_realm, realm, family, socktype, svc);
-- 
1.6.2.5

___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


Re: [SSSD] [PATCH] Send debug messages to logfile

2009-09-24 Thread Sumit Bose
On Thu, Sep 24, 2009 at 11:56:00AM +0200, Jakub Hrozek wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> On 09/23/2009 07:16 PM, Jakub Hrozek wrote:
> > Introduces a new option --debug-to-files which makes SSSD output its
> > debug information to a file instead of stderr, which is still the
> > default.
> > 
> > Also introduces a new confdb option debug_to_files which does the same,
> > but can be specified per-service in the config file.
> > 
> > The logfiles are stored in /var/log/sssd by default.
> > 
> > I also removed two lines in Makefile.am that still referenced
> > shadow-utils, don't think it warrants a separate patch.
> > 
> > Jakub
> 
> I accidentally sent a patch from branch with the confdb 2.0 changes, so
> it did not apply cleanly. Resending.

Hi,

is it possible to open the debug file earlier in server_setup to catch
all messages from server_setup?

bye,
Sumit
___
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel


Re: [SSSD] [PATCH] Send debug messages to logfile

2009-09-24 Thread Jakub Hrozek
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/23/2009 07:16 PM, Jakub Hrozek wrote:
> Introduces a new option --debug-to-files which makes SSSD output its
> debug information to a file instead of stderr, which is still the
> default.
> 
> Also introduces a new confdb option debug_to_files which does the same,
> but can be specified per-service in the config file.
> 
> The logfiles are stored in /var/log/sssd by default.
> 
> I also removed two lines in Makefile.am that still referenced
> shadow-utils, don't think it warrants a separate patch.
> 
>   Jakub

I accidentally sent a patch from branch with the confdb 2.0 changes, so
it did not apply cleanly. Resending.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkq7QiMACgkQHsardTLnvCU3EwCfQg7b91+0nJecpOvK6riVtI15
PRgAn11OrgoWoln77UeMsB5jlFK+02gp
=Wx1t
-END PGP SIGNATURE-
>From 2e950f2ad86fe68057cafe92b987fa1c3da25152 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek 
Date: Wed, 23 Sep 2009 14:19:38 +0200
Subject: [PATCH] Send debug messages to logfile

Introduces a new option --debug-to-files which makes SSSD output its
debug information to a file instead of stderr, which is still the
default.

Also introduces a new confdb option debug_to_files which does the same,
but can be specified per-service in the config file.

The logfiles are stored in /var/log/sssd by default.
---
 server/Makefile.am  |4 +-
 server/conf_macros.m4   |   17 
 server/configure.ac |1 +
 server/monitor/monitor.c|   18 ++--
 server/providers/data_provider.c|3 ++
 server/providers/data_provider_be.c |4 +++
 server/responder/nss/nsssrv.c   |5 +++-
 server/responder/pam/pamsrv.c   |3 ++
 server/util/debug.c |   37 ++-
 server/util/server.c|   23 +
 server/util/util.h  |5 
 11 files changed, 113 insertions(+), 7 deletions(-)

diff --git a/server/Makefile.am b/server/Makefile.am
index 6ed405a..48628b2 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -18,7 +18,7 @@ pluginpath = @pluginpath@
 pidpath = @pidpath@
 pipepath = @pipepath@
 initdir = @initdir@
-shadow_utils_path = @shadow_utils_path@
+logpath = @logpath@
 
 AM_CFLAGS =
 if WANT_AUX_INFO
@@ -545,7 +545,7 @@ installsssddirs::
 $(DESTDIR)$(dbpath) \
 $(DESTDIR)$(pidpath) \
 $(DESTDIR)$(initdir) \
-$(DESTDIR)$(shadow_utils_path)
+$(DESTDIR)$(logpath)
 
 install-exec-hook: installsssddirs
 
diff --git a/server/conf_macros.m4 b/server/conf_macros.m4
index 9ab2003..410914e 100644
--- a/server/conf_macros.m4
+++ b/server/conf_macros.m4
@@ -49,6 +49,23 @@ AC_DEFUN([WITH_PID_PATH],
 AC_DEFINE_UNQUOTED(PID_PATH, "$config_pidpath", [Where to store pid files for the SSSD])
   ])
 
+AC_DEFUN([WITH_LOG_PATH],
+  [ AC_ARG_WITH([log-path],
+[AC_HELP_STRING([--with-log-path=PATH],
+[Where to store log files for the SSSD [/var/log/sssd]]
+   )
+]
+   )
+config_logpath="\"VARDIR\"/log/sssd"
+logpath="${localstatedir}/log/sssd"
+if test x"$with_log_path" != x; then
+config_logpath=$with_log_path
+logpath=$with_log_path
+fi
+AC_SUBST(logpath)
+AC_DEFINE_UNQUOTED(LOG_PATH, "$config_logpath", [Where to store log files for the SSSD])
+  ])
+
 AC_DEFUN([WITH_PIPE_PATH],
   [ AC_ARG_WITH([pipe-path],
 [AC_HELP_STRING([--with-pipe-path=PATH],
diff --git a/server/configure.ac b/server/configure.ac
index 475bdca..21631b0 100644
--- a/server/configure.ac
+++ b/server/configure.ac
@@ -42,6 +42,7 @@ m4_include(conf_macros.m4)
 WITH_DB_PATH
 WITH_PLUGIN_PATH
 WITH_PID_PATH
+WITH_LOG_PATH
 WITH_PIPE_PATH
 WITH_INIT_DIR
 WITH_SHADOW_UTILS_PATH
diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index 44ce5f2..43bbcff 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -930,11 +930,13 @@ static int get_service_config(struct mt_ctx *ctx, const char *name,
 }
 
 if (!svc->command) {
-svc->command = talloc_asprintf(svc, "%s/sssd_%s -d %d%s",
+svc->command = talloc_asprintf(svc, "%s/sssd_%s -d %d%s%s",
SSSD_LIBEXEC_PATH,
svc->name, debug_level,
(debug_timestamps?
-  " --debug-timestamps":""));
+  " --debug-timestamps":""),
+   (debug_to_file ?
+  " --debug-to-files":""));
 if (!svc->command) {
 talloc_free(svc);
 return ENOMEM;
@@ -1041,9 +1043,10 @@ static int get_provider_config(str