X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fstaging%2Fdgrp%2Fdgrp_common.c;h=9a9b45624ba9ba4f7a621a0031a25ce75348daa8;hb=0f47c9423c0fe468d0b5b153f9b9d6e8e20707eb;hp=3553998b72bc2758344c77dac88f1b50f72dd2a9;hpb=0074120228496d6fceb75ba17d21dc0b7476f8c4;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/staging/dgrp/dgrp_common.c b/drivers/staging/dgrp/dgrp_common.c index 3553998b72bc..9a9b45624ba9 100644 --- a/drivers/staging/dgrp/dgrp_common.c +++ b/drivers/staging/dgrp/dgrp_common.c @@ -167,34 +167,3 @@ void dgrp_carrier(struct ch_struct *ch) ch->ch_flag &= ~CH_PHYS_CD; } - -/** - * dgrp_chk_perm() -- check permissions for net device - * @inode: pointer to inode structure for the net communication device - * @op: operation to be tested - * - * The file permissions and ownerships are tested to determine whether - * the operation "op" is permitted on the file pointed to by the inode. - * Returns 0 if the operation is permitted, -EACCESS otherwise - */ -int dgrp_chk_perm(int mode, int op) -{ - if (!uid_eq(GLOBAL_ROOT_UID, current_euid())) - mode >>= 6; - else if (in_egroup_p(GLOBAL_ROOT_GID)) - mode >>= 3; - - if ((mode & op & 0007) == op) - return 0; - - if (capable(CAP_SYS_ADMIN)) - return 0; - - return -EACCES; -} - -/* dgrp_chk_perm wrapper for permission call in struct inode_operations */ -int dgrp_inode_permission(struct inode *inode, int op) -{ - return dgrp_chk_perm(inode->i_mode, op); -}