]> sourceware.org Git - glibc.git/commitdiff
* nis/ypclnt.c (__xdr_ypresp_all): Minor optimization in string
authorUlrich Drepper <drepper@redhat.com>
Fri, 28 Apr 2006 17:01:50 +0000 (17:01 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 28 Apr 2006 17:01:50 +0000 (17:01 +0000)
handling.  Fix typo in comment.

ChangeLog
nis/ypclnt.c
nscd/connections.c

index ea5e1ab5dd5ef2433935de64193dc995b6bcd9fa..b5b975e6a9f097202cc0284141453514b136dbb2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-28  Ulrich Drepper  <drepper@redhat.com>
+
+       * nis/ypclnt.c (__xdr_ypresp_all): Minor optimization in string
+       handling.  Fix typo in comment.
+
 2006-04-27  Ulrich Drepper  <drepper@redhat.com>
 
        * nscd/connections.c (restart): If we want to switch back to the
index 65bc8d1f503e64aa9c4c08c2b38e6c1840c75bbe..ae04ee9212293b7b12f40345f40da0dd4e0ceb3f 100644 (file)
@@ -686,10 +686,10 @@ __xdr_ypresp_all (XDR *xdrs, struct ypresp_all_data *objp)
               if we don't modify the length. So add an extra NUL
               character to avoid trouble with broken code. */
            objp->status = YP_TRUE;
-           memcpy (key, resp.ypresp_all_u.val.key.keydat_val, keylen);
-           key[keylen] = '\0';
-           memcpy (val, resp.ypresp_all_u.val.val.valdat_val, vallen);
-           val[vallen] = '\0';
+           *((char *) __mempcpy (key, resp.ypresp_all_u.val.key.keydat_val,
+                                 keylen)) = '\0';
+           *((char *) __mempcpy (val, resp.ypresp_all_u.val.val.valdat_val,
+                                 vallen)) = '\0';
            xdr_free ((xdrproc_t) xdr_ypresp_all, (char *) &resp);
            if ((*objp->foreach) (objp->status, key, keylen,
                                  val, vallen, objp->data))
@@ -700,7 +700,7 @@ __xdr_ypresp_all (XDR *xdrs, struct ypresp_all_data *objp)
          objp->status = resp.ypresp_all_u.val.stat;
          xdr_free ((xdrproc_t) xdr_ypresp_all, (char *) &resp);
          /* Sun says we don't need to make this call, but must return
-            immediatly. Since Solaris makes this call, we will call
+            immediately. Since Solaris makes this call, we will call
             the callback function, too. */
          (*objp->foreach) (objp->status, NULL, 0, NULL, 0, objp->data);
          return TRUE;
index 0de79452350d85cf659e01fbf365e462e9b4e76d..38d5f817fd54149119c57cd524c3a9f340b9aae0 100644 (file)
@@ -1873,14 +1873,23 @@ finish_drop_privileges (void)
       error (EXIT_FAILURE, errno, _("setgroups failed"));
     }
 
-  if (setresgid (server_gid, server_gid, old_gid) == -1)
+  int res;
+  if (paranoia)
+    res = setresgid (server_gid, server_gid, old_gid);
+  else
+    res = setgid (server_gid);
+  if (res == -1)
     {
       dbg_log (_("Failed to run nscd as user '%s'"), server_user);
       perror ("setgid");
       exit (4);
     }
 
-  if (setresuid (server_uid, server_uid, old_uid) == -1)
+  if (paranoia)
+    res = setresuid (server_uid, server_uid, old_uid);
+  else
+    res = setuid (server_uid);
+  if (res == -1)
     {
       dbg_log (_("Failed to run nscd as user '%s'"), server_user);
       perror ("setuid");
This page took 0.059964 seconds and 5 git commands to generate.