Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758011AbYAHKrL (ORCPT ); Tue, 8 Jan 2008 05:47:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754453AbYAHKo4 (ORCPT ); Tue, 8 Jan 2008 05:44:56 -0500 Received: from ms0.nttdata.co.jp ([163.135.193.231]:42773 "EHLO ms0.nttdata.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753766AbYAHKoq (ORCPT ); Tue, 8 Jan 2008 05:44:46 -0500 Message-Id: <20080108095003.786172291@nttdata.co.jp> References: <20080108094903.484613061@nttdata.co.jp> User-Agent: quilt/0.46-1 Date: Tue, 08 Jan 2008 18:49:18 +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 15/21] Namespace manipulation control functions. X-OriginalArrivalTime: 08 Jan 2008 09:50:03.0959 (UTC) FILETIME=[D7C26C70: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: 33989 Lines: 449 --boundary-1 Content-Disposition: inline; filename="tomoyo-mount.patch" Content-Type: application/octect-stream Content-Transfer-Encoding: base64 VE9NT1lPIExpbnV4IGNoZWNrcyBtb3VudCBwZXJtaXNzaW9uIGJhc2VkIG9uDQpkZXZpY2UgbmFt ZSwgbW91bnQgcG9pbnQsIGZpbGVzeXN0ZW0gdHlwZSBhbmQgb3B0aW9uYWwgZmxhZ3MuDQpUT01P WU8gTGludXggYWxzbyBjaGVja3MgcGVybWlzc2lvbiBpbiB1bW91bnQgYW5kIHBpdm90X3Jvb3Qu DQoNCkVhY2ggcGVybWlzc2lvbiBjYW4gYmUgYXV0b21hdGljYWxseSBhY2N1bXVsYXRlZCBpbnRv DQp0aGUgcG9saWN5IHVzaW5nICdsZWFybmluZyBtb2RlJy4NCg0KU2lnbmVkLW9mZi1ieTogS2Vu dGFybyBUYWtlZGEgPHRha2VkYWtuQG50dGRhdGEuY28uanA+DQpTaWduZWQtb2ZmLWJ5OiBUZXRz dW8gSGFuZGEgPHBlbmd1aW4ta2VybmVsQEktbG92ZS5TQUtVUkEubmUuanA+DQotLS0NCiBzZWN1 cml0eS90b21veW8vbW91bnQuYyB8ICA5MDggKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrDQogMSBmaWxlIGNoYW5nZWQsIDkwOCBpbnNlcnRpb25zKCspDQoN Ci0tLSAvZGV2L251bGwNCisrKyBsaW51eC0yLjYtbW0vc2VjdXJpdHkvdG9tb3lvL21vdW50LmMN CkBAIC0wLDAgKzEsOTA4IEBADQorLyoNCisgKiBzZWN1cml0eS90b21veW8vbW91bnQuYw0KKyAq DQorICogTW91bnQgYWNjZXNzIGNvbnRyb2wgZnVuY3Rpb25zIGZvciBUT01PWU8gTGludXguDQor ICovDQorDQorI2luY2x1ZGUgInRvbW95by5oIg0KKyNpbmNsdWRlICJyZWFscGF0aC5oIg0KKw0K Ky8qKioqKiBLRVlXT1JEUyBmb3IgbW91bnQgcmVzdHJpY3Rpb25zLiAqKioqKi8NCisNCisjZGVm aW5lIE1PVU5UX0JJTkRfS0VZV09SRCAgICAJICAgICAgIi0tYmluZCINCisjZGVmaW5lIE1PVU5U X01PVkVfS0VZV09SRCAgICAJICAgICAgIi0tbW92ZSINCisjZGVmaW5lIE1PVU5UX1JFTU9VTlRf S0VZV09SRCAJICAgICAgIi0tcmVtb3VudCINCisjZGVmaW5lIE1PVU5UX01BS0VfVU5CSU5EQUJM RV9LRVlXT1JEICItLW1ha2UtdW5iaW5kYWJsZSINCisjZGVmaW5lIE1PVU5UX01BS0VfUFJJVkFU RV9LRVlXT1JEICAgICItLW1ha2UtcHJpdmF0ZSINCisjZGVmaW5lIE1PVU5UX01BS0VfU0xBVkVf S0VZV09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QkJ aWYgKGlzX2VuZm9yY2UgJiYNCisJCQkgICAgdG15X3N1cGVydmlzb3IoIiMgJXMgaXMgcmVxdWVz dGluZ1xubW91bnQgb24gJXNcbiIsDQorCQkJCQkgICBleGVuYW1lLCBkaXIpID09IDApDQorCQkJ CWVycm9yID0gMDsNCisNCisJCQl0bXlfZnJlZShleGVuYW1lKTsNCisJCX0NCisJCXRteV9mcmVl KGRpcik7DQorDQorCQlpZiAoaXNfZW5mb3JjZSkNCisJCQlyZXR1cm4gZXJyb3I7DQorCX0NCisN CisJcmV0dXJuIDA7DQorfQ0KKw0KKy8qKioqKioqKioqKioqKioqKioqKioqKiogIFVNT1VOVCBS RVNUUklDVElPTiBIQU5ETEVSICAqKioqKioqKioqKioqKioqKioqKioqKiovDQorDQorc3RhdGlj IExJU1RfSEVBRChub191bW91bnRfbGlzdCk7DQorDQorLyogQWRkIG9yIHJlbW92ZSBhIG5vLXVu bW91bnQgZW50cnkuICovDQorc3RhdGljIGludCB0bXlfYWRkX25vX3Vtb3VudF9hY2woY29uc3Qg Y2hhciAqZGlyLCBjb25zdCBib29sIGlzX2RlbGV0ZSkNCit7DQorCXN0cnVjdCBub191bW91bnRf ZW50cnkgKm5ld19lbnRyeTsNCisJc3RydWN0IG5vX3Vtb3VudF9lbnRyeSAqcHRyOw0KKwljb25z dCBzdHJ1Y3QgcGF0aF9pbmZvICpzYXZlZF9kaXI7DQorCXN0YXRpYyBERUZJTkVfTVVURVgobXV0 ZXgpOw0KKwlpbnQgZXJyb3IgPSAtRU5PTUVNOw0KKw0KKwlpZiAoIXRteV9jb3JyZWN0X3BhdGgo ZGlyLCAxLCAwLCAxLCBfX0ZVTkNUSU9OX18pKQ0KKwkJcmV0dXJuIC1FSU5WQUw7DQorCXNhdmVk X2RpciA9IHRteV9zYXZlX25hbWUoZGlyKTsNCisJaWYgKCFzYXZlZF9kaXIpDQorCQlyZXR1cm4g LUVOT01FTTsNCisNCisJbXV0ZXhfbG9jaygmbXV0ZXgpOw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mludGYoaGVhZCwgVE1ZX0FMTE9XX1BJVk9U X1JPT1QgIiVzICVzXG4iLA0KKwkJCQkgIHB0ci0+bmV3X3Jvb3QtPm5hbWUsIHB0ci0+b2xkX3Jv b3QtPm5hbWUpKQ0KKwkJCXJldHVybiAtRU5PTUVNOw0KKwl9DQorCXJldHVybiAwOw0KK30NCg0K LS0gDQo= --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/