LCOV - code coverage report
Current view: top level - util - sss_cli_cmd.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 48 0.0 %
Date: 2016-06-29 Functions: 0 1 0.0 %

          Line data    Source code
       1             : /*
       2             :    SSSD - cmd2str util
       3             : 
       4             :    Copyright (C) Petr Cech <pcech@redhat.com> 2015
       5             : 
       6             :    This program is free software; you can redistribute it and/or modify
       7             :    it under the terms of the GNU General Public License as published by
       8             :    the Free Software Foundation; either version 3 of the License, or
       9             :    (at your option) any later version.
      10             : 
      11             :    This program is distributed in the hope that it will be useful,
      12             :    but WITHOUT ANY WARRANTY; without even the implied warranty of
      13             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14             :    GNU General Public License for more details.
      15             : 
      16             :    You should have received a copy of the GNU General Public License
      17             :    along with this program.  If not, see <http://www.gnu.org/licenses/>.
      18             : */
      19             : 
      20             : #include "sss_client/sss_cli.h"
      21             : #include "util/sss_cli_cmd.h"
      22             : #include "util/util.h"
      23             : 
      24           0 : const char *sss_cmd2str(enum sss_cli_command cmd)
      25             : {
      26           0 :     switch (cmd) {
      27             :     /* null */
      28             :     case SSS_CLI_NULL:
      29           0 :         return "SSS_CLI_NULL";
      30             : 
      31             :     /* version */
      32             :     case SSS_GET_VERSION:
      33           0 :         return "SSS_GET_VERSION";
      34             : 
      35             :     /* passwd */
      36             :     case SSS_NSS_GETPWNAM:
      37           0 :         return "SSS_NSS_GETPWNAM";
      38             :     case SSS_NSS_GETPWUID:
      39           0 :         return "SSS_NSS_GETPWUID";
      40             :     case SSS_NSS_SETPWENT:
      41           0 :         return "SSS_NSS_SETPWENT";
      42             :     case SSS_NSS_GETPWENT:
      43           0 :         return "SSS_NSS_GETPWENT";
      44             :     case SSS_NSS_ENDPWENT:
      45           0 :         return "SSS_NSS_ENDPWENT";
      46             : 
      47             :     /* group */
      48             :     case SSS_NSS_GETGRNAM:
      49           0 :         return "SSS_NSS_GETGRNAM";
      50             :     case SSS_NSS_GETGRGID:
      51           0 :         return "SSS_NSS_GETGRGID";
      52             :     case SSS_NSS_SETGRENT:
      53           0 :         return "SSS_NSS_SETGRENT";
      54             :     case SSS_NSS_GETGRENT:
      55           0 :         return "SSS_NSS_GETGRENT";
      56             :     case SSS_NSS_ENDGRENT:
      57           0 :         return "SSS_NSS_ENDGRENT";
      58             :     case SSS_NSS_INITGR:
      59           0 :         return "SSS_NSS_INITGR";
      60             : 
      61             : #if 0
      62             :     /* aliases */
      63             :     case SSS_NSS_GETALIASBYNAME:
      64             :         return "SSS_NSS_GETALIASBYNAME";
      65             :     case SSS_NSS_GETALIASBYPORT:
      66             :         return "SSS_NSS_GETALIASBYPORT";
      67             :     case SSS_NSS_SETALIASENT:
      68             :         return "SSS_NSS_SETALIASENT";
      69             :     case SSS_NSS_GETALIASENT:
      70             :         return "SSS_NSS_GETALIASENT";
      71             :     case SSS_NSS_ENDALIASENT:
      72             :         return "SSS_NSS_ENDALIASENT";
      73             : 
      74             :     /* ethers */
      75             :     case SSS_NSS_GETHOSTTON:
      76             :         return "SSS_NSS_GETHOSTTON";
      77             :     case SSS_NSS_GETNTOHOST:
      78             :         return "SSS_NSS_GETNTOHOST";
      79             :     case SSS_NSS_SETETHERENT:
      80             :         return "SSS_NSS_SETETHERENT";
      81             :     case SSS_NSS_GETETHERENT:
      82             :         return "SSS_NSS_GETETHERENT";
      83             :     case SSS_NSS_ENDETHERENT:
      84             :         return "SSS_NSS_ENDETHERENT";
      85             : 
      86             :     /* hosts */
      87             :     case SSS_NSS_GETHOSTBYNAME:
      88             :         return "SSS_NSS_GETHOSTBYNAME";
      89             :     case SSS_NSS_GETHOSTBYNAME2:
      90             :         return "SSS_NSS_GETHOSTBYNAME2";
      91             :     case SSS_NSS_GETHOSTBYADDR:
      92             :         return "SSS_NSS_GETHOSTBYADDR";
      93             :     case SSS_NSS_SETHOSTENT:
      94             :         return "SSS_NSS_SETHOSTENT";
      95             :     case SSS_NSS_GETHOSTENT:
      96             :         return "SSS_NSS_GETHOSTENT";
      97             :     case SSS_NSS_ENDHOSTENT:
      98             :         return "SSS_NSS_ENDHOSTENT";
      99             : #endif
     100             : 
     101             :     /* netgroup */
     102             :     case SSS_NSS_SETNETGRENT:
     103           0 :         return "SSS_NSS_SETNETGRENT";
     104             :     case SSS_NSS_GETNETGRENT:
     105           0 :         return "SSS_NSS_GETNETGRENT";
     106             :     case SSS_NSS_ENDNETGRENT:
     107           0 :         return "SSS_NSS_ENDNETGRENT";
     108             :     /* SSS_NSS_INNETGR:
     109             :         return "SSS_NSS_INNETGR";
     110             :         break; */
     111             : 
     112             : #if 0
     113             :     /* networks */
     114             :     case SSS_NSS_GETNETBYNAME:
     115             :         return "SSS_NSS_GETNETBYNAME";
     116             :     case SSS_NSS_GETNETBYADDR:
     117             :         return "SSS_NSS_GETNETBYADDR";
     118             :     case SSS_NSS_SETNETENT:
     119             :         return "SSS_NSS_SETNETENT";
     120             :     case SSS_NSS_GETNETENT:
     121             :         return "SSS_NSS_GETNETENT";
     122             :     case SSS_NSS_ENDNETENT:
     123             :         return "SSS_NSS_ENDNETENT";
     124             : 
     125             :     /* protocols */
     126             :     case SSS_NSS_GETPROTOBYNAME:
     127             :         return "SSS_NSS_GETPROTOBYNAME";
     128             :     case SSS_NSS_GETPROTOBYNUM:
     129             :         return "SSS_NSS_GETPROTOBYNUM";
     130             :     case SSS_NSS_SETPROTOENT:
     131             :         return "SSS_NSS_SETPROTOENT";
     132             :     case SSS_NSS_GETPROTOENT:
     133             :         return "SSS_NSS_GETPROTOENT";
     134             :     case SSS_NSS_ENDPROTOENT:
     135             :         return "SSS_NSS_ENDPROTOENT";
     136             : 
     137             :     /* rpc */
     138             :     case SSS_NSS_GETRPCBYNAME:
     139             :         return "SSS_NSS_GETRPCBYNAME";
     140             :     case SSS_NSS_GETRPCBYNUM:
     141             :         return "SSS_NSS_GETRPCBYNUM";
     142             :     case SSS_NSS_SETRPCENT:
     143             :         return "SSS_NSS_SETRPCENT";
     144             :     case SSS_NSS_GETRPCENT:
     145             :         return "SSS_NSS_GETRPCENT";
     146             :     case SSS_NSS_ENDRPCENT:
     147             :         return "SSS_NSS_ENDRPCENT";
     148             : #endif
     149             : 
     150             :     /* services */
     151             :     case SSS_NSS_GETSERVBYNAME:
     152           0 :         return "SSS_NSS_GETSERVBYNAME";
     153             :     case SSS_NSS_GETSERVBYPORT:
     154           0 :         return "SSS_NSS_GETSERVBYPORT";
     155             :     case SSS_NSS_SETSERVENT:
     156           0 :         return "SSS_NSS_SETSERVENT";
     157             :     case SSS_NSS_GETSERVENT:
     158           0 :         return "SSS_NSS_GETSERVENT";
     159             :     case SSS_NSS_ENDSERVENT:
     160           0 :         return "SSS_NSS_ENDSERVENT";
     161             : 
     162             : #if 0
     163             :     /* shadow */
     164             :     case SSS_NSS_GETSPNAM:
     165             :         return "SSS_NSS_GETSPNAM";
     166             :     case SSS_NSS_GETSPUID:
     167             :         return "SSS_NSS_GETSPUID";
     168             :     case SSS_NSS_SETSPENT:
     169             :         return "SSS_NSS_SETSPENT";
     170             :     case SSS_NSS_GETSPENT:
     171             :         return "SSS_NSS_GETSPENT";
     172             :     case SSS_NSS_ENDSPENT:
     173             :         return "SSS_NSS_ENDSPENT";
     174             : #endif
     175             : 
     176             :     /* SUDO */
     177             :     case SSS_SUDO_GET_SUDORULES:
     178           0 :         return "SSS_SUDO_GET_SUDORULES";
     179             :     case SSS_SUDO_GET_DEFAULTS:
     180           0 :         return "SSS_SUDO_GET_DEFAULTS";
     181             : 
     182             :     /* autofs */
     183             :     case SSS_AUTOFS_SETAUTOMNTENT:
     184           0 :         return "SSS_AUTOFS_SETAUTOMNTENT";
     185             :     case SSS_AUTOFS_GETAUTOMNTENT:
     186           0 :         return "SSS_AUTOFS_GETAUTOMNTENT";
     187             :     case SSS_AUTOFS_GETAUTOMNTBYNAME:
     188           0 :         return "SSS_AUTOFS_GETAUTOMNTBYNAME";
     189             :     case SSS_AUTOFS_ENDAUTOMNTENT:
     190           0 :         return "SSS_AUTOFS_ENDAUTOMNTENT";
     191             : 
     192             :     /* SSH */
     193             :     case SSS_SSH_GET_USER_PUBKEYS:
     194           0 :         return "SSS_SSH_GET_USER_PUBKEYS";
     195             :     case SSS_SSH_GET_HOST_PUBKEYS:
     196           0 :         return "SSS_SSH_GET_HOST_PUBKEYS";
     197             : 
     198             :     /* PAM related calls */
     199             :     case SSS_PAM_AUTHENTICATE:
     200           0 :         return "SSS_PAM_AUTHENTICATE";
     201             :     case SSS_PAM_SETCRED:
     202           0 :         return "SSS_PAM_SETCRED";
     203             :     case SSS_PAM_ACCT_MGMT:
     204           0 :         return "SSS_PAM_ACCT_MGMT";
     205             :     case SSS_PAM_OPEN_SESSION:
     206           0 :         return "SSS_PAM_OPEN_SESSION";
     207             :     case SSS_PAM_CLOSE_SESSION:
     208           0 :         return "SSS_PAM_CLOSE_SESSION";
     209             :     case SSS_PAM_CHAUTHTOK:
     210           0 :         return "SSS_PAM_CHAUTHTOK";
     211             :     case SSS_PAM_CHAUTHTOK_PRELIM:
     212           0 :         return "SSS_PAM_CHAUTHTOK_PRELIM";
     213             :     case SSS_CMD_RENEW:
     214           0 :         return "SSS_CMD_RENEW";
     215             :     case SSS_PAM_PREAUTH:
     216           0 :         return "SSS_PAM_PREAUTH";
     217             : 
     218             :     /* PAC responder calls */
     219             :     case SSS_PAC_ADD_PAC_USER:
     220           0 :         return "SSS_PAC_ADD_PAC_USER";
     221             : 
     222             :     /* ID-SID mapping calls */
     223             :     case SSS_NSS_GETSIDBYNAME:
     224           0 :         return "SSS_NSS_GETSIDBYNAME";
     225             :     case SSS_NSS_GETSIDBYID:
     226           0 :         return "SSS_NSS_GETSIDBYID";
     227             :     case SSS_NSS_GETNAMEBYSID:
     228           0 :         return "SSS_NSS_GETNAMEBYSID";
     229             :     case SSS_NSS_GETIDBYSID:
     230           0 :         return "SSS_NSS_GETIDBYSID";
     231             :     case SSS_NSS_GETORIGBYNAME:
     232           0 :         return "SSS_NSS_GETORIGBYNAME";
     233             :     default:
     234           0 :         DEBUG(SSSDBG_MINOR_FAILURE,
     235             :               "Translation's string is missing for command [%#x].\n", cmd);
     236           0 :         return "UNKNOWN COMMAND";
     237             :     }
     238             : }

Generated by: LCOV version 1.10