summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f51fdac)
SCCS-vsn: sys/kern/uipc_usrreq.c 8.2
SCCS-vsn: sys/kern/sysv_shm.c 8.2
*
* from: Utah $Hdr: uipc_shm.c 1.11 92/04/23$
*
*
* from: Utah $Hdr: uipc_shm.c 1.11 92/04/23$
*
- * @(#)sysv_shm.c 8.1 (Berkeley) %G%
+ * @(#)sysv_shm.c 8.2 (Berkeley) %G%
#include <sys/shm.h>
#include <sys/malloc.h>
#include <sys/mman.h>
#include <sys/shm.h>
#include <sys/malloc.h>
#include <sys/mman.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
#include <vm/vm.h>
#include <vm/vm_kern.h>
shmtot += size;
shp->shm_perm.cuid = shp->shm_perm.uid = cred->cr_uid;
shp->shm_perm.cgid = shp->shm_perm.gid = cred->cr_gid;
shmtot += size;
shp->shm_perm.cuid = shp->shm_perm.uid = cred->cr_uid;
shp->shm_perm.cgid = shp->shm_perm.gid = cred->cr_gid;
- shp->shm_perm.mode = SHM_ALLOC | (uap->shmflg&0777);
+ shp->shm_perm.mode = SHM_ALLOC | (uap->shmflg & ACCESSPERMS);
shp->shm_segsz = uap->size;
shp->shm_cpid = p->p_pid;
shp->shm_lpid = shp->shm_nattch = 0;
shp->shm_segsz = uap->size;
shp->shm_cpid = p->p_pid;
shp->shm_lpid = shp->shm_nattch = 0;
/* XXX: probably not the right thing to do */
if (shp->shm_perm.mode & SHM_DEST)
return (EBUSY);
/* XXX: probably not the right thing to do */
if (shp->shm_perm.mode & SHM_DEST)
return (EBUSY);
- if (error = ipcaccess(&shp->shm_perm, uap->shmflg&0777, cred))
+ if (error = ipcaccess(&shp->shm_perm, uap->shmflg & ACCESSPERMS,
+ cred))
return (error);
if (uap->size && uap->size > shp->shm_segsz)
return (EINVAL);
return (error);
if (uap->size && uap->size > shp->shm_segsz)
return (EINVAL);
return (error);
shp->shm_perm.uid = sbuf.shm_perm.uid;
shp->shm_perm.gid = sbuf.shm_perm.gid;
return (error);
shp->shm_perm.uid = sbuf.shm_perm.uid;
shp->shm_perm.gid = sbuf.shm_perm.gid;
- shp->shm_perm.mode = (shp->shm_perm.mode & ~0777)
- | (sbuf.shm_perm.mode & 0777);
+ shp->shm_perm.mode = (shp->shm_perm.mode & ~ACCESSPERMS)
+ | (sbuf.shm_perm.mode & ACCESSPERMS);
shp->shm_ctime = time.tv_sec;
break;
shp->shm_ctime = time.tv_sec;
break;
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)uipc_usrreq.c 8.1 (Berkeley) %G%
+ * @(#)uipc_usrreq.c 8.2 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
}
VATTR_NULL(&vattr);
vattr.va_type = VSOCK;
}
VATTR_NULL(&vattr);
vattr.va_type = VSOCK;
+ vattr.va_mode = ACCESSPERMS;
LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
if (error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr))
return (error);
LEASE_CHECK(nd.ni_dvp, p, p->p_ucred, LEASE_WRITE);
if (error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vattr))
return (error);