[SSSD] [PATCH] DEBUG: Don't error on chown of nonexistent file
Stephen Gallagher
sgallagh at redhat.com
Thu Oct 29 13:06:24 UTC 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 10/28/2015 04:48 PM, Lukas Slebodnik wrote:
> On (28/10/15 09:03), Stephen Gallagher wrote:
>> On 10/27/2015 05:33 PM, Lukas Slebodnik wrote:
>>> On (27/10/15 09:48), Stephen Gallagher wrote:
>>>> We get an error message if we start up SSSD and the debug
>>>> log does not yet exist.
>>>
>>>> From 53592734f73c50029fa573b9bc070437304ea489 Mon Sep 17
>>>> 00:00:00 2001 From: Stephen Gallagher <sgallagh at redhat.com>
>>>> Date: Tue, 27 Oct 2015 09:39:01 -0400 Subject: [PATCH] DEBUG:
>>>> Don't error on chown of nonexistent file
>>>>
>>>> We get an error message if we start up SSSD and the debug
>>>> log does not yet exist. --- src/util/debug.c | 9 ++++++--- 1
>>>> file changed, 6 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/src/util/debug.c b/src/util/debug.c index
>>>> a8eea32740155ec3daf6be71ef9a8af6592f74a9..729d9f99d35c7208950a9a1af1f
>>
>>>>
df3942b23a147
>>>> 100644 --- a/src/util/debug.c +++ b/src/util/debug.c @@
>>>> -331,13 +331,16 @@ int chown_debug_file(const char
>>>> *filename,
>>>>
>>>> ret = chown(logpath, uid, gid); free(logpath); if (ret != 0)
>>>> { ret = errno; - DEBUG(SSSDBG_FATAL_FAILURE,
>>>> "chown failed for [%s]: [%d]\n", - log_file,
>>>> ret); - return ret; + if (ret != ENOENT) { +
>>>> /* Don't write an error message for a nonexistent file */ +
>>>> DEBUG(SSSDBG_FATAL_FAILURE, "chown failed for [%s]: [%d]\n",
>>>> + log_file, ret); + return ret; +
>>>> }
>>> Patch make sense, But I cannot see an error message even with
>>> empty directory /var/log/sssd. Do you have an idea why?
>>>
>>
>> Start the sssd in interactive mode instead of sending to files
>> and it will become clear :)
>>
> I'm sorry but it is not clear :-)
>
> [root at host ~]# rm -f /var/log/sssd/* /var/lib/sss/{db,mc}/*
> [root at host ~]# sssd -i -d 3 (Wed Oct 28 21:43:57 2015)
> [sssd[be[redhat.com]]] [sysdb_idmap_get_mappings] (0x0080): Could
> not locate ID mappings: [No such file or directory] (Wed Oct 28
> 21:43:57 2015) [sssd[be[redhat.com]]] [be_process_init] (0x0080):
> No SUDO module provided for [redhat.com] !! (Wed Oct 28 21:43:57
> 2015) [sssd[be[redhat.com]]] [be_process_init] (0x0020): No selinux
> module provided for [redhat.com] !! (Wed Oct 28 21:43:57 2015)
> [sssd[be[redhat.com]]] [be_process_init] (0x0020): No host info
> module provided for [redhat.com] !! (Wed Oct 28 21:43:57 2015)
> [sssd[be[redhat.com]]] [be_process_init] (0x0020): Subdomains are
> not supported for [redhat.com] !! (Wed Oct 28 21:44:27 2015)
> [sssd[be[redhat.com]]] [be_run_online_cb] (0x0080): Going online.
> Running callbacks.
>
> I think it was fixed in ticket or did I miss something?
> https://fedorahosted.org/sssd/ticket/2493
>
It's entirely possible; I was comparing against the latest Fedora
release and I missed that patch going in. Feel free to drop this.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iEYEARECAAYFAlYyGc0ACgkQeiVVYja6o6ObkACePb/EfAA/heF7+VLMALdq05Mt
pE8An1+QkoT8oNfR2OQdacTlb5kwFLl6
=xcV8
-----END PGP SIGNATURE-----
More information about the sssd-devel
mailing list