[BACK]Return to tty_ptm.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / kern

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/kern/tty_ptm.c between version 1.7 and 1.7.10.2

version 1.7, 2005/12/11 12:24:30 version 1.7.10.2, 2006/04/19 05:14:00
Line 112  pty_getfree(void)
Line 112  pty_getfree(void)
 int  int
 pty_vn_open(struct vnode *vp, struct lwp *l)  pty_vn_open(struct vnode *vp, struct lwp *l)
 {  {
         struct ucred *cred;          kauth_cred_t cred;
         int error;          int error;
   
         if (vp->v_type != VCHR) {          if (vp->v_type != VCHR) {
Line 123  pty_vn_open(struct vnode *vp, struct lwp
Line 123  pty_vn_open(struct vnode *vp, struct lwp
         /*          /*
          * Get us a fresh cred with root privileges.           * Get us a fresh cred with root privileges.
          */           */
         cred = crget();          cred = kauth_cred_alloc();
         error = VOP_OPEN(vp, FREAD|FWRITE, cred, l);          error = VOP_OPEN(vp, FREAD|FWRITE, cred, l);
         crfree(cred);          kauth_cred_free(cred);
   
         if (error) {          if (error) {
                 vput(vp);                  vput(vp);
Line 216  pty_grant_slave(struct lwp *l, dev_t dev
Line 216  pty_grant_slave(struct lwp *l, dev_t dev
   
         if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) {          if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) {
                 struct vattr vattr;                  struct vattr vattr;
                 struct ucred *cred;                  kauth_cred_t cred;
                 (*ptm->getvattr)(ptm, l->l_proc, &vattr);                  (*ptm->getvattr)(ptm, l->l_proc, &vattr);
                 /* Get a fake cred to pretend we're root. */                  /* Get a fake cred to pretend we're root. */
                 cred = crget();                  cred = kauth_cred_alloc();
                 error = VOP_SETATTR(vp, &vattr, cred, l);                  error = VOP_SETATTR(vp, &vattr, cred, l);
                 crfree(cred);                  kauth_cred_free(cred);
                 if (error) {                  if (error) {
                         DPRINTF(("setattr %d\n", error));                          DPRINTF(("setattr %d\n", error));
                         VOP_UNLOCK(vp, 0);                          VOP_UNLOCK(vp, 0);
Line 289  pty_sethandler(struct ptm_pty *nptm)
Line 289  pty_sethandler(struct ptm_pty *nptm)
 }  }
   
 int  int
 pty_fill_ptmget(dev_t dev, int cfd, int sfd, void *data)  pty_fill_ptmget(struct lwp *l, dev_t dev, int cfd, int sfd, void *data)
 {  {
         struct ptmget *ptmg = data;          struct ptmget *ptmg = data;
         int error;          int error;
Line 300  pty_fill_ptmget(dev_t dev, int cfd, int 
Line 300  pty_fill_ptmget(dev_t dev, int cfd, int 
         ptmg->cfd = cfd == -1 ? minor(dev) : cfd;          ptmg->cfd = cfd == -1 ? minor(dev) : cfd;
         ptmg->sfd = sfd == -1 ? minor(dev) : sfd;          ptmg->sfd = sfd == -1 ? minor(dev) : sfd;
   
         error = (*ptm->makename)(ptm, ptmg->cn, sizeof(ptmg->cn), dev, 'p');          error = (*ptm->makename)(ptm, l, ptmg->cn, sizeof(ptmg->cn), dev, 'p');
         if (error)          if (error)
                 return error;                  return error;
   
         return (*ptm->makename)(ptm, ptmg->sn, sizeof(ptmg->sn), dev, 't');          return (*ptm->makename)(ptm, l, ptmg->sn, sizeof(ptmg->sn), dev, 't');
 }  }
   
 void  void
Line 372  ptmioctl(dev_t dev, u_long cmd, caddr_t 
Line 372  ptmioctl(dev_t dev, u_long cmd, caddr_t 
                         goto bad;                          goto bad;
   
                 /* now, put the indices and names into struct ptmget */                  /* now, put the indices and names into struct ptmget */
                 return pty_fill_ptmget(newdev, cfd, sfd, data);                  return pty_fill_ptmget(l, newdev, cfd, sfd, data);
         default:          default:
                 DPRINTF(("ptmioctl EINVAL\n"));                  DPRINTF(("ptmioctl EINVAL\n"));
                 return EINVAL;                  return EINVAL;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.7.10.2

CVSweb <webmaster@jp.NetBSD.org>