Skip to content

Commit

Permalink
KernelFilter: Call access() correctly.
Browse files Browse the repository at this point in the history
Reviewed-by: Eddie Kohler <ekohler@gmail.com>
  • Loading branch information
bcronje authored and kohler committed Oct 30, 2010
1 parent ea4f031 commit 123c9b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions elements/userlevel/kernelfilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ KernelFilter::device_filter(const String &devname, bool add_filter,
StringAccum cmda;
if (iptables_command)
cmda << iptables_command;
else if (access("/sbin/iptables", X_OK))
else if (access("/sbin/iptables", X_OK) == 0)
cmda << "/sbin/iptables";
else if (access("/usr/sbin/iptables", X_OK))
else if (access("/usr/sbin/iptables", X_OK) == 0)
cmda << "/usr/sbin/iptables";
else
return errh->error("no %<iptables%> executable found");
Expand Down

0 comments on commit 123c9b9

Please sign in to comment.