]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/ipvrf.c
Merge branch 'iproute2-master' into iproute2-next
[mirror_iproute2.git] / ip / ipvrf.c
index e6fad32abd956c6159efce21ee06679d5ad3948f..8a6b7f977b1423da8c1ee0df8379d90ba4716cc0 100644 (file)
@@ -74,7 +74,7 @@ static int vrf_identify(pid_t pid, char *name, size_t len)
                        if (end)
                                *end = '\0';
 
-                       strncpy(name, vrf, len - 1);
+                       strlcpy(name, vrf, len);
                        break;
                }
        }
@@ -336,8 +336,7 @@ static int vrf_path(char *vpath, size_t len)
                if (vrf)
                        *vrf = '\0';
 
-               strncpy(vpath, start, len - 1);
-               vpath[len - 1] = '\0';
+               strlcpy(vpath, start, len);
 
                /* if vrf path is just / then return nothing */
                if (!strcmp(vpath, "/"))
@@ -437,6 +436,8 @@ out2:
 out:
        free(mnt);
 
+       drop_cap();
+
        return rc;
 }