Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756689AbYAHKi5 (ORCPT ); Tue, 8 Jan 2008 05:38:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754141AbYAHKgY (ORCPT ); Tue, 8 Jan 2008 05:36:24 -0500 Received: from ms1.nttdata.co.jp ([163.135.193.232]:40593 "EHLO ms1.nttdata.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753796AbYAHKgK (ORCPT ); Tue, 8 Jan 2008 05:36:10 -0500 X-Greylist: delayed 2759 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Jan 2008 05:35:56 EST Message-Id: <20080108094959.294264947@nttdata.co.jp> References: <20080108094903.484613061@nttdata.co.jp> User-Agent: quilt/0.46-1 Date: Tue, 08 Jan 2008 18:49:10 +0900 From: Kentaro Takeda To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Kentaro Takeda , Tetsuo Handa Subject: [TOMOYO #6 07/21] Memory and pathname management functions. X-OriginalArrivalTime: 08 Jan 2008 09:49:59.0943 (UTC) FILETIME=[D55DA170:01C851DB] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="boundary-1" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 23418 Lines: 311 --boundary-1 Content-Disposition: inline; filename="tomoyo-realpath.patch" Content-Type: application/octect-stream Content-Transfer-Encoding: base64 QmFzaWMgZnVuY3Rpb25zIHRvIGdldCBjYW5vbmljYWxpemVkIGFic29sdXRlIHBhdGhuYW1lcw0K Zm9yIFRPTU9ZTyBMaW51eC4gRXZlbiB0aGUgcmVxdWVzdGVkIHBhdGhuYW1lIGlzIHN5bWxpbmso KWVkDQpvciBjaHJvb3QoKWVkLCBUT01PWU8gTGludXggdXNlcyB0aGUgb3JpZ2luYWwgcGF0aG5h bWUuDQoNClNpZ25lZC1vZmYtYnk6IEtlbnRhcm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BtZW1vcnkgbGVha3MuDQorICovDQor dm9pZCB0bXlfZnJlZShjb25zdCB2b2lkICpwKQ0KK3sNCisJc3RydWN0IGxpc3RfaGVhZCAqdjsN CisJc3RydWN0IGNhY2hlX2VudHJ5ICplbnRyeSA9IE5VTEw7DQorCWlmICghcCkNCisJCXJldHVy bjsNCisNCisJLyoqKioqIENSSVRJQ0FMIFNFQ1RJT04gU1RBUlQgKioqKiovDQorCXNwaW5fbG9j aygmY2FjaGVfbGlzdF9sb2NrKTsNCisJbGlzdF9mb3JfZWFjaF9wcmV2KHYsICZjYWNoZV9saXN0 KSB7DQorCQllbnRyeSA9IGxpc3RfZW50cnkodiwgc3RydWN0IGNhY2hlX2VudHJ5LCBsaXN0KTsN CisJCWlmIChlbnRyeS0+cHRyICE9IHApIHsNCisJCQllbnRyeSA9IE5VTEw7DQorCQkJY29udGlu dWU7DQorCQl9DQorCQlsaXN0X2RlbCgmZW50cnktPmxpc3QpOw0KKwkJZHluYW1pY19tZW1vcnlf c2l6ZSAtPSBlbnRyeS0+c2l6ZTsNCisJCWJyZWFrOw0KKwl9DQorCXNwaW5fdW5sb2NrKCZjYWNo ZV9saXN0X2xvY2spOw0KKwkvKioqKiogQ1JJVElDQUwgU0VDVElPTiBFTkQgKioqKiovDQorDQor CWlmIChlbnRyeSkgew0KKwkJa2ZyZWUocCk7DQorCQlrbWVtX2NhY2hlX2ZyZWUodG15X2NhY2hl cCwgZW50cnkpOw0KKwl9IGVsc2UNCisJCXByaW50ayhLRVJOX0lORk8gIkJVRzogdG15X2ZyZWUo KSB3aXRoIGludmFsaWQgcG9pbnRlci5cbiIpOw0KKw0KK30NCg0KLS0gDQo= --boundary-1-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/