=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/readconf.c,v retrieving revision 1.378 retrieving revision 1.379 diff -u -r1.378 -r1.379 --- src/usr.bin/ssh/readconf.c 2023/07/17 04:04:36 1.378 +++ src/usr.bin/ssh/readconf.c 2023/07/17 04:08:31 1.379 @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.378 2023/07/17 04:04:36 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.379 2023/07/17 04:08:31 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -128,7 +128,7 @@ typedef enum { oBadOption, - oHost, oMatch, oInclude, + oHost, oMatch, oInclude, oTag, oForwardAgent, oForwardX11, oForwardX11Trusted, oForwardX11Timeout, oGatewayPorts, oExitOnForwardFailure, oPasswordAuthentication, @@ -241,6 +241,7 @@ { "user", oUser }, { "host", oHost }, { "match", oMatch }, + { "tag", oTag }, { "escapechar", oEscapeChar }, { "globalknownhostsfile", oGlobalKnownHostsFile }, { "userknownhostsfile", oUserKnownHostsFile }, @@ -729,6 +730,10 @@ goto out; } r = check_match_ifaddrs(arg) == 1; + } else if (strcasecmp(attrib, "tagged") == 0) { + criteria = xstrdup(options->tag == NULL ? "" : + options->tag); + r = match_pattern_list(criteria, arg, 0) == 1; if (r == (negate ? 1 : 0)) this_result = result = 0; } else if (strcasecmp(attrib, "exec") == 0) { @@ -1349,6 +1354,10 @@ charptr = &options->hostname; goto parse_string; + case oTag: + charptr = &options->tag; + goto parse_string; + case oHostKeyAlias: charptr = &options->host_key_alias; goto parse_string; @@ -2496,6 +2505,7 @@ options->known_hosts_command = NULL; options->required_rsa_size = -1; options->enable_escape_commandline = -1; + options->tag = NULL; } /* @@ -3408,6 +3418,7 @@ dump_cfg_string(oRevokedHostKeys, o->revoked_host_keys); dump_cfg_string(oXAuthLocation, o->xauth_location); dump_cfg_string(oKnownHostsCommand, o->known_hosts_command); + dump_cfg_string(oTag, o->tag); /* Forwards */ dump_cfg_forwards(oDynamicForward, o->num_local_forwards, o->local_forwards);