[Mono-list] Mono.Posix.Syscall
Loren Bandiera
lorenb@mmgsecurity.com
Tue, 14 Sep 2004 16:31:51 -0400 (EDT)
------=_20040914163151_45648
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
I've been using Mono for some software I'm writing and I needed a way to
get an entry from a UNIX password file. I looked around
Mono.Posix.Syscall but I didn't find what I was looking for.
So I wrote some code to allow Mono.Posix.Syscall to call getpwent_r(3).
See attached patches.
My problem is now, I'm having issues trying to test it. I patched the mcs
and mono source, built it and installed it in /usr/local. When trying to
compile a simple program to use my new code, it told me it couldn't find
it in Mono.Posix.Syscall. I guess my default mono install is causing the
confusion.
Since I run Gentoo Linux, my next idea was to modify the Mono ebuild and
have it add my patches. I didn't get too far with that due to some other
issues in the ebuild, which I won't get into here.
Can I have two instances of mono installed? (say in /usr and /usr/local?)
If so, did I miss something? Or what is the recommended way to this?
--
Loren Bandiera, CISSP <lorenb@mmgsecurity.com>
MMG Security, Inc.
------=_20040914163151_45648
Content-Type: application/octet-stream; name="mcs-Mono.Posix.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="mcs-Mono.Posix.patch"
LS0tIFN5c2NhbGwuY3Mub3JpZwkyMDA0LTA5LTE0IDExOjQ2OjUwLjg5MDYzMTAyOCAtMDQwMAor
KysgU3lzY2FsbC5jcwkyMDA0LTA5LTE0IDE0OjQ2OjA0LjM3MDkzOTYzNiAtMDQwMApAQCAtNDkw
LDcgKzQ5MCwzMSBAQAogCQkKIAkJW0RsbEltcG9ydCAoIk1vbm9Qb3NpeEhlbHBlciIsIEVudHJ5
UG9pbnQ9ImhlbHBlcl9Nb25vX1Bvc2l4X3JlYWRkaXIiKV0KIAkJcHVibGljIHN0YXRpYyBleHRl
cm4gc3RyaW5nIHJlYWRkaXIoSW50UHRyIGRpcik7CisKKwkJW0RsbEltcG9ydCAoIk1vbm9Qb3Np
eEhlbHBlciIpXQorCQlpbnRlcm5hbCBleHRlcm4gc3RhdGljIGludCBoZWx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CXB1YmxpYyByZWFkb25seSBpbnQgR2lkOworCQlwdWJsaWMgcmVhZG9ubHkgc3RyaW5nIEdl
Y29zOworCQlwdWJsaWMgcmVhZG9ubHkgc3RyaW5nIEhvbWVEaXJlY3Rvcnk7CisJCXB1YmxpYyBy
ZWFkb25seSBzdHJpbmcgU2hlbGw7CisKKwkJaW50ZXJuYWwgUGFzc3dkICgKKwkJCXN0cmluZyBh
Y2NvdW50LCBzdHJpbmcgcGFzc3dvcmQsIGludCB1aWQsCisJCQlpbnQgZ2lkLCBzdHJpbmcgZ2Vj
b3MsIHN0cmluZyBob21lZGlyLAorCQkJc3RyaW5nIHNoZWxsKSB7CisKKwkJCUFjY291bnQgPSBh
Y2NvdW50OworCQkJUGFzc3dvcmQgPSBwYXNzd29yZDsKKwkJCVVpZCA9IHVpZDsKKwkJCUdpZCA9
IGdpZDsKKwkJCUdlY29zID0gZ2Vjb3M7CisJCQlIb21lRGlyZWN0b3J5ID0gaG9tZWRpcjsKKwkJ
CVNoZWxsID0gc2hlbGw7CisJCisJCX0KKwl9CiB9Cg==
------=_20040914163151_45648
Content-Type: application/octet-stream; name="mono-getpwent.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="mono-getpwent.patch"
LS0tIG1hY3Jvcy5jLm9yaWcJMjAwNC0wOS0xNCAxMTo0NDoyNS42NDY3MTA1MTMgLTA0MDAKKysr
IG1hY3Jvcy5jCTIwMDQtMDktMTQgMTE6NDI6NTcuMzg0Njk2ODQ3IC0wNDAwCkBAIC05NSwzICs5
NSw0MCBAQAogCWlmIChlID09IE5VTEwpIHJldHVybiBOVUxMOwogCXJldHVybiBzdHJkdXAgKGUt
PmRfbmFtZSk7CiB9CisKK2ludCBoZWxwZXJfTW9ub19Qb3NpeF9QYXNzd2QgKGNoYXIgKnVzZXJu
YW1lLAorCWNoYXIgKiphY2NvdW50LAorCWNoYXIgKipwYXNzd29yZCwKKwlpbnQgKnVpZCwKKwlp
bnQgKmdpZCwKKwljaGFyIC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