[Cvs-nserver-commits] CVS: cvs-nserver/src acl.c,1.1.2.13,1.1.2.14
Brought to you by:
tyranny
From: Alexey M. <ty...@us...> - 2002-05-29 05:09:51
|
Update of /cvsroot/cvs-nserver/cvs-nserver/src In directory usw-pr-cvs1:/tmp/cvs-serv19871 Modified Files: Tag: NCLI-1-11-1 acl.c Log Message: Log authorization attempts Index: acl.c =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/src/Attic/acl.c,v retrieving revision 1.1.2.13 retrieving revision 1.1.2.14 diff -u -d -r1.1.2.13 -r1.1.2.14 --- acl.c 28 Mar 2002 15:23:26 -0000 1.1.2.13 +++ acl.c 29 May 2002 05:09:48 -0000 1.1.2.14 @@ -20,6 +20,7 @@ #include "cvs.h" #include "acl.h" +#include "audit-log.h" #include "repos.h" #include "acl-admins.h" @@ -38,15 +39,15 @@ struct DIR_ACL *dir_acl; struct BRANCH_ACL *branch_acl; struct BRANCH_ACE *branch_ace; - + int retval = 0; char *xbranch = branch; - if ((xbranch == NULL) || (xbranch[0] == '\0')) - xbranch = "trunk"; - if (!server_active) return 1; + if ((xbranch == NULL) || (xbranch[0] == '\0')) + xbranch = "trunk"; + dir_acl = get_dir_acl(dir, "trunk"); if (dir_acl == NULL) error(1, 0, "Error getting directory ACL for %s: %s", dir, strerror(errno)); @@ -64,10 +65,24 @@ error(0, 0, "%s permission for %s denied for user %s", perm_string, filename, CVS_Username); - return 0; + goto out; } - return 1; + retval = 1; + out: + if (audit_log_active()) { + if (!start_audit_log_line("authz")) { + error(1, 0, "Out of memory"); + } + append_audit_log_line(perm_string); + append_audit_log_line(dir); + append_audit_log_line(filename); + append_audit_log_line(xbranch); + append_audit_log_line(retval ? "granted" : "denied"); + log_audit_event(); + } + + return retval; } int |