On (18/05/15 11:28), Pavel Březina wrote:
On 05/15/2015 03:54 PM, Lukas Slebodnik wrote:
>ehlo,
>
>2nd and 3rd patch fixes
https://fedorahosted.org/sssd/ticket/2634
>
>Steps to reproduce are written in upstream and downstream ticket.
>Patches are quite small so it should be clear from patches
>how to reproduce bug.
>
>LS
#0001: Ack
#0002: Ack
#0003:
+ cache_timeout = domain->user_timeout;
+
+ ret = sysdb_attrs_add_time_t(attrs, SYSDB_INITGR_EXPIRE,
+ (cache_timeout ?
+ (time(NULL) + cache_timeout) : 0));
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, "Could not set up attrs\n");
+ goto done;
+ }
Can you move the condition outside the function parameter?
cache_timeout = domain->user_timeout ? time(NULL) + domain->user_timeout : 0;
done
if (is_initgr) {
- ret = sysdb_attrs_add_time_t(user_attrs, SYSDB_INITGR_EXPIRE,
- (cache_timeout ?
- (time(NULL) + cache_timeout) : 0));
+ ret = sysdb_attrs_add_time_t(user_attrs, SYSDB_INITGR_EXPIRE, 0);
if (ret) {
goto done;
Can you explain this step? You are removing this code in the next patch but I
would expect it to be removed here already.
It's left over after troubleshooting.
Setting attribute to default value does not have any effect.
It's sufficient to set attribute after initgroups.
Thank you for review.
Updated patches are attached.
LS