summaryrefslogtreecommitdiff
path: root/src/nss-myhostname
AgeCommit message (Collapse)Author
2017-02-16nss: fix error to ERANGE for nss calls with too little buffer space (#5365)Lennart Poettering
This is a follow-up for #5359, fixing the error codes in a similar way for the other NSS modules. (user/group lookup calls don't have h_errnop, hence we don't update that in those cases)
2017-02-09nss-myhostname: don't fill scopeid for non-link-local addressesLennart Poettering
Inspired by #4465, we shouldn't do this for nss-myhostname either.
2016-07-11treewide: fix typos and remove accidental repetition of wordsTorstein Husebø
2016-06-15tree-wide: htonl() is weird, let's use htobe32() instead (#3538)Lennart Poettering
Super-important change, yeah!
2016-04-05nss-myhostname: remove dead test of variable that was not setZbigniew Jędrzejewski-Szmek
2016-04-02nss-myhostname: trivial style fixesZbigniew Jędrzejewski-Szmek
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2016-01-27nss: block various signals while running NSS lookupsLennart Poettering
Let's make sure our poll() calls don't get interrupted where they shouldn't (SIGALRM, ...), but allow them to be interrupted where they should (SIGINT, ...). Fixes #1965
2015-10-27util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-08-21hostname-util: introduce new is_gateway_hostname() callLennart Poettering
This moves is_gateway() from nss-myhostname into the basic APIs, and makes it more like is_localhost(). Also, we rename it to is_gateway_hostname() to make it more expressive. Sharing this function in src/basic/ allows us to reuse the function for routing name requests in resolved (in a later commit).
2015-08-14nss-myhostname: use LOOPBACK_IFINDEX instead of if_nametoindex("lo")Lennart Poettering
Given that we already hardocde the loopback ifindex, following the kernel's own logic, we can replace the invocation of if_nametoindex("lo") with LOOPBACK_IFINDEX.
2015-07-31tree-wide: introduce mfree()David Herrmann
Pretty trivial helper which wraps free() but returns NULL, so we can simplify this: free(foobar); foobar = NULL; to this: foobar = mfree(foobar);
2015-05-18util: split all hostname related calls into hostname-util.cLennart Poettering
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
2015-01-05nss-myhostname: always will in canonical hostname field when resolving ↵Lennart Poettering
addresses to hostnames https://bugs.freedesktop.org/show_bug.cgi?id=87634
2014-12-19nss-myhostname: introduce is_gateway() similar to the existing is_hostname()Lennart Poettering
2014-12-16nss-myhostname: also recognize "gateway."Harald Hoyer
"gateway." skips adding the domain search path and saves some queries to the nameserver.
2014-12-04rtnl: when querying local addresses and gateways, take address family into ↵Lennart Poettering
account
2014-12-03nss-myhostname: always resolve the host name "gateway" to the local default ↵Lennart Poettering
gateway This is useful inside of containers or local networks to intrdouce a stable name of the default gateway host (in case of containers usually the host, in case of LANs usually local router).
2014-08-12networkd: add minimal client tool "networkd" to query network statusLennart Poettering
In the long run this should become a full fledged client to networkd (but not before networkd learns bus support). For now, just pull interesting data out of networkd, udev, and rtnl and present it to the user, in a simple but useful output.
2014-08-01nss: always explicitly reset all error variablesLennart Poettering
glibc appears to be broken if we don't explicitly reset all error variables, let's work around that. https://bugzilla.redhat.com/show_bug.cgi?id=1125975
2014-07-23nss-myhostname: don't include assert.h twiceLennart Poettering
2014-07-18shared: rename PROTO_ADDRESS_SIZE() to FAMILY_ADDRESS_SIZE()Lennart Poettering
We mostly use "family" to refer to AF_INET, AF_INET6, etc, let's use this terminology here, too
2014-07-16nss: various minor fixes to nss-myhostname + nss-mymachinesLennart Poettering
2014-07-11nss-myhostname: simplify array building a bitLennart Poettering
2014-07-10nss-myhostname: move NSS boilerplate to nss-util.hLennart Poettering
2014-07-10nss-myhostname: move local address listing logic into shared, so that we can ↵Lennart Poettering
make use of it from machined
2014-07-10nss-myhostname: only export the NSS entry point symbols, nothing elseLennart Poettering
2014-07-10nss-myhostname: following the usual naming scheme for .c/.h filesLennart Poettering
2014-07-10nss-myhostname: various modernizationsLennart Poettering
2014-04-19nss-myhostname: port to sd-rtnlTom Gundersen
2013-11-18Remove duplicate includesKarel Zak
2013-11-18use #pragma once instead of foo*foo define guardsShawn Landden
2013-10-13Never call qsort on potentially NULL arraysZbigniew Jędrzejewski-Szmek
This extends 62678ded 'efi: never call qsort on potentially NULL arrays' to all other places where qsort is used and it is not obvious that the count is non-zero.
2013-04-30build-sys: add makefile stub link to nss-myhostname/Lennart Poettering
2013-04-24nss-myhostname: resolve 'localhost' so that /etc/hosts becomes optionalLennart Poettering
This makes sure nss-myhostname not only resolves the local host name to 127.0.0.2/::1 but also the host name 'localhost: to 127.0.0.1/::1. This makes installation of /etc/passwd optional, as it usually only includes a mapping for 'localhost'. This change also resolves ::1 to the local hostname (as before), but also lists 'localhost' as an alias. This means look-ups are now fully reversible, even though they are 1:n mappings. Finally, the module will no longer erroneously claim that local IP addresses which aren't on the loopback device were.
2013-04-19nss-myhostname: ensure that glibc's assert is usedDave Reisner
2013-04-18move _cleanup_ attribute in front of the typeHarald Hoyer
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-10Use initalization instead of explicit zeroing in more placesZbigniew Jędrzejewski-Szmek
2013-04-02nss-myhostname: do not use _cleanup_Zbigniew Jędrzejewski-Szmek
mss-myhostname wasn't working because of underlinking. Instead of fixing the underlinking, just remove the use of _cleanup_ macros. It is impolite to use our utility functions in modules designed to be loaded by others. So cleanup macros which (at some point) call assert which calls log_assert_failed, should not be used. Revert this part of commit d73c3269c.
2013-03-31nss-myhostname: use _cleanup_ and split function into twoZbigniew Jędrzejewski-Szmek
The triply nested loop is just too much. Let's split out the middle loop's body, so the whole thing is easier to read. Also modernize the style a bit, using structure initialization to avoid memset and such.
2013-02-07nss-myhostname: copy first result to preallocated bufferEelco Dolstra
Fixes a segfault in nscd when using nss-myhostname. Nscd expects that an NSS module's gethostbyname4_r function returns its first result in the pre-allocated gaih_addrtuple denoted by **pat. (See nscd/aicache.c in the Glibc sources.) However, nss-myhostname doesn't fill in **pat but allocates the first result in ‘buffer’, then sets *pat. So nscd crashes (e.g. when running ‘getent ahosts my-machine’). Hard to tell if this is a bug in nscd, since there doesn't seem to be a proper API spec for gethostbyname4_r. But in any case, this patch fixes the crash by copying the first result to **pat.
2013-01-07nss-myhostname: remove redundant .gitignoreTom Gundersen
2013-01-07nss-myhostname: integrate documentationTom Gundersen
Converted from html to xml and changed the style to fit into the other manpages.
2013-01-07nss-myhostname: integrate into systemd buildsystemTom Gundersen
Note that there are still some rome for cleanups. In particular, the .la files are now installed, which we probably don't want; and some of the macros in Makefile.am are likely redundan.
2013-01-07nss-myhostname: remove duplicate LICENCETom Gundersen
Also update the licence in the source files.
2013-01-07nss-myhostname: remove non-Linux supportTom Gundersen
2013-01-03nss-myhostname: move to subdirectoryTom Gundersen
In order to merge into the systemd repos.