Skip to content

Commit

Permalink
TOOLS: remove the upgrade-cache command
Browse files Browse the repository at this point in the history
552390a mentioned
```
might be useful e.g. in RPM %post scripts.
```
but it didn't happen.

SSSD performs cache upgrade at startup automatically, explicit
command doesn't have any use.

On the other hand, it can spoil cache files ownership if users used
to run 'sssctl' and SSSD do not match.

:relnote: sssct `cache-upgrade` command was removed. SSSD performs automatic
upgrade at startup when needed.
  • Loading branch information
alexey-tikhonov committed Feb 21, 2024
1 parent 748612f commit 3436469
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 39 deletions.
1 change: 0 additions & 1 deletion src/tools/sssctl/sssctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ int main(int argc, const char **argv)
SSS_TOOL_COMMAND("client-data-backup", "Backup local data", 0, sssctl_client_data_backup),
SSS_TOOL_COMMAND("client-data-restore", "Restore local data from backup", 0, sssctl_client_data_restore),
SSS_TOOL_COMMAND("cache-remove", "Backup local data and remove cached content", 0, sssctl_cache_remove),
SSS_TOOL_COMMAND("cache-upgrade", "Perform cache upgrade", ERR_SYSDB_VERSION_TOO_OLD, sssctl_cache_upgrade),
SSS_TOOL_COMMAND("cache-expire", "Invalidate cached objects", 0, sssctl_cache_expire),
SSS_TOOL_COMMAND("cache-index", "Manage cache indexes", 0, sssctl_cache_index),
SSS_TOOL_DELIMITER("Log files tools:"),
Expand Down
4 changes: 0 additions & 4 deletions src/tools/sssctl/sssctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ errno_t sssctl_cache_remove(struct sss_cmdline *cmdline,
struct sss_tool_ctx *tool_ctx,
void *pvt);

errno_t sssctl_cache_upgrade(struct sss_cmdline *cmdline,
struct sss_tool_ctx *tool_ctx,
void *pvt);

errno_t sssctl_cache_expire(struct sss_cmdline *cmdline,
struct sss_tool_ctx *tool_ctx,
void *pvt);
Expand Down
34 changes: 0 additions & 34 deletions src/tools/sssctl/sssctl_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,40 +259,6 @@ errno_t sssctl_cache_remove(struct sss_cmdline *cmdline,
return EOK;
}

errno_t sssctl_cache_upgrade(struct sss_cmdline *cmdline,
struct sss_tool_ctx *tool_ctx,
void *pvt)
{
struct sysdb_upgrade_ctx db_up_ctx;
errno_t ret;

ret = sss_tool_popt(cmdline, NULL, SSS_TOOL_OPT_OPTIONAL, NULL, NULL);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse command arguments\n");
return ret;
}

if (sss_daemon_running()) {
return ERR_SSSD_RUNNING;
}

ret = confdb_get_domains(tool_ctx->confdb, &tool_ctx->domains);
if (ret != EOK) {
DEBUG(SSSDBG_FATAL_FAILURE, "No domains configured.\n");
return ret;
}

db_up_ctx.cdb = tool_ctx->confdb;
ret = sysdb_init_ext(tool_ctx, tool_ctx->domains, &db_up_ctx,
true, 0, 0);
if (ret != EOK) {
SYSDB_VERSION_ERROR_DAEMON(ret);
return ret;
}

return EOK;
}

errno_t sssctl_cache_expire(struct sss_cmdline *cmdline,
struct sss_tool_ctx *tool_ctx,
void *pvt)
Expand Down

0 comments on commit 3436469

Please sign in to comment.