accept commands from root

Commands should be accepted when they are coming from root.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Michel Normand <normand@fr.ibm.com>
This commit is contained in:
Michel Normand 2009-10-07 16:06:08 +02:00 committed by Daniel Lezcano
parent 2dcb28a9d0
commit d8cc9804ae

View File

@ -237,9 +237,9 @@ int lxc_af_unix_rcv_credential(int fd, void *data, size_t size)
cmsg->cmsg_level == SOL_SOCKET &&
cmsg->cmsg_type == SCM_CREDENTIALS) {
cred = *((struct ucred *) CMSG_DATA(cmsg));
if (cred.uid != getuid() || cred.gid != getgid()) {
if (cred.uid && (cred.uid != getuid() || cred.gid != getgid())) {
INFO("message denied for '%d/%d'", cred.uid, cred.gid);
return -EPERM;
return -EACCES;
}
}
out: