From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 0BFF6225AE for ; Tue, 27 Aug 2024 17:30:55 +0200 (CEST) Received: (qmail 26261 invoked by uid 550); 27 Aug 2024 15:30:51 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 26221 invoked from network); 27 Aug 2024 15:30:50 -0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=U1NA/U49lxuJJIrdvvVmWj/NPrDfmC+v14gZD+OLv5zM1kNDUWdvfaZrroN0FWM5tNmKCngyDAIKkUcfdJYl4p/n+XJXEkkRKyR5T86zWpxbmfj/w5j2Me5d+UHDvYnoHLZ+n6MODSYcJKIuXydjyrMJXLd+a5BfQiV3F5nJ2uhKBRmGP/Sa1QbgycnZ0nZKbbls39mgen1iaXaJpiMIWLud0yM1xtfYl25TExZxoOTqBeL60M4L/qeibf8BVTitzioQF6+NONo3Vi0bhOg4uyiFz6/HOMB3SIVVCZboyTdYQPLDe44Gmktfyk35aMD8SDXoqhulWkdTcqYA5eet6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NLqPlzGcZBKBqjpFeGeLz0Sr0xxLGHoofr2JNgT4RGY=; b=Xzgurgi6fdAVfRmY5qapmFd+dTw3U3guU1Xw8KA/lShdCTBicQZLtGkDjbt/w7QaKrSXnxI1j13DUy1ZoUADOSd/cWyCgrcY3rpDic5bkvgiNVDftYrIwhl22j1PDj2+TOAvXX6MsK7ifsmOBH8Fr7iKKLmeUinYr9kT9s1+5Mb1TZ8O+Fy5fehMw7PCFwWhrYk4M3M4rTX8vt3GuKGpRNEhFWz8LsWVBo+A3YvpseX0qfgpK3IgZkeaRk+XubxHiXw1PGYnh661SCHSiS7ZgEVHq0rQeuBxtIXerYcRr9o7Ojycy6GkRZNVuhKI6Ua3Y+ng5IQMqwrWg4mn9Sfczw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=OUTLOOK.COM.AU; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NLqPlzGcZBKBqjpFeGeLz0Sr0xxLGHoofr2JNgT4RGY=; b=kHCYzwOaCK9ebLXPxSi7i8rSu3NFgjgmBv+oyQtLQa5GAF6HrnDWr1QMIIGn8dTgCaCkbesJz4l3aHQ5zEDkrQcINu9uWQvs9XopEEDazC1zje89Dhqxk+jKzGxQa+nx0+11HM5kUFW7VUpVhJ1qkmRy6tzTGpWjwzVzqD5fzk/Bbr6M+rZqn95J77U02/P4/lh8/VECBjaKa0fIqT92p2j/I4+Szj2ggSlNaxuoZ2BMzV/4U+r3/p/nv6USGOtYuy/xbuXyVBzx0BFD6KMYnq1ExqI55o9ImtsKChKras3qV3OqT/DCjctXhoSjJwzbs/DXVEQ/LLyG1XRDM5e1AQ== From: Ryan Ward To: Szabolcs Nagy , Rich Felker CC: "musl@lists.openwall.com" Thread-Topic: [musl] Adding dns/resolver tests to libc-test Thread-Index: AQHa8wUnHDz2XhAr1k2/YnOihK7GDbI7P81C Date: Tue, 27 Aug 2024 15:30:37 +0000 Message-ID: References: <20240818093842.GD3766212@port70.net> In-Reply-To: <20240818093842.GD3766212@port70.net> Accept-Language: en-AU, en-US Content-Language: en-AU X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: x-tmn: [gtJH8aS05PcgdgtV9wG3IPsP5O8Kodm3nvim6bzFwf0=] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SG2PR01MB4566:EE_|TY0PR0101MB4666:EE_ x-ms-office365-filtering-correlation-id: 75a81dae-92b0-4188-0274-08dcc6ad337c x-microsoft-antispam: BCL:0;ARA:14566002|15030799003|6092099012|15080799006|8060799006|461199028|19110799003|102099032|440099028|3412199025|3420499032|3430499032; x-microsoft-antispam-message-info: dhFOgwfF4/7fzYHyPUuaGmVIcfjxaMk6EJwXb3rGImeF/R73NbsYwFNbjzzREoVi2UPmyGQn6Ctql6S2EwUA8/omaSLJplXA+KrIAng7UDxao9S2dPRYQkhnSWfLjwxmZkMLuThTwlA07kjKvpc8QVxxOnDrhCqufpxuY1uoBngyTaaioignTECcZJiv937It/+tCDl6RN5HseWx2yQazWai3CSwDnaFnkinkcrLpNH1pPub7RfCn/4xJawkMaaAgZ8wanf93vefoaPWvY38mdSnc5RryZcY+yddyqAMMXTHHkOMa6RxIR6VH37dvDCC8WT2quX5iy/ZaxszRfDEeeJLyDz8CubQ8HJHpnQtuY2vlI1DFNNMR7L6mBByWL6vBVQXshEkNZ7GpHlkAil8iBFDK/3d91C/lMIPTmBiF49nMenSFMQKwCWM8sbcoNGv5+YonfgN3wYvvmLpZ7103UouPxULrHv2bPlnABJg/MOAqop/04K81+cEoUYDarn6z9COAVcGo4YrYkCJ9hbntFj/y13WtcYtOirJR5mP1L63nPhCVcRqLLX+3P5tNh/PIxXTGerl1fk1M5BniGiVLe9t0j9VgR49NTscMDMoySnKmuQ0uzrk+ejmKahdwsqWKh/OZnmykHL8Lbx+EJ3wzi7MrKv5rHy339goLYBGzq20/npF23tUAyjEQ5DD1kG/VNv1xhleXxffLRzOTN3a2Rzy1z5ZznRmn4VEzZ///6E= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?EM3Au+0cWhgLGlCBYSIW8hH4LPxt5jcZenCmscrTx1uI78FBTxDNywvL48?= =?iso-8859-1?Q?dNFVsV+5v8CY+Lo/NvSwsZOx6+cT7EeU7JQ7pPFV+cs0b6M0dWDBRWDJGi?= =?iso-8859-1?Q?/tUSSlCFj6uW1E93VJKeEaHd9s7gOflpmcRNsJ1KmeU5U+tTtTcLs7pnBR?= =?iso-8859-1?Q?t9tig/E4fz88pQ9hXong6vwTRwMrJswoIISbuiQPCT37gcm1C49ToQgoVG?= =?iso-8859-1?Q?AUKdjzWdl9Kvme83eKhpjJ8oCEwZ7SsKCaBjYTIhHTW+Z6giYT+WRUR2ZB?= =?iso-8859-1?Q?QBzxoLAt2toSEH7Ixs45xmPFXcPGarl4VDZqdEZomgbbuhRAeqnGZqVxeW?= =?iso-8859-1?Q?AyjRdEbhKHuX3rzDGaWLVpGmbHPUsw/tlLO5HvgkbwJ/01ROHP/WKfyEuk?= =?iso-8859-1?Q?JyXeB/6weUlh43JAkYJUg2MeonnBAVLlXD7SJn64q8DyBIM0Egb0pJOHew?= =?iso-8859-1?Q?jFSvzw7pJQGkntX0k467bT9jWHaifuOdAlDzdXAQn8SOaW99+zNj9B0tIl?= =?iso-8859-1?Q?lFTKHZ2DEGCAZjisGbWVShN2+OwGya/1o3Pwg450EJq+qrCykl8r/nEv/2?= =?iso-8859-1?Q?nDgXc8OdN4s4GH7DliTfCvTYR84v0XMeGthb/zXZWaY5fSTzZanybKTAMP?= =?iso-8859-1?Q?LD5isfghYVNmVURvC5X/1eeST/kx1Lx2+pbRJ28vLQB7daQBSx/Je9Appn?= =?iso-8859-1?Q?GGfUhqzEqnlwenosW3Hr4E+Vn5mM4fm8cQAYR73vtQGUAo4NlZ78V8p6zM?= =?iso-8859-1?Q?/aCoAzVwyNNSpNaumkrp5sqcY7PZ9i5fjrCTAtBHYTXklqqMoNIQc1BwDj?= =?iso-8859-1?Q?U2w72VVeOdaTEbFTLjn0q8j3ROyLY69arh1mhveB9mI/Ctao8jQp3G6t/u?= =?iso-8859-1?Q?kGtTuAn42DyoSTejh5HGTy/eQyQHi3ltWx73XbAXX6xmXEare+EX/iUgon?= =?iso-8859-1?Q?YBLkqrMDK5r5ttRpActhl3qWro3Hh9YESvkaO39ILU1hTbaWykD5fdA2pM?= =?iso-8859-1?Q?Hkofz0nsWC3vHxgZOxeOUXgFNDyWqsRZhLzhB956AF5ZFiN950h6MAVaSn?= =?iso-8859-1?Q?6Y9syRCs9k6UxK2Xqth1s8GOee5opCvx1IUcNzQjBgRZBv7O0SjaUplcOr?= =?iso-8859-1?Q?8eLUCGs7hgkY3tG34cxBcxPp/wusu3rrFezr7OMxL6GuatEjs3B/c7sGCC?= =?iso-8859-1?Q?AKJFLokTfVd7/i8bxTX6iqum81/mMFjPagBHsUvHxTH5QsPPz9pdCb8XR7?= =?iso-8859-1?Q?CtwKyofqGWnsd0K/Z8vfjS9XjKhwWNqg0R2Po9AcA=3D?= Content-Type: multipart/mixed; boundary="_004_SG2PR01MB4566A3271510061330286E57F0942SG2PR01MB4566apcp_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-7719-20-msonline-outlook-b4c57.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SG2PR01MB4566.apcprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 75a81dae-92b0-4188-0274-08dcc6ad337c X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Aug 2024 15:30:37.5032 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR0101MB4666 Subject: Re: [musl] Adding dns/resolver tests to libc-test --_004_SG2PR01MB4566A3271510061330286E57F0942SG2PR01MB4566apcp_ Content-Type: multipart/alternative; boundary="_000_SG2PR01MB4566A3271510061330286E57F0942SG2PR01MB4566apcp_" --_000_SG2PR01MB4566A3271510061330286E57F0942SG2PR01MB4566apcp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I have made an attempt at fleshing out the resolver tests, please see the f= ile attached. It still needs some polishing, and I am keen to keep building= out the necessary tests, attached is a simple rudimentary res_query() test= . I need to improve the packet and RR parsing, but sending this out to get = some early feedback before I build out more tests. I have just been building the test and the unshare-ns.c framework with the = libc-test build system, executing unshare-ns.exe and passing in resolv_quer= y.exe as intended. Thanks, rw ________________________________ From: Szabolcs Nagy Sent: Sunday, 18 August 2024 9:38 AM To: Rich Felker Cc: musl@lists.openwall.com Subject: Re: [musl] Adding dns/resolver tests to libc-test * Rich Felker [2024-08-17 22:03:28 -0400]: > I've been working on a framework to allow testing of libc resolver/dns > functionality in libc-test, on Linux-based hosts, provided they have > user-namespace functionality. The intent is that these tests would be > made conditional on __linux__ or similar, with the freedom to add > equivalent setup for other systems in the future if desired. thanks. im travelling now will look at it in a few days --_000_SG2PR01MB4566A3271510061330286E57F0942SG2PR01MB4566apcp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,

I have made an attempt at fleshing out the resolver tests, please see = the file attached. It still needs some polishing, and I am keen to keep bui= lding out the necessary tests, attached is a simple rudimentary res_query()= test. I need to improve the packet and RR parsing, but sending this out to get some early feedback before I b= uild out more tests.

I have just been building the test and the unshare-ns.c framework with the = libc-test build system, executing unshare-ns.exe and passing in resolv_quer= y.exe as intended.

Thanks,
rw


From: Szabol= cs Nagy <nsz@port70.net>
Sent: Sunday, 18 August 2024 9:38 AM
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com <musl@lists.openwall.com>
Subject: Re: [musl] Adding dns/resolver tests to libc-test
 
* Rich = Felker <dalias@libc.org> [2024-08-17 22:03:28 -0400]:
> I've been working on a framework to allow testing of libc resolver/dns=
> functionality in libc-test, on Linux-based hosts, provided they have > user-namespace functionality. The intent is that these tests would be<= br> > made conditional on __linux__ or similar, with the freedom to add
> equivalent setup for other systems in the future if desired.

thanks. im travelling now will look at it in a few days
--_000_SG2PR01MB4566A3271510061330286E57F0942SG2PR01MB4566apcp_-- --_004_SG2PR01MB4566A3271510061330286E57F0942SG2PR01MB4566apcp_ Content-Type: text/x-csrc; name="resolv_query.c" Content-Description: resolv_query.c Content-Disposition: attachment; filename="resolv_query.c"; size=4297; creation-date="Tue, 27 Aug 2024 15:28:31 GMT"; modification-date="Tue, 27 Aug 2024 15:30:37 GMT" Content-Transfer-Encoding: base64 I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDx1bmlzdGQuaD4KI2luY2x1ZGUgPHNjaGVkLmg+ CiNpbmNsdWRlIDxzeXMvbW91bnQuaD4KI2luY2x1ZGUgPGFycGEvaW5ldC5oPgojaW5jbHVkZSA8 ZmNudGwuaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPiAKI2luY2x1ZGUgPHN5cy9zb2NrZXQuaD4KI2lu Y2x1ZGUgPHN5cy9pb2N0bC5oPgojaW5jbHVkZSA8c3lzL3RpbWUuaD4KI2luY2x1ZGUgPG5ldC9p Zi5oPgojaW5jbHVkZSA8bmV0aW5ldC9pbi5oPgojaW5jbHVkZSA8c3RyaW5nLmg+CiNpbmNsdWRl IDxkaXJlbnQuaD4KI2luY2x1ZGUgPHN5cy9zdGF0Lmg+CiNpbmNsdWRlIDxwdGhyZWFkLmg+CiNp bmNsdWRlIDxyZXNvbH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XJ5ID0gImV4YW1wbGUuY29tIjsKICAgIGludCBsZW5ndGggPSByZXNfcXVlcnkocXVl cnksIENfQU5ZLCBUX1BUUiwgcmVzX2J1ZmZlciwgc2l6ZW9mKHJlc19idWZmZXIpKTsKICAgCiAg ICAvLyBTaW1wbGUgdGVzdCwgZXhwZWN0IHRoZSByZXN1bHRpbmcgSVAgdG8gYmUgaW4gdGhlIGxh c3QgZm91ciBieXRlcyBvZiAKICAgIC8vIHRoZSBidWZmZXIKICAgIHN0cnVjdCBpbl9hZGRyIHJl dHVybmVkX2FkZHJlc3MgPSB7CiAgICAgICAgLnNfYWRkciA9IHJlc19idWZmZXJbbGVuZ3RoIC0g MV0gPDwgMjQKICAgICAgICAgICAgICAgIHwgcmVzX2J1ZmZlcltsZW5ndGggLSAyXSA8PCAxNgog ICAgICAgICAgICAgICAgfCByZXNfYnVmZmVyW2xlbmd0aCAtIDNdIDw8IDgKICAgICAgICAgICAg ICAgIHwgcmVzX2J1ZmZlcltsZW5ndGggLSA0XQogICAgfTsKICAgIAogICAgVEVTVCghc3RyY21w KGluZXRfbnRvYShyZXR1cm5lZF9hZGRyZXNzKSwgRVhQRUNURURfSVBfQUREUkVTUyksIAogICAg ICAgICAiRXhwZWN0ZWQgaXAgYWRkcmVzcyAlcywgZ290ICVzXG4iLCBFWFBFQ1RFRF9JUF9BRERS RVNTLCBpbmV0X250b2EocmV0dXJuZWRfYWRkcmVzcykpOwogICAgCiAgICB2b2lkICp0aHJlYWRf cmV0dXJuOwogICAgcHRocmVhZF9qb2luKGRuc190aHJlYWQsICZ0aHJlYWRfcmV0dXJuKTsKCiAg ICByZXR1cm4gdF9zdGF0dXM7Cn0KCg== --_004_SG2PR01MB4566A3271510061330286E57F0942SG2PR01MB4566apcp_--