Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Mar 2001 22:17:31 +0400 (MSD)
From:      "Ilmar S. Habibulin" <ilmar@ints.ru>
To:        <security@freebsd.org>
Subject:   pam_unix logging patch
Message-ID:  <Pine.BSF.4.33.0103312205530.89026-200000@ws-ilmar.ints.ru>

next in thread | raw e-mail | index | archive | help
  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.

--0-1436966727-986062651=:89026
Content-Type: TEXT/PLAIN; charset=US-ASCII


Here is a patch for log user logins and logouts, that i made in 15 minutes
while studying login&PAM. Why not to use LOG_AUTH and pam_system_log()
with other usefull pam functions to log different events?
And i don't understand why not to move half of login stuff to pam modules,
or even use only pam without ifdefs?

PS. patch is against -current.


--0-1436966727-986062651=:89026
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="pam_unix.c.patch"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.BSF.4.33.0103312217310.89026@ws-ilmar.ints.ru>
Content-Description: 
Content-Disposition: attachment; filename="pam_unix.c.patch"

LS0tIHBhbV91bml4LmMJU2F0IE1heSAgOCAwNTo1OToyNyAxOTk5DQorKysg
cGFtX3R1bml4LmMJU2F0IE1hciAzMSAyMjowMzo0NyAyMDAxDQpAQCAtMzcs
NiArMzcsOCBAQA0KIA0KICNkZWZpbmUgUEFNX1NNX0FVVEgNCiAjZGVmaW5l
IFBBTV9TTV9BQ0NPVU5UDQorI2RlZmluZSBQQU1fU01fU0VTU0lPTg0KKw0K
ICNpbmNsdWRlIDxzZWN1cml0eS9wYW1fbW9kdWxlcy5oPg0KIA0KICNpbmNs
dWRlICJwYW1fbW9kX21pc2MuaCINCkBAIC0xNTgsNiArMTYwLDk1IEBADQog
CX0NCiANCiAJbG9naW5fY2xvc2UobGMpOw0KKwlyZXR1cm4gcmV0dmFsOw0K
K30NCisNCisvKg0KKyNkZWZpbmUgT1BFTl9TRVNTSU9OX0xPRyAiXA0KK3Nl
cnZpY2U6ICVzXG5cDQordXNlciAgIDogJXNcblwNCit0dHkgICAgOiAlc1xu
XA0KK2hvc3QgICA6ICVzXG4iDQorKi8NCisNCisjZGVmaW5lIE9QRU5fU0VT
U0lPTl9MT0cgImxvZ2luIHVzZXIgJXMgb24gJXMgZnJvbSAlcyINCisvKiAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4gICAgIF4gICAg
ICAgXg0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
fCAgICAgfCAgICAgICB8DQorICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICB8ICAgICB8ICAgICAgICstIGhvc3RuYW1lDQorICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICArLSB0dHkN
CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICstIHVz
ZXIgbmFtZQ0KKyovDQorI2RlZmluZSBDTE9TRV9TRVNTSU9OX0xPRyAibG9n
b3V0IHVzZXIgJXMgb24gJXMgZnJvbSAlcyINCisNCitQQU1fRVhURVJOIGlu
dA0KK3BhbV9zbV9vcGVuX3Nlc3Npb24ocGFtX2hhbmRsZV90ICpwYW1oLCBp
bnQgZmxhZ3MsIGludCBhcmdjLA0KKyAgICBjb25zdCBjaGFyICoqYXJndikN
Cit7DQorCWNvbnN0IGNoYXIgKnVzZXI7DQorCWNvbnN0IGNoYXIgKnNlcnZp
Y2U7DQorCWNvbnN0IGNoYXIgKnR0eTsNCisJY29uc3QgY2hhciAqcmhvc3Q7
DQorCWludCByZXR2YWw7DQorDQorCXJldHZhbCA9IHBhbV9nZXRfaXRlbShw
YW1oLCBQQU1fVVNFUiwgKGNvbnN0IHZvaWQgKiopJnVzZXIpOw0KKwlpZiAo
cmV0dmFsICE9IFBBTV9TVUNDRVNTIHx8IHVzZXIgPT0gTlVMTCkNCisJCXJl
dHVybiBQQU1fVVNFUl9VTktOT1dOOw0KKw0KKw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IHJob3N0IDogImxvY2FsaG9zdCIpOw0K
Ky8qDQorCXByaW50ZigicGFtX3NtX2Nsb3NlX3Nlc3Npb24gZm9yIHVzZXIg
JXMsIHVpZCAlZFxuIiwgdXNlciwgZ2V0dWlkKCkpOw0KKyovDQorCXJldHZh
bCA9IFBBTV9TVUNDRVNTOw0KIAlyZXR1cm4gcmV0dmFsOw0KIH0NCiANCg==
--0-1436966727-986062651=:89026--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.33.0103312205530.89026-200000>