[SSSD] [PATCH] Removing unused header file providers.h

Lukas Slebodnik lslebodn at redhat.com
Tue Mar 12 13:23:59 UTC 2013


On (12/03/13 09:01), Simo Sorce wrote:
>On Tue, 2013-03-12 at 12:13 +0100, Sumit Bose wrote:
>> On Tue, Mar 12, 2013 at 10:57:38AM +0100, Lukas Slebodnik wrote:
>> > Hi,
>> > 
>> > I found two header files, which are not included in any other file
>> > src/providers/providers.h and src/sss_client/protos.h
>> > First one is removed in attached patch and second one was commented
>> > with "#if 0" more then four years ago. But I am not sure it should be
>> > removed (is it documentation?), therefore is not removed in attached patch.
>> > 
>> > LS
>> 
>> I guess protos.h can be removed as well. Looks like it was used to
>> track which nss-calls are still not implemented. But it is out of date,
>> e.g. netgroups and services are already implemented and using
>> src/sss_client/sss_nss.exports for this makes more sense.
>> 
>> Simo, do you see a reason to keep protos.h?
>
>Unused code is broken code, feel free to remove.
>
>Simo.
>
>-- 
>Simo Sorce * Red Hat, Inc * New York

Ok.

I am attaching patch, where both files are removed.

LS
-------------- next part --------------
>From f7bbbc2307c7e2eb65a30e4ef3c70277ab236621 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Mon, 11 Mar 2013 19:35:26 +0100
Subject: [PATCH] Removing unused header file providers.h

Header file "providers.h" is not included in any other
file and function "dp_process_init" declared in this header file
has no implementation.

Header file protos.h is not also included in any other file and even
hole content is commented out.
---
 Makefile.am               |   1 -
 src/providers/providers.h |  24 --------
 src/sss_client/protos.h   | 151 ----------------------------------------------
 3 files changed, 176 deletions(-)
 delete mode 100644 src/providers/providers.h
 delete mode 100644 src/sss_client/protos.h

diff --git a/Makefile.am b/Makefile.am
index 67e2bd1fb368e4472d5f6f816033ec7d81fc75d8..5c5d75bf9363e749779e5c692e9bb35af5daffb4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -421,7 +421,6 @@ dist_noinst_HEADERS = \
     src/providers/data_provider.h \
     src/providers/dp_backend.h \
     src/providers/fail_over.h \
-    src/providers/providers.h \
     src/util/child_common.h \
     src/providers/simple/simple_access.h \
     src/providers/krb5/krb5_auth.h \
diff --git a/src/providers/providers.h b/src/providers/providers.h
deleted file mode 100644
index 44e7028ab96e440bbb8f156c39eba535db1d876e..0000000000000000000000000000000000000000
--- a/src/providers/providers.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-   SSSD
-
-   Data Provider, public header file
-
-   Copyright (C) Simo Sorce <ssorce at redhat.com>	2008
-
-   This program is free software; you can redistribute it and/or modify
-   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/>.
-*/
-
-int dp_process_init(TALLOC_CTX *mem_ctx,
-                    struct tevent_context *ev,
-                    struct confdb_ctx *cdb);
diff --git a/src/sss_client/protos.h b/src/sss_client/protos.h
deleted file mode 100644
index 1c11ae6581d89646f8e9de15e934111dbdfaf818..0000000000000000000000000000000000000000
--- a/src/sss_client/protos.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
-   SSSD
-
-   Client Interface for NSS and PAM.
-
-   Authors:
-        Simo Sorce <ssorce at redhat.com>
-
-   Copyright (C) Red Hat, Inc 2007
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#if 0
-/* SHADOW database NSS interface */
-enum nss_status _nss_sss_getspnam_r(const char *name, struct spwd *result,
-				    char *buffer, size_t buflen, int *errnop);
-enum nss_status _nss_sss_setspent(void);
-enum nss_status _nss_sss_getspent_r(struct spwd *result,
-				    char *buffer, size_t buflen, int *errnop);
-enum nss_status _nss_sss_endspent(void);
-
-
-/* HOSTS database NSS interface */
-enum nss_status _nss_sss_gethostbyname_r(const char *name,
-					 struct hostent *result,
-					 char *buffer, size_t buflen,
-					 int *errnop, int *h_errnop);
-enum nss_status _nss_sss_gethostbyname2_r(const char *name, int af,
-					  struct hostent *result,
-					  char *buffer, size_t buflen,
-					  int *errnop, int *h_errnop);
-enum nss_status _nss_sss_gethostbyaddr_r(const void *addr, socklen_t len,
-					 int af, struct hostent *result,
-					 char *buffer, size_t buflen,
-					 int *errnop, int *h_errnop);
-enum nss_status _nss_sss_sethostent(void);
-enum nss_status _nss_sss_gethostent_r(struct hostent *result,
-				      char *buffer, size_t buflen,
-				      int *errnop, int *h_errnop);
-enum nss_status _nss_sss_endhostent(void);
-
-/* NETGROUP database NSS interface */
-enum nss_status _nss_sss_setnetgrent(const char *netgroup,
-				     struct __netgrent *result);
-enum nss_status _nss_sss_getnetgrent_r(struct __netgrent *result,
-				       char *buffer, size_t buflen,
-				       int *errnop);
-enum nss_status _nss_ldap_endnetgrent(void);
-/* too bad innetgr is currently implemented as an iteration over
- * {set|get|end}netgroup ... */
-
-/* NETWORKS database NSS interface */
-enum nss_status _nss_sss_getnetbyname_r(const char *name,
-					struct netent *result,
-					char *buffer, size_t buflen,
-					int *errnop, int *h_errnop);
-enum nss_status _nss_sss_getnetbyaddr_r(uint32_t addr, int af,
-					struct netent *result,
-					char *buffer, size_t buflen,
-					int *errnop, int *h_errnop);
-enum nss_status _nss_sss_setnetent(void);
-enum nss_status _nss_sss_getnetent_r(struct netent *result,
-				     char *buffer, size_t buflen,
-				     int *errnop, int *h_errnop);
-enum nss_status _nss_sss_endnetent(void);
-
-
-/* PROTOCOLS database NSS interface */
-enum nss_status _nss_sss_getprotobyname_r(const char *name,
-					  struct protoent *result,
-					  char *buffer, size_t buflen,
-					  int *errnop);
-enum nss_status _nss_sss_getprotobynumber_r(int number,
-					    struct protoent *result,
-					    char *buffer, size_t buflen,
-					    int *errnop);
-enum nss_status _nss_sss_setprotoent(void);
-enum nss_status _nss_sss_getprotoent_r(struct protoent *result,
-				       char *buffer, size_t buflen,
-				       int *errnop);
-enum nss_status _nss_sss_endprotoent(void);
-
-/* SERVICES database NSS interface */
-enum nss_status _nss_sss_getservbyname_r(const char *name,
-					 const char *protocol,
-					 struct servent *result,
-					 char *buffer, size_t buflen,
-					 int *errnop);
-enum nss_status _nss_sss_getservbyport_r(int port, const char *protocol,
-					 struct servent *result,
-					 char *buffer, size_t buflen,
-					 int *errnop);
-enum nss_status _nss_sss_setservent(void);
-enum nss_status _nss_sss_getservent_r(struct servent *result,
-				      char *buffer, size_t buflen,
-				      int *errnop);
-enum nss_status _nss_sss_endservent(void);
-
-/* ALIASES database NSS interface */
-enum nss_status _nss_sss_getaliasbyname_r(const char *name,
-					  struct aliasent *result,
-					  char *buffer, size_t buflen,
-					  int *errnop);
-enum nss_status _nss_sss_setaliasent(void);
-enum nss_status _nss_sss_getaliasent_r(struct aliasent *result,
-				       char *buffer, size_t buflen,
-				       int *errnop);
-enum nss_status _nss_sss_endaliasent(void);
-
-/* ETHERS database NSS interface */
-enum nss_status _nss_sss_gethostton_r(const char *name,
-				      struct etherent *result,
-				      char *buffer, size_t buflen,
-				      int *errnop);
-enum nss_status _nss_sss_getntohost_r(const struct ether_addr *addr,
-				      struct etherent *result,
-				      char *buffer, size_t buflen,
-				      int *errnop);
-enum nss_status _nss_sss_setetherent(void);
-enum nss_status _nss_sss_getetherent_r(struct etherent *result,
-				       char *buffer, size_t buflen,
-				       int *errnop);
-enum nss_status _nss_sss_endetherent(void);
-
-/* RPC database NSS interface */
-enum nss_status _nss_sss_getrpcbyname_r(const char *name,
-					struct rpcent *result,
-					char *buffer, size_t buflen,
-					int *errnop);
-enum nss_status _nss_sss_getrpcbynumber_r(int number, struct rpcent *result,
-					  char *buffer, size_t buflen,
-					  int *errnop);
-enum nss_status _nss_sss_setrpcent(void);
-enum nss_status _nss_sss_getrpcent_r(struct rpcent *result,
-				     char *buffer, size_t buflen,
-				     int *errnop);
-enum nss_status _nss_sss_endrpcent(void);
-
-#endif
-- 
1.8.1.4



More information about the sssd-devel mailing list