/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2015 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <time.h>
#include <talloc.h>
#include "providers/be_ptask.h"
#include "providers/ldap/sdap_sudo_shared.h"
#include "db/sysdb_sudo.h"
void *pvt)
{
/* We don't allow both types to be disabled. At least smart refresh
* needs to be enabled. In this case smart refresh will catch up new
* and modified rules and deleted rules are caught when expired. */
"enabled. Setting smart refresh interval to default value "
"(%ld) seconds.\n", smart);
/* In this case it does not make any sense to run smart refresh. */
smart = 0;
"than full refresh interval. Periodical smart refresh will be "
"disabled.\n");
}
"refresh. Assuming none was performed so far.\n");
last_refresh = 0;
}
if (last_refresh == 0) {
/* If this is the first startup, we need to kick off an refresh
* immediately, to close a window where clients requesting sudo
* information won't get an immediate reply with no entries */
delay = 0;
} else {
/* At least one update has previously run, so clients will get cached
* data. We will delay the refresh so we don't slow down the startup
* process if this is happening during system boot. */
delay = 10;
}
/* Full refresh.
*
* Disable when offline and run immediately when SSSD goes back online.
* Since we have periodical online check we don't have to run this task
* when offline. */
if (full > 0) {
"SUDO Full Refresh", NULL);
return ret;
}
}
/* Smart refresh.
*
* Disable when offline and reschedule normally when SSSD goes back online.
* Since we have periodical online check we don't have to run this task
* when offline. */
if (smart > 0) {
"SUDO Smart Refresh", NULL);
return ret;
}
}
return EOK;
}
static char *
unsigned long usn,
const char *leftover)
{
char *newusn;
/* We increment USN number so that we can later use simplify filter
* (just usn >= last+1 instaed of usn >= last && usn != last).
*/
usn++;
/* Convert back to string appending non-converted values since it
* is an indicator that modifyTimestamp is used instead of entryUSN.
* modifyTimestamp contains also timezone specification, usually Z.
* We can't really handle any errors here so we just use what we got. */
return NULL;
}
return newusn;
}
void
const char *usn)
{
unsigned long usn_number;
char *newusn;
return;
}
return;
}
errno = 0;
if (errno != 0) {
return;
}
return;
}
} else {
}
}
}