[OpenAFS-devel] Alternate cell PAM patch
Charles Clancy
security@xauth.net
Tue, 25 Jun 2002 10:49:03 -0500 (CDT)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---559023410-1804928587-1025020143=:29215
Content-Type: TEXT/PLAIN; charset=US-ASCII
> Not specifying the "cell" argument causes the expected behavior of
> authenticating against the local cell.
Actually, I lied. The fixed patch is attached. I guess the ka_*
functions want a NULL realm rather than a "\0" realm in order to do local
authentication.
[ t charles clancy ]-[ tclancy@uiuc.edu ]-[ uiuc.edu/~tclancy ]
---559023410-1804928587-1025020143=:29215
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="multi-cell-pam.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.4.44.0206251049030.29215@ismene>
Content-Description:
Content-Disposition: attachment; filename="multi-cell-pam.patch"
LS0tIHNyYy9wYW0vYWZzX2F1dGguYwlXZWQgRGVjIDI2IDE0OjIzOjAzIDIw
MDENCisrKyBzcmMvcGFtL2Fmc19hdXRoLmMJVHVlIEp1biAyNSAxMDo0MTow
OSAyMDAyDQpAQCAtNDcsNiArNDcsNyBAQA0KICAgICBpbnQgaWdub3JlX3Vp
ZCAgPSAwOw0KICAgICB1aWRfdCBpZ25vcmVfdWlkX2lkID0gMDsNCiAgICAg
Y2hhciBteV9wYXNzd29yZF9idWZbMjU2XTsNCisgICAgY2hhciAqY2VsbF9w
dHI9TlVMTDsNCiAgICAgLyoNCiAgICAgICogdGhlc2Ugb3B0aW9ucyBhcmUg
YWRkZWQgdG8gaGFuZGxlIHN0dXBpZCBhcHBzLCB3aGljaCB3b24ndCBjYWxs
DQogICAgICAqIHBhbV9zZXRfY3JlZCgpDQpAQCAtMTA5LDYgKzExMCwxNCBA
QA0KIAkJICAgICAgICBwYW1fYWZzX3N5c2xvZyhMT0dfRVJSLCBQQU1BRlNf
SUdOT1JFVUlELCBhcmd2W2ldKTsNCiAgICAgIC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AgICAgICAgICAgYXV0
aF9vayA9ICEgZG9fa2xvZyh1c2VyLCBwYXNzd29yZCwgIjAwOjAwOjAxIik7
DQorICAgICAgICAgICAgICAgYXV0aF9vayA9ICEgZG9fa2xvZyh1c2VyLCBw
YXNzd29yZCwgIjAwOjAwOjAxIiwgY2VsbF9wdHIpOw0KIAkgICAgICAga3Rj
X0ZvcmdldEFsbFRva2VucygpOw0KIAkgICAgfSBlbHNlIHsNCiAgICAgICAg
ICAgICBpZiAoIGthX1ZlcmlmeVVzZXJQYXNzd29yZCgNCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgICBLQV9VU0VSQVVUSF9WRVJTSU9OLA0KICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHVzZXIsIC8qIGtlcmJlcm9zIG5hbWUg
Ki8NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY2hhciAqKTAsIC8q
IGluc3RhbmNlICovDQotICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNo
YXIgKikwLCAvKiByZWFsbSAqLw0KKyAgICAgICAgICAgICAgICAgICAgICAg
ICAgIGNlbGxfcHRyLCAvKiByZWFsbSAqLw0KICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICBwYXNzd29yZCwgLyogcGFzc3dvcmQgKi8NCiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgMCwgLyogc3BhcmUgMiAqLw0KICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAmcmVhc29uIC8qIGVycm9yIHN0cmlu
ZyAqLw0KQEAgLTI4OSwxMyArMjk4LDEzIEBADQogCX0NCiAJICAgIA0KIAlp
ZiAoICBmbGFncyAmIFBBTV9FU1RBQkxJU0hfQ1JFRCApIHsNCi0JICAgaWYg
KHVzZV9rbG9nKSBhdXRoX29rID0gISBkb19rbG9nKHVzZXIsIHBhc3N3b3Jk
LCBOVUxMKTsNCisJICAgaWYgKHVzZV9rbG9nKSBhdXRoX29rID0gISBkb19r
bG9nKHVzZXIsIHBhc3N3b3JkLCBOVUxMLCBjZWxsX3B0cik7DQogCSAgIGVs
c2Ugew0KIAkgICAgaWYgKCBrYV9Vc2VyQXV0aGVudGljYXRlR2VuZXJhbCgN
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBLQV9VU0VSQVVUSF9WRVJT
SU9OLA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZXIsIC8qIGtl
cmJlcm9zIG5hbWUgKi8NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAo
Y2hhciAqKTAsIC8qIGluc3RhbmNlICovDQotICAgICAgICAgICAgICAgICAg
ICAgICAgICAgKGNoYXIgKikwLCAvKiByZWFsbSAqLw0KKyAgICAgICAgICAg
ICAgICAgICAgICAgICAgIGNlbGxfcHRyLCAvKiByZWFsbSAqLw0KICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBwYXNzd29yZCwgLyogcGFzc3dvcmQg
Ki8NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgLyogZGVmYXVs
dCBsaWZldGltZSAqLw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAm
cGFzc3dvcmRfZXhwaXJlcywNCi0tLSBzcmMvcGFtL2Fmc19tZXNzYWdlLmMJ
VGh1IFNlcCAgNiAyMzozNjo0NCAyMDAxDQorKysgc3JjL3BhbS9hZnNfbWVz
c2FnZS5jCVR1ZSBKdW4gMjUgMDk6NDc6MjAgMjAwMg0KQEAgLTg1LDYgKzg1
LDcgQEANCiAgICAgImthIGVycm9yLCBjb2RlPSVkIiwgICAgICAgICAgICAg
ICAgICAgICAgICAvKiA0NDogS0FFUlJPUiAgICAgICAgICAqLw0KICAgICAi
UGFzc3dvcmRzIGFyZSBub3QgZXF1YWwiLCAgICAgICAgICAgICAgICAgIC8q
IDQ1OiBORV9QQVNTV09SRCAgICAgICovDQogICAgICJBRlMgaWdub3Jpbmcg
dW5yZWdpc3RlcmVkIHVzZXIgJXNcbiIgICAgICAgLyogNDY6IElHTk9SRV9V
TlJFRyAgICAg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