summaryrefslogtreecommitdiffstats
path: root/src/tools
Commit message (Collapse)AuthorAgeFilesLines
* UTILS: Fixing duplication of pid file declarationPetr Cech2017-01-091-3/+0
| | | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2978 Reviewed-by: Fabiano Fidêncio <fabiano@fidencio.org> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 08cd034c8584b6f058cf565ce66f7f9f7120622f)
* TOOLS: Fix warning Wsign-compareLukas Slebodnik2016-10-171-1/+1
| | | | | | | | | | | src/tools/tools_util.c: In function ‘parse_groups’: src/tools/tools_util.c:116:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] for (i = 0; i < tokens; i++) { ^ Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit d3f14ed93ef61268d0a68898ed9c44b4f773081c)
* TOOLS: Fix warning maybe-uninitializedLukas Slebodnik2016-05-191-0/+1
| | | | | | | | | | | src/tools/files.c: In function ‘copy_file_contents’: src/tools/files.c:413:12: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized] return ret; ^~~ Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit c2e3176eaff7c219d63f328570a79f6e5b6f4aec)
* sss_override: only add domain if name is not fully qualifiedSumit Bose2016-04-131-1/+27
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2989 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit e45096aead1d2e2b8f8b2b386b420c5f62ad07d3)
* tools: read additional data of the master domainSumit Bose2016-04-131-0/+8
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2989 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit 3a8b5ccf7c27b72054e1d8b3ab355cb1e28efda9)
* sss_override: do not generate DN, search objectSumit Bose2016-04-131-7/+27
| | | | | | | | | | | | | DNs of existing objects can not be generate reliable because the use of fully qualified names and upper and lower cases in names has to be considered. The most reliable way to get the DN is to search the object and take the DN from the result. Resolves: https://fedorahosted.org/sssd/ticket/2989 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit e6e2d1575ac7feb3494649f94ef51ef13cbdce48)
* util: Continue if setlocale failsMichal Židek2016-03-031-1/+3
| | | | | | | | | | | | | | setlocale needs some environment variables to be set in order to work. These variables are not present in some special cases. We should not fail completely in these cases but continue with the compatible C locale. Resolves: https://fedorahosted.org/sssd/ticket/2785 Reviewed-by: Michal Židek <mzidek@redhat.com> (cherry picked from commit 43e06ff39584570817949dc5de118d2b7ca854c1)
* TOOLS: Add comments on functions in colondbPetr Cech2016-02-241-0/+23
| | | | | | | | | | | | | | | | | | | The colondb API provides three function: * sss_colondb_open() * sss_colondb_write_field() * sss_colondb_read_field() It is not obvious that sss_colondb_open() add destructor on talloc context which close the colondb during free context. And there is expectation that SSS_COLONDB_SENTINEL is type of last item in line. So this patch adds simple lightening comments in doxygen style. Resolves: https://fedorahosted.org/sssd/ticket/2764 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit cf1109e30320a994187edeb438ac7cdc36f0dd2b)
* TOOLS: Fix memory leak after getline() failedPetr Cech2016-02-241-0/+4
| | | | | | | | | | | | | | | | | | | This patch fixes buffer freeing in case if getline() failed in function sss_colondb_readline(). ssize_t getline(char **lineptr, size_t *n, FILE *stream); If *lineptr is set to NULL and *n is set 0 before the call, then getline() will allocate a buffer for storing the line. This buffer should be freed by the user program even if getline() failed. man 3 getline This patch fix buffer freeing in case if getline() failed. Resolves: https://fedorahosted.org/sssd/ticket/2764 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit 2dd75ea79a57615808754c0ce550786edbc17d69)
* TOOLS: Fix minor memory leak in sss_colondb_writelineLukas Slebodnik2016-02-241-0/+7
| | | | | | | | | | | The variable line was initialized to NULL. The we created temporary context tmp_ctx. We use talloc_asprintf_append to append string to line which is initially NULL and therefore new context which was not connected to tmp_ctx. man 3 talloc_string -> talloc_asprintf_append Reviewed-by: Petr Cech <pcech@redhat.com> (cherry picked from commit 6977d7c84145ac69195be58b3330861b9b8a3b72)
* Fix typos reported by lintianLukas Slebodnik2016-02-231-1/+1
| | | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com> (cherry picked from commit 42604cc8d11743febf5aa892cb3a7d3c32bfed48)
* PYTHON: Fix pep8 errors in sss_obfuscateLukas Slebodnik2016-02-031-5/+8
| | | | | | | | | | | | | src/tools/sss_obfuscate:12:1: E302 expected 2 blank lines, found 1 src/tools/sss_obfuscate:29:80: E501 line too long (111 > 79 characters) src/tools/sss_obfuscate:35:1: E302 expected 2 blank lines, found 1 src/tools/sss_obfuscate:47:80: E501 line too long (107 > 79 characters) src/tools/sss_obfuscate:50:13: E265 block comment should start with '# ' src/tools/sss_obfuscate:58:17: E265 block comment should start with '# ' src/tools/sss_obfuscate:107:5: E303 too many blank lines (2) Reviewed-by: Martin Basti <mbasti@redhat.com> (cherry picked from commit 37ea8e70fa13ff9ba563300fb15de0e5e6185d68)
* PYTHON: sss_obfuscate should work with python3Lukas Slebodnik2016-02-031-11/+13
| | | | | | | | | | Based on patch from: Steven W. Elling <ellingsw+29044@gmail.com> Resolves: https://fedorahosted.org/sssd/ticket/2937 Reviewed-by: Martin Basti <mbasti@redhat.com> (cherry picked from commit 11496692da75a330de01d5f15b7183d2439efd3c)
* DEBUG: Add missing new linesLukas Slebodnik2015-12-141-1/+1
| | | | Reviewed-by: Petr Cech <pcech@redhat.com>
* tools: Don't shadow 'exit'Jakub Hrozek2015-11-111-18/+18
| | | | | | | | | | | | | Fixes: /sssd/src/tools/sss_override.c: In function ‘override_user_import’: /sssd/src/tools/sss_override.c:1471: warning: declaration of ‘exit’ shadows a global declaration /usr/include/stdlib.h:544: warning: shadowed declaration is here /sssd/src/tools/sss_override.c: In function ‘override_group_import’: /sssd/src/tools/sss_override.c:1737: warning: declaration of ‘exit’ shadows a global declaration /usr/include/stdlib.h:544: warning: shadowed declaration is here Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> (cherry picked from commit 3b9a62badec2478f978ac28d2e3b72a7dd16a6e5)
* sss_tools: do not allow unexpected free argumentPavel Březina2015-10-301-2/+11
| | | | | Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit 4940ba14100ad11b0ed1f2a8a4fea5daa34d56ee)
* sss_override: use more generic help textPavel Březina2015-10-301-2/+1
| | | | | Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit c8432ffd4cf29fe209b086ef69eacc9683dc5866)
* sss_override: do not free ldb_dn in get_object_dn()Pavel Březina2015-10-301-9/+29
| | | | | | | | When only str_dn is requested, ldb_dn is freed. This triggers access after free since str_dn is part of ldb_dn talloc context. Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit 2341c8ccfe6225ee4ac5904c177a9200ba617a04)
* sss_override: add group-showPavel Březina2015-10-301-6/+91
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2736 Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit 55345aa1aaf1df23e5dfe8d584663f9fe6c4aeb9)
* sss_override: add user-showPavel Březina2015-10-301-8/+105
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2736 Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit 53d05f6a88b52b8f7acc15a803c1ef439fa30244)
* sss_override: add group-findPavel Březina2015-10-301-49/+101
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2736 Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit 6d0a69431a87a24dac04a9d77fbda5a6e24ac0dd)
* sss_override: add user-findPavel Březina2015-10-301-53/+141
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2736 Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit 1b45fed9f629d47fefc3feaba01810ca2200fed3)
* sss_override: fix exporting multiple domainsPavel Březina2015-10-301-2/+2
| | | | | | | | There was a mistake in the code which resulted in exporting one domain several times if multiple domain were configured. Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit 20222362cf9557e0e053e5e5f3b6f07899c7bfe7)
* sss_tools: always show common and help optionsPavel Březina2015-10-301-1/+14
| | | | | | | | popt don't handle merging NULL option table, thus common and help options were not displayed when command doesn't have any options. Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit 16065cc731687eb8779d31b79436bbf79c5e3ed3)
* util: Update get_next_domain's interfaceMichal Židek2015-10-304-8/+11
| | | | | | | | | | | | | Update get next domain to be able to include disbled domains and change the interface to accept flags instead of multiple booleans. Ticket: https://fedorahosted.org/sssd/ticket/2673 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> (cherry picked from commit 877b92e80bde510d5cd9f03dbf01e2bcf73ab072)
* sss_override: steal msgs string to objsPavel Březina2015-10-081-0/+9
| | | | | | | | | | | Since msgs is attached to tmp_ctx then all the strings are freed with tmp_ctx. Now steal the strings to objs. Resolves: https://fedorahosted.org/sssd/ticket/2826 Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit 3119225929463aecfbb1a7fc953263736955271e)
* sss_override: explicitly set ret = EOKPavel Březina2015-10-081-0/+2
| | | | | Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit 220a4cbb7fcf30d954b2b4fecd62887373aa8764)
* sss_override: fix comment describing formatPavel Březina2015-10-081-1/+1
| | | | | Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit 1bf0ada00f59c153fe00853394508021d0ff9b24)
* sss tools: improve option handlingPavel Březina2015-10-022-20/+30
| | | | | | | | | | | | | The crash describe by ticket #2802 is caused by providing NULL options in popt and yet trying to iterate over them. Instead of simply testing for NULL this patch creates a new option table table merges several option tables together, thus improving and simplifying usage string. Resolves: https://fedorahosted.org/sssd/ticket/2802 Reviewed-by: Pavel Reichl <preichl@redhat.com> (cherry picked from commit bda8039465a0084fb380e878c8f9ea3e900505ea)
* sss_override: support fqn in override namePavel Březina2015-09-161-18/+93
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2782 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* UTIL: Function 2string for enum sss_cli_commandPetr Cech2015-08-311-1/+3
| | | | | | | | | | | | Improvement of debug messages. Instead of:"(0x0400): Running command [17]..." We could see:"(0x0400): Running command [17][SSS_NSS_GETPWNAM]..." (It's not used in sss_client. There are only hex numbers of commands.) Resolves: https://fedorahosted.org/sssd/ticket/2708 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* sss_override: document --debug optionsPavel Březina2015-08-311-4/+21
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2758 Reviewed-by: Petr Cech <pcech@redhat.com>
* sss_override: support import and exportPavel Březina2015-08-201-3/+585
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2737 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sss_override: decompose code betterPavel Březina2015-08-201-109/+181
| | | | | | | Preparation for: https://fedorahosted.org/sssd/ticket/2737 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TOOLS: add sss_colondb APIPavel Březina2015-08-202-0/+378
| | | | | | To simplify import/export users and groups. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sss_override: support domains that require fqnamePavel Březina2015-08-201-2/+57
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2757 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sss_override: print input name if unable to parse itPavel Březina2015-08-201-1/+1
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sss_cache: Wait a while for invalidation of mc by nss responderLukas Slebodnik2015-08-131-0/+34
| | | | | | | | | | | | | | | | The sss_cache cannot invalidate memory cache directly because the nss responder owns file locks to memory caches. Therefore sss_cache just "tell" nss responder to invalidate memory cache. However there might be short interval between calling the utility sss_cache and stopping sssd. So nss responder needn't be so fast and therefore memory cache needn't be invalidated. Resolves: https://fedorahosted.org/sssd/ticket/2748 Reviewed-by: Michal Židek <mzidek@redhat.com>
* TOOLS: add sss_override for local overridesPavel Březina2015-07-271-0/+718
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2584 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TOOLS: add common command frameworkPavel Březina2015-07-272-0/+497
| | | | | | | | | | Add general framework to simplify creating "cmd COMMAND [OPTIONS...]" style tools. Preparation for: https://fedorahosted.org/sssd/ticket/2584 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sss_cache: Clear also initgroups fast cacheLukas Slebodnik2015-07-031-0/+10
| | | | Reviewed-by: Michal Židek <mzidek@redhat.com>
* Add missing new lines to debug messagesLukas Slebodnik2015-03-172-7/+7
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sysdb: use sysdb_user/group_dnPavel Březina2015-03-091-6/+2
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Remove strict requirements of python2Lukas Slebodnik2015-02-131-1/+1
| | | | | | | | | | * fix hashbangs * remove strict requirements of python2 in build system Resolves: https://fedorahosted.org/sssd/ticket/2017 Reviewed-by: Petr Viktorin <pviktori@redhat.com>
* add missing '\n' in debug messagesPavel Reichl2015-01-271-4/+5
| | | | | | Also reformat debug strings not to exceed 80 columns long lines. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* sss_atomic_write_s() return value is signedJakub Hrozek2014-12-032-6/+5
| | | | Reviewed-by: Sumit Bose <sbose@redhat.com>
* TOOLS: sss_debuglevel should worh with ifp responderLukas Slebodnik2014-12-021-1/+2
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sss_semanage: Add mlsrange parameter to set_seuserMichal Zidek2014-10-202-2/+2
| | | | | | | mlsrange parameter will be needed in IPA provider and probably at some point in the tools as well. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* util: Move semanage related functions to src/utilMichal Zidek2014-10-202-336/+0
| | | | | | These functions will be reused by IPA provider. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TOOLS: Fix warning Value stored to is never readLukas Slebodnik2014-10-121-2/+0
| | | | | | | dinfo->sysdb was stored to variable sysdb two times. The first time on line 132 and second time after testing for subdomain on line 143. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>