<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 10/20/2014 02:53 PM, Jakub Hrozek
wrote:<br>
</div>
<blockquote cite="mid:20141020125342.GG10559@hendrix.redhat.com"
type="cite">
<pre wrap="">On Mon, Oct 20, 2014 at 01:24:38PM +0200, Jakub Hrozek wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I found a bug in the IFP initialization. The rest of the patches is
unchanged, only ifpsrv.c changed.
</pre>
</blockquote>
<pre wrap="">
Sorry, one more respin. I added a patch to chown the debug logs.
Initially, I wanted to open the debug logs as root and then just pass
the fd, but then I realized this wouldn't work for logfile rotation. So
I'm afraid we need to chown the log files..
The other patches are unchanged, just a new one was added.
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
sssd-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sssd-devel@lists.fedorahosted.org">sssd-devel@lists.fedorahosted.org</a>
<a class="moz-txt-link-freetext" href="https://lists.fedorahosted.org/mailman/listinfo/sssd-devel">https://lists.fedorahosted.org/mailman/listinfo/sssd-devel</a>
</pre>
</blockquote>
<br>
The changes LGTM I have just one nitpick<br>
<br>
<blockquote type="cite">+/* In cases SSSD used to run as the root
user, but runs as the SSSD user now,<br>
+ * we need to chown the log files<br>
+ */<br>
+int chown_debug_file(const char *filename,<br>
+ uid_t uid, gid_t gid)<br>
+{<br>
+ char *logpath;<br>
+ const char *log_file;<br>
+ errno_t ret;<br>
+<br>
+ if (filename == NULL) {<br>
+ log_file = debug_log_file;<br>
+ } else {<br>
+ log_file = filename;<br>
+ }<br>
+<br>
+ ret = asprintf(&logpath, "%s/%s.log", LOG_PATH,
log_file);<br>
+ if (ret == -1) {<br>
+ return ENOMEM;<br>
+ }<br>
+<br>
+ errno = 0;<br>
</blockquote>
No need to set errno as we check ret val of chown and not directly
errno.<br>
<br>
<blockquote type="cite">+ ret = chown(logpath, uid, gid);<br>
+ free(logpath);<br>
+ if (ret != 0) {<br>
+ ret = errno;<br>
+ DEBUG(SSSDBG_FATAL_FAILURE, "chown failed for [%s]:
[%d]\n",<br>
+ log_file, ret);<br>
+ return ret;<br>
+ }<br>
+<br>
+ return EOK;<br>
+}<br>
+</blockquote>
<br>
</body>
</html>