about summary refs log tree commit diff
path: root/nscd/connections.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-01-16 01:27:56 +0000
committerUlrich Drepper <drepper@redhat.com>2007-01-16 01:27:56 +0000
commit000b027e7c0866334321e92034a5a807cd437c7c (patch)
treea2fcf0e917c828aa340e88c18ac2cb7acd248e72 /nscd/connections.c
parent1bd790257692a51a20c2a03a6abc4e8cc082b39a (diff)
downloadglibc-000b027e7c0866334321e92034a5a807cd437c7c.tar.gz
glibc-000b027e7c0866334321e92034a5a807cd437c7c.tar.xz
glibc-000b027e7c0866334321e92034a5a807cd437c7c.zip
* nscd/connections.c (servinfo): Renamed to reqinfo. Change all
	users.
	(handle_request): Remove unnecessary tests.
Diffstat (limited to 'nscd/connections.c')
-rw-r--r--nscd/connections.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/nscd/connections.c b/nscd/connections.c
index a577568b12..03a75f9765 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -185,7 +185,7 @@ static struct
 {
   bool data_request;
   struct database_dyn *db;
-} const servinfo[LASTREQ] =
+} const reqinfo[LASTREQ] =
 {
   [GETPWBYNAME] = { true, &dbs[pwddb] },
   [GETPWBYUID] = { true, &dbs[pwddb] },
@@ -392,7 +392,7 @@ verify_persistent_db (void *mem, struct database_pers_head *readhead, int dbnr)
 
 	  /* Make sure the record is for this type of service.  */
 	  if (here->type >= LASTREQ
-	      || servinfo[here->type].db != &dbs[dbnr])
+	      || reqinfo[here->type].db != &dbs[dbnr])
 	    goto fail;
 
 	  /* Validate boolean field value.  */
@@ -940,19 +940,14 @@ cannot handle old request version %d; current version is %d"),
       return;
     }
 
-  /* Make the SELinux check before we go on to the standard checks.  We
-     need to verify that the request type is valid, since it has not
-     yet been checked at this point.  */
-  if (selinux_enabled
-      && __builtin_expect (req->type >= GETPWBYNAME, 1)
-      && __builtin_expect (req->type < LASTREQ, 1)
-      && nscd_request_avc_has_perm (fd, req->type) != 0)
+  /* Make the SELinux check before we go on to the standard checks.  */
+  if (selinux_enabled && nscd_request_avc_has_perm (fd, req->type) != 0)
     return;
 
-  struct database_dyn *db = servinfo[req->type].db;
+  struct database_dyn *db = reqinfo[req->type].db;
 
   /* See whether we can service the request from the cache.  */
-  if (__builtin_expect (servinfo[req->type].data_request, true))
+  if (__builtin_expect (reqinfo[req->type].data_request, true))
     {
       if (__builtin_expect (debug_level, 0) > 0)
 	{
@@ -1151,7 +1146,7 @@ cannot handle old request version %d; current version is %d"),
     case GETFDHST:
     case GETFDSERV:
 #ifdef SCM_RIGHTS
-      send_ro_fd (servinfo[req->type].db, key, fd);
+      send_ro_fd (reqinfo[req->type].db, key, fd);
 #endif
       break;