aboutsummaryrefslogtreecommitdiff
path: root/tools/virtiofsd/fuse_lowlevel.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2020-01-31 19:02:49 +0000
committerDr. David Alan Gilbert <dgilbert@redhat.com>2020-02-10 17:24:43 +0000
commit988717b46b6424907618cb845ace9d69062703af (patch)
tree3ce17dc71d297c0553a1a2616e61bddea1ee4007 /tools/virtiofsd/fuse_lowlevel.c
parent2b8a51cdb3e8d15a5c35de7a2e76a813ae7358f0 (diff)
virtiofsd: Remove fuse_req_getgroups
Remove fuse_req_getgroups that's unused in virtiofsd; it came in from libfuse but we don't actually use it. It was called from fuse_getgroups which we previously removed (but had left it's header in). Coverity had complained about null termination in it, but removing it is the easiest answer. Fixes: Coverity CID: 1413117 (String not null terminated) Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tools/virtiofsd/fuse_lowlevel.c')
-rw-r--r--tools/virtiofsd/fuse_lowlevel.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
index de2e2e0c65..01c418aade 100644
--- a/tools/virtiofsd/fuse_lowlevel.c
+++ b/tools/virtiofsd/fuse_lowlevel.c
@@ -2667,83 +2667,6 @@ int fuse_lowlevel_is_virtio(struct fuse_session *se)
return !!se->virtio_dev;
}
-#ifdef linux
-int fuse_req_getgroups(fuse_req_t req, int size, gid_t list[])
-{
- char *buf;
- size_t bufsize = 1024;
- char path[128];
- int ret;
- int fd;
- unsigned long pid = req->ctx.pid;
- char *s;
-
- sprintf(path, "/proc/%lu/task/%lu/status", pid, pid);
-
-retry:
- buf = malloc(bufsize);
- if (buf == NULL) {
- return -ENOMEM;
- }
-
- ret = -EIO;
- fd = open(path, O_RDONLY);
- if (fd == -1) {
- goto out_free;
- }
-
- ret = read(fd, buf, bufsize);
- close(fd);
- if (ret < 0) {
- ret = -EIO;
- goto out_free;
- }
-
- if ((size_t)ret == bufsize) {
- free(buf);
- bufsize *= 4;
- goto retry;
- }
-
- ret = -EIO;
- s = strstr(buf, "\nGroups:");
- if (s == NULL) {
- goto out_free;
- }
-
- s += 8;
- ret = 0;
- while (1) {
- char *end;
- unsigned long val = strtoul(s, &end, 0);
- if (end == s) {
- break;
- }
-
- s = end;
- if (ret < size) {
- list[ret] = val;
- }
- ret++;
- }
-
-out_free:
- free(buf);
- return ret;
-}
-#else /* linux */
-/*
- * This is currently not implemented on other than Linux...
- */
-int fuse_req_getgroups(fuse_req_t req, int size, gid_t list[])
-{
- (void)req;
- (void)size;
- (void)list;
- return -ENOSYS;
-}
-#endif
-
void fuse_session_exit(struct fuse_session *se)
{
se->exited = 1;