[hipl-commit] [trunk] Rev 4627: lib: fix an uid-related issue.

  • From: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
  • To: hipl-commit@xxxxxxxxxxxxx
  • Date: Sun, 30 May 2010 19:46:19 +0300

Committer: Mircea Gherzan <mircea.gherzan@xxxxxxxxxxxxxx>
Date: 30/05/2010 at 19:46:19
Revision: 4627
Revision-id: mircea.gherzan@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Branch nick: trunk

Log:
  lib: fix an uid-related issue.

Modified:
  M  lib/core/capability.c

=== modified file 'lib/core/capability.c'
--- lib/core/capability.c       2010-05-26 10:28:47 +0000
+++ lib/core/capability.c       2010-05-30 16:45:59 +0000
@@ -92,8 +92,8 @@
  */
 int hip_set_lowcapability(int run_as_sudo)
 {
-    int err   = 0;
-    uid_t uid = -1;
+    int err = 0;
+    int uid = -1;
 
     struct __user_cap_header_struct header;
     struct __user_cap_data_struct data;
@@ -107,9 +107,11 @@
     HIP_DEBUG("Now PR_SET_KEEPCAPS=%d\n", prctl(PR_GET_KEEPCAPS));
 
     uid = hip_user_to_uid(USER_NOBODY);
+    if (uid == -1) {
+        HIP_ERROR("User 'nodoby' could not be found\n");
+        goto out_err;
+    }
 
-    HIP_IFEL((uid < 0), -1,
-             "Error while retrieving USER 'nobody' uid\n");
     HIP_IFEL(hip_capget(&header, &data), -1,
              "error while retrieving capabilities through capget()\n");
     HIP_DEBUG("effective=%u, permitted = %u, inheritable=%u\n",

Other related posts:

  • » [hipl-commit] [trunk] Rev 4627: lib: fix an uid-related issue. - Mircea Gherzan