summaryrefslogtreecommitdiffstats
path: root/src/tools/sssctl
Commit message (Collapse)AuthorAgeFilesLines
* config-check: Message when sssd.conf is missingMichal Židek2017-04-101-1/+4
| | | | | | | | | | sssctl config-check should print a message for user if no sssd.conf was found. Resolves: https://pagure.io/SSSD/sssd/issue/3330 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* sssctl: integrate pam_test_client into sssctlSumit Bose2017-04-103-0/+295
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* sssctl: Fix warning may be used uninitializedLukas Slebodnik2017-02-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | gcc 7 probably does some new optimisations which might cause few wariables to be uninitialized. src/tools/sssctl/sssctl_cache.c: In function ‘sssctl_print_object’: src/tools/sssctl/sssctl_cache.c:523:13: error: ‘dom’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ret = info[i].attr_fn(tmp_ctx, entry, dom, info[i].attr, &value); ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/tools/sssctl/sssctl_cache.c:472:15: error: ‘entry’ may be used uninitialized in this function [-Werror=maybe-uninitialized] *_entry = talloc_steal(mem_ctx, entry); ^~~~~~~~~~~~ src/tools/sssctl/sssctl_cache.c:437:25: note: ‘entry’ was declared here struct sysdb_attrs *entry; ^~~~~ Another workaround would be to remove static modifier from function sssctl_find_object which probably prevents some inlinig + optimisation. Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* sssctl: Case insensitive filtersMichal Židek2016-12-151-0/+8
| | | | | | | | | Lowercase the filter in case insensitive domains. Resolves: https://fedorahosted.org/sssd/ticket/3235 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sssctl: Search by aliasMichal Židek2016-12-151-2/+4
| | | | | | | | | Also search by alias when using sssctl to query the cache. Resolves: https://fedorahosted.org/sssd/ticket/3235 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sssctl: Fix missing declarationLukas Slebodnik2016-11-251-0/+1
| | | | | | | | | | | | | | | | | | | | The WEXITSTATUS is defined in stdlib.h on linux. There is a nice comment in stdlib.h: /* Define the macros <sys/wait.h> also would define this way. */ It's better to not rely on this and use more platfom friendly way with including "sys/wait.h". For example the libc on FreeBSD does not provide WEXITSTATUS in stdlib.h. I found this macro mentioned only in the manual page for wait(2) and there is mentioned just the "sys/wait.h" and not "stdlib.h" src/tools/sssctl/sssctl.c: In function 'sssctl_run_command': src/tools/sssctl/sssctl.c:110: error: implicit declaration of function 'WEXITSTATUS' gmake[2]: *** [Makefile:22383: src/tools/sssctl/sssctl-sssctl.o] Error 1 Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* sssctl: Flags for command initializationMichal Židek2016-10-271-1/+1
| | | | | | | | | | | Allow passing flags for command specific initialization. Currently only one flag is available to skip the confdb initialization which is required to improve config-check command. Resolves: https://fedorahosted.org/sssd/ticket/3209 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* sssctl: Fix a typo in preprocessor macroJakub Hrozek2016-10-141-1/+1
| | | | Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* sssctl: call service with absolute pathPavel Březina2016-10-111-3/+3
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sssctl: use systemd D-Bus APIPavel Březina2016-10-113-10/+153
| | | | | | | | | If systemd is used we leverage it's D-Bus API instead of running systemctl. Resolves: https://fedorahosted.org/sssd/ticket/3056 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SSSCTL: More helpful error message when InfoPipe is disabledJustin Stephenson2016-08-181-1/+3
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/3130 Reviewed-by: Petr Čech <pcech@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* sssctl: print active server and server listPavel Březina2016-08-161-7/+175
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/3069 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sssctl: use talloc with sifpPavel Březina2016-08-163-34/+88
| | | | | | | | This way we completely move D-Bus memory management to talloc and we reduce number of code lines needed to send and receive reply. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sbus: add utility function to simplify message and reply handlingPavel Březina2016-08-161-25/+7
| | | | | | | | | | | This patch adds the ability to hook DBusMessage to a talloc context to remove the need of calling dbus_message_unref(). It also provides an automatical way to detect error in a reply so the caller does not need to parse it manually and the whole code around DBusError can be avoided. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sssctl: use internal API to remove filesPavel Březina2016-08-092-5/+4
| | | | Reviewed-by: Petr Cech <pcech@redhat.com>
* sssctl: Generic help for cache-upgrade and config-checkMichal Židek2016-08-092-0/+12
| | | | | | | | | | | sssctl COMMAND --help should print at least generic help, even if the command does not accept any command specific options. Resolves: https://fedorahosted.org/sssd/ticket/3086 Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* sssctl: Consistent commands namingMichal Židek2016-08-056-55/+54
| | | | | | | | | | | Use TOPIC-ACTION pattern for sssctl command names. Resolves: https://fedorahosted.org/sssd/ticket/3087 Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* sssctl: Use localtime for time stampsFabiano Fidêncio2016-07-181-1/+1
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/3096 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* sssctl: improve readability of a conditionPavel Březina2016-07-131-4/+4
| | | | Reviewed-by: Fabiano Fidêncio <fabiano@fidencio.org>
* sssctl: move filter creation to separate functionPavel Březina2016-07-131-35/+46
| | | | Reviewed-by: Fabiano Fidêncio <fabiano@fidencio.org>
* sssctl: Fix warning maybe-uninitializedLukas Slebodnik2016-07-121-5/+9
| | | | | | | | | | | | | | | | | | | | | It looks like some special gcc optimalisation and special case may cause to have unitialized output argument _dom when return code is EOK src/tools/sssctl/sssctl_cache.c: In function ‘sssctl_print_object’: src/tools/sssctl/sssctl_cache.c:491:8: error: ‘dom’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (dom == NULL) { ^ src/tools/sssctl/sssctl_cache.c:447:15: error: ‘entry’ may be used uninitialized in this function [-Werror=maybe-uninitialized] *_entry = talloc_steal(mem_ctx, entry); ^~~~~~~~~~~~ src/tools/sssctl/sssctl_cache.c:412:25: note: ‘entry’ was declared here struct sysdb_attrs *entry; ^~~~~ Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sssctl: Fix format string for size_tLukas Slebodnik2016-07-121-1/+1
| | | | | | | | | | | | | src/tools/sssctl/sssctl_config.c: In function 'sssctl_config_check': src/tools/sssctl/sssctl_config.c:93:14: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'size_t {aka unsigned int}' [-Wformat=] printf(_("Issues identified by validators: %lu\n"), num_errors); ^ src/tools/sssctl/sssctl_config.c:93:12: note: in expansion of macro '_' printf(_("Issues identified by validators: %lu\n"), num_errors); ^ Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sssctl: config-check access check reportMichal Židek2016-07-111-1/+2
| | | | | | | Improve output when access check error is detected by sssctl config-check command. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* sssctl: Fix error handling after memory allocation failureLukas Slebodnik2016-07-111-1/+2
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* sssctl: Add config-check commandMichal Židek2016-07-073-0/+144
| | | | | | | | | | | Fixes: https://fedorahosted.org/sssd/ticket/2269 sssctl sconfig-check command allows to call SSSD config file validators on demand. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TOOLS: Add the upgrade-cache commandJakub Hrozek2016-07-073-0/+35
| | | | | | | Allows to upgrade the cache using the sssctl tool, which might be useful e.g. in RPM %post scripts. Reviewed-by: Sumit Bose <sbose@redhat.com>
* TOOLS: Some tools command might not need initialization to succeedJakub Hrozek2016-07-071-11/+11
| | | | | | | | | | | | Since we want to use the sssctl tool during upgrade, we need to amend the tools initialization code to not error out if sysdb can't be instantiated, but rather return errno and let the tool handle the error. Each tool command now has a 'allowed errno' the command is able to handle. In this patch iteration, only a single errno can be handled and only the upgrade command is able to do so. Reviewed-by: Sumit Bose <sbose@redhat.com>
* TOOLS: sssctl: Work with trusted usersJakub Hrozek2016-07-071-22/+115
| | | | | | | | | For users and groups, convert the input name to the qualified format. Resolves: https://fedorahosted.org/sssd/ticket/3059 Reviewed-by: Sumit Bose <sbose@redhat.com>
* sssctl: remove also ccachePavel Březina2016-07-061-1/+1
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sssctl: restart SSSD when removing cachePavel Březina2016-07-061-21/+40
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/3066 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sssctl: new toolPavel Březina2016-06-277-0/+1633
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>