Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81903
b: refs/heads/master
c: edc26f7
h: refs/heads/master
i:
  81901: 04e64d8
  81899: 78621cb
  81895: 144d987
  81887: e6d1192
v: v3
  • Loading branch information
Jan Engelhardt authored and David S. Miller committed Feb 1, 2008
1 parent 96540dc commit 45d591c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 37c08387fc31a0fe7a570664c93be4f1c1bc0c94
refs/heads/master: edc26f7aaa23591c779d6d6fc833c0c96fbeb3c0
4 changes: 2 additions & 2 deletions trunk/include/linux/netfilter/xt_owner.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ enum {
};

struct xt_owner_match_info {
u_int32_t uid;
u_int32_t gid;
u_int32_t uid_min, uid_max;
u_int32_t gid_min, gid_max;
u_int8_t match, invert;
};

Expand Down
14 changes: 8 additions & 6 deletions trunk/net/netfilter/xt_owner.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* (C) 2000 Marc Boucher <marc@mbsi.ca>
*
* Copyright © CC Computer Consultants GmbH, 2007
* Contact: <jengelh@computergmbh.de>
* Copyright © CC Computer Consultants GmbH, 2007 - 2008
* <jengelh@computergmbh.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
Expand Down Expand Up @@ -102,13 +102,15 @@ owner_mt(const struct sk_buff *skb, const struct net_device *in,
(XT_OWNER_UID | XT_OWNER_GID)) == 0;

if (info->match & XT_OWNER_UID)
if ((filp->f_uid != info->uid) ^
!!(info->invert & XT_OWNER_UID))
if ((filp->f_uid >= info->uid_min &&
filp->f_uid <= info->uid_max) ^
!(info->invert & XT_OWNER_UID))
return false;

if (info->match & XT_OWNER_GID)
if ((filp->f_gid != info->gid) ^
!!(info->invert & XT_OWNER_GID))
if ((filp->f_gid >= info->gid_min &&
filp->f_gid <= info->gid_max) ^
!(info->invert & XT_OWNER_GID))
return false;

return true;
Expand Down

0 comments on commit 45d591c

Please sign in to comment.