]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nis/nis_print.c
Fix unbound stack use in NIS NSS module
[thirdparty/glibc.git] / nis / nis_print.c
index ab5f6838bdd0e49063b1562239f5642a5d0f361e..1efa0e989a565e0b719b42e798648c082ddae212 100644 (file)
@@ -1,49 +1,52 @@
-/* Copyright (c) 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (c) 1997-2014 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library 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
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include <time.h>
 #include <string.h>
 #include <libintl.h>
+#include <stdint.h>
 
 #include <rpcsvc/nis.h>
 
 static const char *
 nis_nstype2str (const nstype type)
 {
+
+/* Name service names mustn't be translated, only UNKNOWN needs it */
+
   switch (type)
     {
     case NIS:
-      return N_("NIS");
+      return "NIS";
     case SUNYP:
-      return N_("SUNYP");
+      return "SUNYP";
     case IVY:
-      return N_("IVY");
+      return "IVY";
     case DNS:
-      return N_("DNS");
+      return "DNS";
     case X500:
-      return N_("X500");
+      return "X500";
     case DNANS:
-      return N_("DNANS");
+      return "DNANS";
     case XCHS:
-      return N_("XCHS");
+      return "XCHS";
     case CDS:
-      return N_("CDS");
+      return "CDS";
     default:
       return N_("UNKNOWN");
     }
@@ -84,7 +87,7 @@ print_flags (const unsigned int flags)
     }
   else
     {
-      fputs("TEXTUAL DATA", stdout);
+      fputs ("TEXTUAL DATA", stdout);
       if (flags & TA_SEARCHABLE)
        {
          if (flags & TA_CASE)
@@ -153,6 +156,7 @@ nis_print_rights (const unsigned int access)
     }
   fputs (result, stdout);
 }
+libnsl_hidden_def (nis_print_rights)
 
 void
 nis_print_directory (const directory_obj *dir)
@@ -240,6 +244,7 @@ nis_print_directory (const directory_obj *dir)
        }
     }
 }
+libnsl_hidden_def (nis_print_directory)
 
 void
 nis_print_group (const group_obj *obj)
@@ -254,6 +259,7 @@ nis_print_group (const group_obj *obj)
   for (i = 0; i < obj->gr_members.gr_members_len; i++)
     printf ("\t%s\n", obj->gr_members.gr_members_val[i]);
 }
+libnsl_hidden_def (nis_print_group)
 
 void
 nis_print_table (const table_obj *obj)
@@ -276,6 +282,7 @@ nis_print_table (const table_obj *obj)
       fputc ('\n', stdout);
     }
 }
+libnsl_hidden_def (nis_print_table)
 
 void
 nis_print_link (const link_obj *obj)
@@ -283,8 +290,9 @@ nis_print_link (const link_obj *obj)
   fputs (_("Linked Object Type : "), stdout);
   nis_print_objtype (obj->li_rtype);
   printf (_("Linked to : %s\n"), obj->li_name);
-  /* XXX Print the attributs here, if they exists */
+  /* XXX Print the attributes here, if they exists */
 }
+libnsl_hidden_def (nis_print_link)
 
 void
 nis_print_entry (const entry_obj *obj)
@@ -308,6 +316,7 @@ nis_print_entry (const entry_obj *obj)
                obj->en_cols.en_cols_val[i].ec_value.ec_value_val);
     }
 }
+libnsl_hidden_def (nis_print_entry)
 
 void
 nis_print_object (const nis_object * obj)
@@ -353,6 +362,7 @@ nis_print_object (const nis_object * obj)
       break;
     }
 }
+libnsl_hidden_def (nis_print_object)
 
 void
 nis_print_result (const nis_result *res)