diff options
Diffstat (limited to 'sys/kern/kern_alq.c')
-rw-r--r-- | sys/kern/kern_alq.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_alq.c b/sys/kern/kern_alq.c index 5335393..94f0118 100644 --- a/sys/kern/kern_alq.c +++ b/sys/kern/kern_alq.c @@ -326,7 +326,8 @@ SYSINIT(ald, SI_SUB_LOCK, SI_ORDER_ANY, ald_startup, NULL) * Create the queue data structure, allocate the buffer, and open the file. */ int -alq_open(struct alq **alqp, const char *file, int size, int count) +alq_open(struct alq **alqp, const char *file, struct ucred *cred, int size, + int count) { struct thread *td; struct nameidata nd; @@ -344,7 +345,7 @@ alq_open(struct alq **alqp, const char *file, int size, int count) NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file, td); flags = FWRITE | O_NOFOLLOW | O_CREAT; - error = vn_open(&nd, &flags, 0); + error = vn_open_cred(&nd, &flags, 0, cred); if (error) return (error); @@ -356,7 +357,7 @@ alq_open(struct alq **alqp, const char *file, int size, int count) alq->aq_entbuf = malloc(count * size, M_ALD, M_WAITOK|M_ZERO); alq->aq_first = malloc(sizeof(*ale) * count, M_ALD, M_WAITOK|M_ZERO); alq->aq_vp = nd.ni_vp; - alq->aq_cred = crhold(td->td_ucred); + alq->aq_cred = crhold(cred); alq->aq_entmax = count; alq->aq_entlen = size; alq->aq_entfree = alq->aq_first; |