[Cvs-nserver-commits] CVS: cvs-nserver/acl branch-acl.c,1.1.2.15,1.1.2.16 check_branch_acl.c,1.1.2.1
Brought to you by:
tyranny
From: Alexey M. <mo...@us...> - 2002-06-07 13:18:42
|
Update of /cvsroot/cvs-nserver/cvs-nserver/acl In directory usw-pr-cvs1:/tmp/cvs-serv28091 Modified Files: Tag: NCLI-1-11-1 branch-acl.c check_branch_acl.c check_dir_acl.c dir-acl.c dir-acl.h Log Message: BUGFIX: fixed bug in incorrect branch acl handling Several declaration/header inclusion cleanups... Index: branch-acl.c =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/acl/Attic/branch-acl.c,v retrieving revision 1.1.2.15 retrieving revision 1.1.2.16 diff -u -d -r1.1.2.15 -r1.1.2.16 --- branch-acl.c 27 Nov 2001 00:24:46 -0000 1.1.2.15 +++ branch-acl.c 7 Jun 2002 13:18:35 -0000 1.1.2.16 @@ -23,12 +23,22 @@ #include <assert.h> #include <errno.h> +#ifdef HAVE_FCNTL_H #include <fcntl.h> +#endif #include <stdio.h> +#ifdef HAVE_STDLIB_H #include <stdlib.h> +#endif +#ifdef HAVE_STRING_H #include <string.h> +#endif +#ifdef HAVE_SYS_STAT_H #include <sys/stat.h> +#endif +#ifdef HAVE_SYS_TYPES_H #include <sys/types.h> +#endif #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -160,7 +170,8 @@ /* no list of users, use permissions on trunk, and then default permissions for directory */ - if (branch_ace->user_acls == NULL) { + if (branch_ace->user_acls == NULL || + (ace = get_user_ace(branch_ace->user_acls, username))==NULL) { struct BRANCH_ACL *branch_acl = branch_ace->acl; struct DIR_ACL *dir_acl = branch_acl->dir_acl; @@ -181,12 +192,6 @@ return default_branch_perm & perm; return ace->perm & perm; } - - ace = get_user_ace(branch_ace->user_acls, username); - - if (ace == NULL) - return branch_perm_none; - return ace->perm & perm; } Index: check_branch_acl.c =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/acl/Attic/check_branch_acl.c,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -u -d -r1.1.2.12 -r1.1.2.13 --- check_branch_acl.c 27 Nov 2001 00:24:46 -0000 1.1.2.12 +++ check_branch_acl.c 7 Jun 2002 13:18:36 -0000 1.1.2.13 @@ -20,9 +20,16 @@ #include "dir-acl.h" #include <assert.h> +#ifdef HAVE_ERRNO_H #include <errno.h> +#endif #include <stdio.h> +#ifdef HAVE_STDLIB_H #include <stdlib.h> +#endif +#ifdef HAVE_STRING_H +#include <string.h> +#endif void Index: check_dir_acl.c =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/acl/Attic/check_dir_acl.c,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -d -r1.1.2.8 -r1.1.2.9 --- check_dir_acl.c 31 Mar 2002 18:23:44 -0000 1.1.2.8 +++ check_dir_acl.c 7 Jun 2002 13:18:36 -0000 1.1.2.9 @@ -23,10 +23,19 @@ #include "user-acl.h" #include <assert.h> +#ifdef HAVE_ERRNO_H #include <errno.h> +#endif +#ifdef HAVE_STDLIB_H #include <stdlib.h> +#endif #include <stdio.h> +#ifdef HAVE_STRING_H +#include <string.h> +#endif +#ifdef HAVE_SYS_STAT_H #include <sys/stat.h> +#endif static void Index: dir-acl.c =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/acl/Attic/dir-acl.c,v retrieving revision 1.1.2.17 retrieving revision 1.1.2.18 diff -u -d -r1.1.2.17 -r1.1.2.18 --- dir-acl.c 20 Apr 2002 15:26:50 -0000 1.1.2.17 +++ dir-acl.c 7 Jun 2002 13:18:36 -0000 1.1.2.18 @@ -26,15 +26,25 @@ /* Is there a better solution ?? */ #include "system.h" +#ifdef HAVE_ERRNO_H #include <errno.h> +#endif +#ifdef HAVE_FCNTL_H #include <fcntl.h> +#endif #include <stdio.h> +#ifdef HAVE_STDLIB_H #include <stdlib.h> +#endif #ifdef HAVE_STRING_H #include <string.h> #endif +#ifdef HAVE_SYS_STAT_H #include <sys/stat.h> +#endif +#ifdef HAVE_SYS_TYPES_H #include <sys/types.h> +#endif #ifdef HAVE_UNISTD_H #include <unistd.h> #endif @@ -438,7 +448,7 @@ return dir_perm_invalid; } -char * +const char * dir_permissions_string (int perm) { if (perm == dir_perm_none) Index: dir-acl.h =================================================================== RCS file: /cvsroot/cvs-nserver/cvs-nserver/acl/Attic/dir-acl.h,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -d -r1.1.2.8 -r1.1.2.9 --- dir-acl.h 30 Mar 2002 16:08:09 -0000 1.1.2.8 +++ dir-acl.h 7 Jun 2002 13:18:36 -0000 1.1.2.9 @@ -63,7 +63,7 @@ int parse_dir_permissions(char *perm_string); -char *dir_permissions_string(int perm); +const char *dir_permissions_string(int perm); int set_dir_ace (struct DIR_ACL *dir_acl, char *username, int perm); |