summaryrefslogtreecommitdiffstats
path: root/src/resolve/resolved-dnssd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* resolved: move dnssd parsers to resolved-dnssd.cLennart Poettering2024-09-111-0/+222
| | | | Let's keep only the parsers for the main config in resolved-conf.c
* resolved: rename DnssdService "name" field to "id"Lennart Poettering2024-04-221-23/+38
| | | | | | | | | "name" is a bit confusing since this field is *not* the DNS-SD service identifier, bust just some string derived from the .dnssd filename that is used as handle for the service. Let's hence give it a better name: "id". While we are at it, switch from basename() to path_extract_filename().
* resolved: rename DnssdService.filename field to .pathLennart Poettering2024-04-221-7/+7
| | | | | It contains a full path, not just a filename, hence name it appropriately.
* resolved: dns_name_equal() can fail, handle that reasonablyLennart Poettering2024-04-101-1/+1
| | | | Ignoring errors can be OK sometimes, but we should make this explicit.
* resolved: support reloading configuration at runtimeLuca Boccassi2024-03-261-0/+10
| | | | | | | | | | | Drop connections and caches and reload config from files, to allow for low-interruptions updates, and hook up to the usual SIGHUP and ExecReload=. Mark servers and services configured directly via D-Bus so that they can be kept around, and only the configuration file settings are dropped and reloaded. Fixes https://github.com/systemd/systemd/issues/17503 Fixes https://github.com/systemd/systemd/issues/20604
* various: use strdup_to() in various obvious casesZbigniew Jędrzejewski-Szmek2024-03-201-7/+1
| | | | | strdup_to() returns 0 on success and here we convert obvious blocks which either return -ENOMEM or 0.
* dnssd: support service subtypesRonan Pigott2024-03-181-1/+24
| | | | A service subtype is used for selective enumeration of services.
* conf-parser: Add root argument to config_parse_many()Daan De Meyer2023-05-121-1/+1
|
* Rename def.h to constants.hZbigniew Jędrzejewski-Szmek2022-11-081-1/+1
| | | | | | The name "def.h" originates from before the rule of "no needless abbreviations" was established. Let's rename the file to clarify that it contains a collection of various semi-related constants.
* config-parser: Add list of drop-in files as return argument of config_parse_manyRichard Phibel2022-08-121-0/+1
| | | | This will be used to save the list of drop-in files for each partition
* Merge pull request #23855 from keszybz/drop-list-is-emptyLennart Poettering2022-07-051-4/+4
|\ | | | | basic/list: drop LIST_IS_EMPTY
| * resolved: rename field to indicate that it's a listZbigniew Jędrzejewski-Szmek2022-07-021-3/+3
| |
| * basic/list: drop LIST_IS_EMPTYZbigniew Jędrzejewski-Szmek2022-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | This was a trivial wrapper that didn't provide any added value. With more complicated structures like strvs, hashmaps, sets, and arrays, it is possible to have an empty container. But in case of a list, the list is empty only when the head is missing. Also, we generally want the positive condition, so we replace many if (!LIST_IS_EMPTY(x)) with just if (x).
* | tree-wide: Remove the repeated ';' from code (#23901)Li kunyu2022-07-051-1/+1
|/
* resolve: merge variable declaration with same typeYu Watanabe2022-05-151-3/+1
|
* resolve/dnssd: make dnssd_render_instance_name() take ManagerYu Watanabe2022-05-151-9/+9
| | | | | | | As DnssdService object passed to dnssd_render_instance_name() may not owned by Manager. Fixes #23381.
* tree-wide: host_name → hostnameZbigniew Jędrzejewski-Szmek2022-04-111-10/+10
| | | | | We use "hostname" exclusively in docs, and also in a big majority of the code. Let's use the same spelling in remaining places.
* strv: make iterator in STRV_FOREACH() declaread in the loopYu Watanabe2022-03-191-1/+0
| | | | This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
* list: declare iterator of LIST_FOREACH() in the loopYu Watanabe2022-03-191-1/+0
|
* tree-wide: make specifier expansion --root= awareLennart Poettering2021-06-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | This fixes repart's, systemctl's, sysusers' and tmpfiles' specifier expansion to honour the root dir specified with --root=. This is relevant for specifiers such as %m, %o, … which are directly sourced from files on disk. This doesn't try to be overly smart: specifiers referring to runtime concepts (i.e. boot ID, architecture, hostname) rather than files on the medium are left as is. There's certainly a point to be made that they should fail in case --root= is specified, but I am not entirely convinced about that, and it's certainly something we can look into later if there's reason to. I wondered for a while how to hook this up best, but given that quite a large number of specifiers resolve to data from files on disks, and most of our tools needs this, I ultimately decided to make the root dir a first class parameter to specifier_printf(). Replaces: #16187 Fixes: #16183
* tree-wide: refuse too long strings earlier in specifier_printf()Yu Watanabe2021-05-121-1/+1
| | | | | | | | | | | | We usually call specifier_printf() and then check the validity of the result. In many cases, validity checkers, e.g. path_is_valid(), refuse too long strings. This makes specifier_printf() refuse such long results earlier. Moreover, unit_full_string() and description field in sysuser now refuse results longer than LONG_LINE_MAX. config_parse() already refuses the line longer than LONG_LINE_MAX. Hence, it should be ok to set the same value as the maximum length of the resolved string.
* resolve: check that bus is ready before emitting signal or property changeYu Watanabe2021-05-081-9/+10
|
* shared/conf-parser: allow more than one location of the main config fileZbigniew Jędrzejewski-Szmek2021-02-211-1/+1
| | | | No functional change as long as only one path is passed.
* resolved-dnssd: Use TAKE_PTRSusant Sahani2021-01-171-2/+2
|
* resolved-dnssd: Use hashmap_ensure_putSusant Sahani2021-01-171-5/+1
|
* tree-wide: sort specifiers and move common comments to specifier.hYu Watanabe2020-11-251-4/+4
|
* Revert "resolve: check DNSSD service name template before assigning it"Roman Beranek2020-11-171-8/+10
| | | | | | | | | This reverts commit 34136e1503cf60852051adbd8b9a002d6282b750. Having the "%H" host name specifier in a DNSSD service name template triggers a failed assertion during name template instantiation as specifier_dnssd_host_name expects DnssdService in its userdata pointer but finds NULL instead.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* tree-wide: assorted coccinelle fixesFrantisek Sumsal2020-10-091-9/+9
|
* resolve: check DNSSD service name template before assigning itYu Watanabe2020-09-101-10/+8
|
* resolved: move dns stub definitions to resolved-dns-stub.[ch]Lennart Poettering2020-09-081-0/+1
| | | | Just some moving around, no logic changes.
* tree-wide: define iterator inside of the macroZbigniew Jędrzejewski-Szmek2020-09-081-2/+1
|
* conf-parser: return mtime in config_parse() and friendsLennart Poettering2020-06-021-4/+7
| | | | | | | | | | | | | This is a follow-up for 9f83091e3cceb646a66fa9df89de6d9a77c21d86. Instead of reading the mtime off the configuration files after reading, let's do so before reading, but with the fd we read the data from. This is not only cleaner (as it allows us to save one stat()), but also has the benefit that we'll detect changes that happen while we read the files. This also reworks unit file drop-ins to use the common code for determining drop-in mtime, instead of reading system clock for that.
* network: also read mtime of drop-in configsYu Watanabe2020-06-011-1/+1
| | | | Fixes #15521.
* tree-wide: support a bunch of additional specifiersLennart Poettering2020-04-281-1/+6
|
* resolved: use standard paths for .dnssd filesZbigniew Jędrzejewski-Szmek2019-02-181-11/+4
| | | | | | | | /usr/local/lib/systemd/dnssd is now also included in the search path. This path is of limited usefulness, but it makes sense to be consistent. Documentation is updated to match. Outdated advice against drop-ins in /usr is removed.
* resolved: add missing spdx headerZbigniew Jędrzejewski-Szmek2019-02-181-0/+1
|
* Mark *data and *userdata params to specifier_printf() as constZbigniew Jędrzejewski-Szmek2018-12-121-1/+1
| | | | | | | It would be very wrong if any of the specfier printf calls modified any of the objects or data being printed. Let's mark all arguments as const (primarily to make it easier for the reader to see where modifications cannot occur).
* resolve: reject host names with leading or trailing dashes in /etc/hostsZbigniew Jędrzejewski-Szmek2018-12-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://tools.ietf.org/html/rfc1035#section-2.3.1 says (approximately) that only letters, numbers, and non-leading non-trailing dashes are allowed (for entries with A/AAAA records). We set no restrictions. hosts(5) says: > Host names may contain only alphanumeric characters, minus signs ("-"), and > periods ("."). They must begin with an alphabetic character and end with an > alphanumeric character. nss-files follows those rules, and will ignore names in /etc/hosts that do not follow this rule. Let's follow the documented rules for /etc/hosts. In particular, this makes us consitent with nss-files, reducing surprises for the user. I'm pretty sure we should apply stricter filtering to names received over DNS and LLMNR and MDNS, but it's a bigger project, because the rules differ depepending on which level the label appears (rules for top-level names are stricter), and this patch takes the minimalistic approach and only changes behaviour for /etc/hosts. Escape syntax is also disallowed in /etc/hosts, even if the resulting character would be allowed. Other tools that parse /etc/hosts do not support this, and there is no need to use it because no allowed characters benefit from escaping.
* coccinelle: make use of SYNTHETIC_ERRNOZbigniew Jędrzejewski-Szmek2018-11-221-4/+4
| | | | | | | | | | | Ideally, coccinelle would strip unnecessary braces too. But I do not see any option in coccinelle for this, so instead, I edited the patch text using search&replace to remove the braces. Unfortunately this is not fully automatic, in particular it didn't deal well with if-else-if-else blocks and ifdefs, so there is an increased likelikehood be some bugs in such spots. I also removed part of the patch that coccinelle generated for udev, where we returns -1 for failure. This should be fixed independently.
* tree-wide: use instead of #ifdef for HAVE_*Yu Watanabe2018-06-291-1/+1
|
* tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek2018-06-201-3/+0
| | | | | | | | Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-1/+1
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* resolved: reindent specifier tableLennart Poettering2018-05-291-1/+1
|
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* macro: introduce TAKE_PTR() macroLennart Poettering2018-03-221-6/+3
| | | | | | | | | | | | | | | | This macro will read a pointer of any type, return it, and set the pointer to NULL. This is useful as an explicit concept of passing ownership of a memory area between pointers. This takes inspiration from Rust: https://doc.rust-lang.org/std/option/enum.Option.html#method.take and was suggested by Alan Jenkins (@sourcejedi). It drops ~160 lines of code from our codebase, which makes me like it. Also, I think it clarifies passing of ownership, and thus helps readability a bit (at least for the initiated who know the new macro)
* resolved: support multiple TXT RRs per DNS-SD serviceDmitry Rozhkov2017-12-081-15/+51
| | | | | Section 6.8 of RFC 6763 allows having service instances with multiple TXT resource records.
* resolved: implement D-Bus API for DNS-SDDmitry Rozhkov2017-12-081-0/+35
|
* resolved: put DNS-SD records to mDNS-enabled zones.Dmitry Rozhkov2017-12-081-0/+71
|