Skip to content

Commit

Permalink
Fix failure to compile the scull. The return value of current_xid() h…
Browse files Browse the repository at this point in the history
…as changed in kernel of version 4.6.0
  • Loading branch information
coderkaka committed May 3, 2016
1 parent 7a41714 commit 0a7ee7d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scull/access.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ static int scull_u_open(struct inode *inode, struct file *filp)

spin_lock(&scull_u_lock);
if (scull_u_count &&
(scull_u_owner != current_uid()) && /* allow user */
(scull_u_owner != current_euid()) && /* allow whoever did su */
(scull_u_owner != current_uid().val) && /* allow user */
(scull_u_owner != current_euid().val) && /* allow whoever did su */
!capable(CAP_DAC_OVERRIDE)) { /* still allow root */
spin_unlock(&scull_u_lock);
return -EBUSY; /* -EPERM would confuse the user */
}

if (scull_u_count == 0)
scull_u_owner = current_uid(); /* grab it */
scull_u_owner = current_uid().val; /* grab it */

scull_u_count++;
spin_unlock(&scull_u_lock);
Expand Down Expand Up @@ -164,8 +164,8 @@ static DEFINE_SPINLOCK(scull_w_lock);
static inline int scull_w_available(void)
{
return scull_w_count == 0 ||
scull_w_owner == current_uid() ||
scull_w_owner == current_euid() ||
scull_w_owner == current_uid().val ||
scull_w_owner == current_euid().val ||
capable(CAP_DAC_OVERRIDE);
}

Expand All @@ -183,7 +183,7 @@ static int scull_w_open(struct inode *inode, struct file *filp)
spin_lock(&scull_w_lock);
}
if (scull_w_count == 0)
scull_w_owner = current_uid(); /* grab it */
scull_w_owner = current_uid().val; /* grab it */
scull_w_count++;
spin_unlock(&scull_w_lock);

Expand Down

0 comments on commit 0a7ee7d

Please sign in to comment.