summaryrefslogtreecommitdiffstats
path: root/lib/resolv_wrapper/resolv_wrapper.c
Commit message (Collapse)AuthorAgeFilesLines
* rwrap: Fix a possible NULL dereference.Andreas Schneider2015-01-131-1/+1
| | | | | | | | CID: #84271 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Guenther Deschner <gd@samba.org>
* rwrap: If we do not have ns_name_compress() use dn_comp().Andreas Schneider2015-01-131-0/+4
| | | | | | | | | | | This should fix older Linux versions which do not export ns_name_compress(). In newer glibc versions dn_comp() calls ns_name_compress(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11019 Reviewed-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org>
* rwrap: Don't dereference NULL when skipping broken records.Jakub Hrozek2014-12-051-6/+6
| | | | | | | | | | | CID: 83426 CID: 83425 Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rwrap: Support asking for A via CNAMEJakub Hrozek2014-12-051-0/+7
| | | | | | | | | | | Adds support for querying for an A record using a name that only expands into a CNAME. Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rwrap: Recursively add additional dataJakub Hrozek2014-12-051-20/+119
| | | | | | | | | | | Change how we construct the fake answer such that the header and question are added first, then the answers and finally additional data. Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rwrap: Make the rwrap_fake_* functions only fake RRs.Jakub Hrozek2014-12-051-81/+62
| | | | | | | | | | | | | | | The rwrap_fake_common() function did too much. Remove it and use separate functions to add fake header and question sections. The rwrap_fake_$RR functions will receive packet including the header and question and only add its RR data. This will allow recursive processing later. Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rwrap: CNAME record can recurse into A, AAAA or CNAMEJakub Hrozek2014-12-051-0/+21
| | | | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rwrap: SRV record can recurse into A or AAAA.Jakub Hrozek2014-12-051-8/+47
| | | | | | | | | | | | When querying for a SRV record, we'll need to include A or AAAA records in additional section. Therefore, keep querying the host file until we can either recurse the A/AAAA records or reach the recursion limit Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rwrap: Use the rwrap_fake_rr structure instead of raw uint8_t pointers.Jakub Hrozek2014-12-051-136/+143
| | | | | | | | | | | Currently only one instance of the rwrap_fake_rr structure is used. Recursion will be implemented in a future patch. Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rwrap: Add data structures and functions to represent and manipulate RRs.Jakub Hrozek2014-12-051-7/+173
| | | | | | | | | | | | | Adds a structure that, using unions represents all supported RRs. Add a bunch of utility functions that can be used to create these structures. Currently the functions are unused. Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rwrap: Correctly calculate the response size and return it.Andreas Schneider2014-12-051-67/+71
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rwrap: Handle trailing dot in dns names.Andreas Schneider2014-12-051-8/+20
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* rwrap: Compare dns names case insensitive.Jakub Hrozek2014-12-051-1/+1
| | | | | | | | Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* lib: Add resolv_wrapper version 1.0.0.Andreas Schneider2014-12-051-0/+1377
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>