Merge pull request #643 from trapexit/ioctl_setuid

set uid & gid when calling ioctl
This commit is contained in:
trapexit 2019-06-17 17:09:16 -04:00 committed by GitHub
commit 10e5829b8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,12 +107,13 @@ namespace l
void *data_, void *data_,
uint32_t *out_bufsz_) uint32_t *out_bufsz_)
{ {
FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh); FileInfo *fi = reinterpret_cast<FileInfo*>(ffi_->fh);
const fuse_context *fc = fuse_get_context();
const ugid::Set ugid(fc->uid,fc->gid);
return l::ioctl(fi->fd,cmd_,data_,out_bufsz_); return l::ioctl(fi->fd,cmd_,data_,out_bufsz_);
} }
#ifndef O_NOATIME #ifndef O_NOATIME
#define O_NOATIME 0 #define O_NOATIME 0
#endif #endif