From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.kymetacorp.com ([192.81.58.21]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aMLbH-00045Z-11 for barebox@lists.infradead.org; Thu, 21 Jan 2016 20:12:59 +0000 From: Trent Piepho Date: Thu, 21 Jan 2016 20:12:35 +0000 Message-ID: <1453407176.4474.305.camel@rtred1test09.kymeta.local> References: <1453277701-10367-1-git-send-email-uwe@kleine-koenig.org> <1453318040.4474.287.camel@rtred1test09.kymeta.local> <56A0AF31.3040904@kleine-koenig.org> In-Reply-To: <56A0AF31.3040904@kleine-koenig.org> Content-Language: en-US Content-ID: MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH v2] kwboot: do a filetype check before sending the image To: =?utf-8?B?VXdlIEtsZWluZS1Lw7ZuaWc=?= Cc: "barebox@lists.infradead.org" T24gVGh1LCAyMDE2LTAxLTIxIGF0IDExOjEzICswMTAwLCBVd2UgS2xlaW5lLUvDtm5pZyB3cm90 ZToNCg0KPiA+IEFuZCBoYXZpbmcgY29tcGFyZWQgdGhlIHZlcnNpb24gdGFnIHRvIDEsIGNvdWxk bid0IHlvdSB0aGVuIGNhc3QgaW1nDQo+ID4gaW50byBhIHN0cnVjdCBtYWluX2hkcl92MSAqPyAg VGhhdCB3b3VsZCBhdm9pZCBhbGwgdGhlIGhhcmQgY29kZWQgbWFnaWMNCj4gPiBvZmZzZXRzIGlu IHRoZSByZXN0IG9mIHRoZSBjb2RlLiAgVW5sZXNzIGltZyBpc24ndCBhbGlnbmVkPw0KPiANCj4g Li4uIG9yIHRoZSBidWlsZCBtYWNoaW5lIGlzIGJpZyBlbmRpYW4uIChOb3RlIGluIHRoaXMgY2Fz ZSBrd2JpbWF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