]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authorjsg@openbsd.org <jsg@openbsd.org>
Tue, 25 Oct 2016 04:08:13 +0000 (04:08 +0000)
committerDarren Tucker <dtucker@zip.com.au>
Tue, 25 Oct 2016 21:52:46 +0000 (08:52 +1100)
Fix logic in add_local_forward() that inverted a test
when code was refactored out into bind_permitted().  This broke ssh port
forwarding for non-priv ports as a non root user.

ok dtucker@ 'looks good' deraadt@

Upstream-ID: ddb8156ca03cc99997de284ce7777536ff9570c9

readconf.c

index 1be5648565d41a1acfc982645f5ebcea60ad7e3f..fa3fab8f080b11eef57aba3395c64083bfca1c16 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: readconf.c,v 1.261 2016/10/23 22:04:05 dtucker Exp $ */
+/* $OpenBSD: readconf.c,v 1.262 2016/10/25 04:08:13 jsg Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -312,7 +312,7 @@ add_local_forward(Options *options, const struct Forward *newfwd)
        extern uid_t original_real_uid;
        int i;
 
-       if (bind_permitted(newfwd->listen_port, original_real_uid) &&
+       if (!bind_permitted(newfwd->listen_port, original_real_uid) &&
            newfwd->listen_path == NULL)
                fatal("Privileged ports can only be forwarded by root.");
        /* Don't add duplicates */