return false;
Session *session = static_cast<Session *>(m->get_connection()->get_priv());
- if (!session->check_access(in, MAY_WRITE, 0, 0, 0, 0)) {
+ if (!session->check_access(in, MAY_WRITE, m->caller_uid, m->caller_gid, 0, 0)) {
dout(10) << "check_access failed, dropping cap update on " << *in << dendl;
return false;
}
class MClientCaps : public Message {
- static const int HEAD_VERSION = 6;
+ static const int HEAD_VERSION = 7;
static const int COMPAT_VERSION = 1;
public:
// Receivers may not use their new caps until they have this OSD map
epoch_t osd_epoch_barrier;
ceph_tid_t oldest_flush_tid;
+ uint32_t caller_uid;
+ uint32_t caller_gid;
int get_caps() { return head.caps; }
int get_wanted() { return head.wanted; }
MClientCaps()
: Message(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION),
- osd_epoch_barrier(0), oldest_flush_tid(0) {
+ osd_epoch_barrier(0),
+ oldest_flush_tid(0),
+ caller_uid(0), caller_gid(0) {
inline_version = 0;
}
MClientCaps(int op,
int mseq,
epoch_t oeb)
: Message(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION),
- osd_epoch_barrier(oeb), oldest_flush_tid(0) {
+ osd_epoch_barrier(oeb),
+ oldest_flush_tid(0),
+ caller_uid(0), caller_gid(0) {
memset(&head, 0, sizeof(head));
head.op = op;
head.ino = ino;
inodeno_t ino, inodeno_t realm,
uint64_t id, int mseq, epoch_t oeb)
: Message(CEPH_MSG_CLIENT_CAPS, HEAD_VERSION, COMPAT_VERSION),
- osd_epoch_barrier(oeb) {
+ osd_epoch_barrier(oeb),
+ oldest_flush_tid(0),
+ caller_uid(0), caller_gid(0) {
memset(&head, 0, sizeof(head));
head.op = op;
head.ino = ino;
if (header.version >= 6) {
::decode(oldest_flush_tid, p);
}
+ if (header.version >= 7) {
+ ::decode(caller_uid, p);
+ ::decode(caller_gid, p);
+ }
}
void encode_payload(uint64_t features) {
header.version = HEAD_VERSION;
::encode(osd_epoch_barrier, payload);
::encode(oldest_flush_tid, payload);
+ ::encode(caller_uid, payload);
+ ::encode(caller_gid, payload);
}
};