Index: checkacl.c =================================================================== --- checkacl.c (Revision 233922) +++ checkacl.c (Arbeitskopie) @@ -24,9 +24,9 @@ #include #include -#define ACCESS "/s/svn/base/conf/access" +#define SRCACCESS "/s/svn/base/conf/access" #define DOCACCESS "/home/dcvs/CVSROOT/access" -#define PORTSACCESS "/home/pcvs/CVSROOT/access" +#define PORTSACCESS "/s/svn/ports/conf/access" static char username[32]; @@ -83,6 +83,10 @@ int ngroups; int writeable; int karma; + int doccommit; + int portscommit; + int srccommit; + int srckarma; #ifdef PORTSACCESS int portskarma; #endif @@ -91,6 +95,7 @@ #endif const char *comma; + srckarma = 0; #ifdef PORTSACCESS portskarma = 0; #endif @@ -98,6 +103,9 @@ dockarma = 0; #endif karma = 0; + doccommit = 0; + portscommit = 0; + srccommit = 0; writeable = 0; pw = getpwuid(getuid()); if (pw == NULL) { @@ -109,6 +117,17 @@ exit(1); } + if (argc == 2) { + if (strcmp(argv[1], "src") == 0) + srccommit = 1; + if (strcmp(argv[1], "ports") == 0) + portscommit = 1; + if (strcmp(argv[1], "doc") == 0) + doccommit = 1; + } else { + srccommit = 1; + } + /* save in a static buffer */ strlcpy(username, pw->pw_name, sizeof(username)); @@ -130,28 +149,30 @@ if (!writeable) printf("export SVN_READONLY=y\n"); - fp = fopen(ACCESS, "r"); + fp = fopen(SRCACCESS, "r"); if (fp == NULL) { - msg("Cannot open %s", ACCESS); + msg("Cannot open %s", SRCACCESS); exit(1); } else { - karma += karmacheck(fp, pw->pw_name); + srckarma += karmacheck(fp, pw->pw_name); fclose(fp); } #ifdef DOCACCESS - if (karma == 0 && (fp = fopen(DOCACCESS, "r")) != NULL) { + if ((fp = fopen(DOCACCESS, "r")) != NULL) { dockarma += karmacheck(fp, pw->pw_name); fclose(fp); } #endif #ifdef PORTSACCESS - if (karma == 0 && (fp = fopen(PORTSACCESS, "r")) != NULL) { + if ((fp = fopen(PORTSACCESS, "r")) != NULL) { portskarma += karmacheck(fp, pw->pw_name); fclose(fp); } #endif - if (karma == 0) { + if ((srccommit == 1 && srckarma == 0) || + (portscommit == 1 && portskarma == 0) || + (doccommit == 1 && dockarma == 0)) { strcpy(committag, "SVN_COMMIT_ATTRIB="); comma = ""; #ifdef DOCACCESS @@ -170,11 +191,21 @@ karma += portskarma; } #endif + if (srckarma > 0) { + strcat(committag, comma); + strcat(committag, "src"); + comma = ","; + karma += srckarma; + } if (karma != 0) { printf("export %s\n", committag); } + } else { + karma += dockarma; + karma += portskarma; + karma += srckarma; } - + if (karma == 0) { /* If still zero, its a readonly access */ printf("export SVN_READONLY=y\n");