nsswitch: Move nss_err_str to its only caller
[ira/wip.git] / nsswitch / winbind_nss_linux.c
index 2b51a8e15dbf6de4c7d848b745c53ab189e173f3..7b1675204342e55d665bf619985ff79f6b86b8c1 100644 (file)
@@ -71,6 +71,31 @@ NSS_STATUS _nss_winbind_uidtosid(uid_t uid, char **sid, char *buffer,
 NSS_STATUS _nss_winbind_gidtosid(gid_t gid, char **sid, char *buffer,
                                 size_t buflen, int *errnop);
 
+/*************************************************************************
+ ************************************************************************/
+
+#ifdef DEBUG_NSS
+static const char *nss_err_str(NSS_STATUS ret)
+{
+       switch (ret) {
+               case NSS_STATUS_TRYAGAIN:
+                       return "NSS_STATUS_TRYAGAIN";
+               case NSS_STATUS_SUCCESS:
+                       return "NSS_STATUS_SUCCESS";
+               case NSS_STATUS_NOTFOUND:
+                       return "NSS_STATUS_NOTFOUND";
+               case NSS_STATUS_UNAVAIL:
+                       return "NSS_STATUS_UNAVAIL";
+#ifdef NSS_STATUS_RETURN
+               case NSS_STATUS_RETURN:
+                       return "NSS_STATUS_RETURN";
+#endif
+               default:
+                       return "UNKNOWN RETURN CODE!!!!!!!";
+       }
+}
+#endif
+
 /* Prototypes from wb_common.c */
 
 /* Allocate some space from the nss static buffer.  The buffer and buflen
@@ -105,8 +130,8 @@ static bool next_token_alloc(const char **ptr,
                                 char **pp_buff,
                                 const char *sep)
 {
-       char *s;
-       char *saved_s;
+       const char *s;
+       const char *saved_s;
        char *pbuf;
        bool quoted;
        size_t len=1;
@@ -116,7 +141,7 @@ static bool next_token_alloc(const char **ptr,
                return(false);
        }
 
-       s = (char *)*ptr;
+       s = *ptr;
 
        /* default to simple separators */
        if (!sep) {