]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/privs.c
Merge remote-tracking branch 'origin/stable/3.0'
[mirror_frr.git] / lib / privs.c
index 376d6f3365bb8c22f50397420acabbb554492493..767ab667e78e908eb44e8492caaac299ea241388 100644 (file)
@@ -731,7 +731,7 @@ zprivs_init(struct zebra_privs_t *zprivs)
   if (zprivs->user)
     {
       ngroups = sizeof(groups);
-      if ( (ngroups = getgrouplist (zprivs->user, zprivs_state.zgid, groups, &ngroups )) < 0 )
+      if (getgrouplist (zprivs->user, zprivs_state.zgid, groups, &ngroups) < 0)
         {
           /* cant use log.h here as it depends on vty */
           fprintf (stderr, "privs_init: could not getgrouplist for user %s\n",
@@ -769,6 +769,7 @@ zprivs_init(struct zebra_privs_t *zprivs)
         }
     }
 
+  zprivs_state.zsuid = geteuid(); /* initial uid */
   /* add groups only if we changed uid - otherwise skip */
   if ((ngroups) && (zprivs_state.zsuid != zprivs_state.zuid))
     {