Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl2/xcvs/dist/src add acl support
details: https://anonhg.NetBSD.org/src/rev/6586fdbbf33e
branches: trunk
changeset: 777899:6586fdbbf33e
user: christos <christos%NetBSD.org@localhost>
date: Thu Mar 08 20:48:02 2012 +0000
description:
add acl support
diffstat:
external/gpl2/xcvs/dist/src/add.c | 38 +++++++++++++++++
external/gpl2/xcvs/dist/src/admin.c | 19 ++++++++
external/gpl2/xcvs/dist/src/annotate.c | 19 ++++++++
external/gpl2/xcvs/dist/src/commit.c | 28 ++++++++++++
external/gpl2/xcvs/dist/src/diff.c | 74 ++++++++++++++++++++++++++++++++++
external/gpl2/xcvs/dist/src/remove.c | 19 ++++++++
6 files changed, 197 insertions(+), 0 deletions(-)
diffs (271 lines):
diff -r 6d093ac78afb -r 6586fdbbf33e external/gpl2/xcvs/dist/src/add.c
--- a/external/gpl2/xcvs/dist/src/add.c Thu Mar 08 20:47:45 2012 +0000
+++ b/external/gpl2/xcvs/dist/src/add.c Thu Mar 08 20:48:02 2012 +0000
@@ -401,6 +401,25 @@
}
else
{
+/* cvsacl patch */
+#ifdef SERVER_SUPPORT
+ if (use_cvs_acl /* && server_active */)
+ {
+ if (!access_allowed (finfo.file, repository,
+ vers->tag, 6, NULL, NULL, 1))
+ {
+ if (stop_at_first_permission_denied)
+ error (1, 0, "permission denied for %s",
+ Short_Repository (finfo.repository));
+ else
+ error (0, 0, "permission denied for %s/%s",
+ Short_Repository (finfo.repository),
+ finfo.file);
+
+ return (0);
+ }
+ }
+#endif
/* There is a user file, so build the entry for it */
if (build_entry (repository, finfo.file, vers->options,
message, entries, vers->tag) != 0)
@@ -675,6 +694,25 @@
&& isdir (finfo.file)
&& !wrap_name_has (finfo.file, WRAP_TOCVS))
{
+
+/* cvsacl patch */
+#ifdef SERVER_SUPPORT
+ if (use_cvs_acl /* && server_active */)
+ {
+ if (!access_allowed (NULL, repository, NULL, 6, NULL, NULL, 1))
+ {
+ if (stop_at_first_permission_denied)
+ error (1, 0, "permission denied for %s",
+ Short_Repository (finfo.repository));
+ else
+ error (0, 0, "permission denied for %s/%s",
+ Short_Repository (finfo.repository), finfo.file);
+
+ return (0);
+ }
+ }
+#endif
+
err += add_directory (&finfo);
}
else
diff -r 6d093ac78afb -r 6586fdbbf33e external/gpl2/xcvs/dist/src/admin.c
--- a/external/gpl2/xcvs/dist/src/admin.c Thu Mar 08 20:47:45 2012 +0000
+++ b/external/gpl2/xcvs/dist/src/admin.c Thu Mar 08 20:48:02 2012 +0000
@@ -690,6 +690,25 @@
vers = Version_TS (finfo, NULL, NULL, NULL, 0, 0);
+/* cvsacl patch */
+#ifdef SERVER_SUPPORT
+ if (use_cvs_acl /* && server_active */)
+ {
+ if (!access_allowed (finfo->file, finfo->repository, NULL, 2,
+ NULL, NULL, 1))
+ {
+ if (stop_at_first_permission_denied)
+ error (1, 0, "permission denied for %s",
+ Short_Repository (finfo->repository));
+ else
+ error (0, 0, "permission denied for %s/%s",
+ Short_Repository (finfo->repository), finfo->file);
+
+ return (0);
+ }
+ }
+#endif
+
version = vers->vn_user;
if (version != NULL && strcmp (version, "0") == 0)
{
diff -r 6d093ac78afb -r 6586fdbbf33e external/gpl2/xcvs/dist/src/annotate.c
--- a/external/gpl2/xcvs/dist/src/annotate.c Thu Mar 08 20:47:45 2012 +0000
+++ b/external/gpl2/xcvs/dist/src/annotate.c Thu Mar 08 20:48:02 2012 +0000
@@ -267,6 +267,25 @@
if (version == NULL)
return 0;
+/* cvsacl patch */
+#ifdef SERVER_SUPPORT
+ if (use_cvs_acl /* && server_active */)
+ {
+ if (!access_allowed (finfo->file, finfo->repository, version, 5,
+ NULL, NULL, 1))
+ {
+ if (stop_at_first_permission_denied)
+ error (1, 0, "permission denied for %s",
+ Short_Repository (finfo->repository));
+ else
+ error (0, 0, "permission denied for %s/%s",
+ Short_Repository (finfo->repository), finfo->file);
+
+ return (0);
+ }
+ }
+#endif
+
/* Distinguish output for various files if we are processing
several files. */
cvs_outerr ("\nAnnotations for ", 0);
diff -r 6d093ac78afb -r 6586fdbbf33e external/gpl2/xcvs/dist/src/commit.c
--- a/external/gpl2/xcvs/dist/src/commit.c Thu Mar 08 20:47:45 2012 +0000
+++ b/external/gpl2/xcvs/dist/src/commit.c Thu Mar 08 20:48:02 2012 +0000
@@ -1379,6 +1379,34 @@
return 0;
ci = p->data;
+
+/* cvsacl patch */
+#ifdef SERVER_SUPPORT
+ if (use_cvs_acl /* && server_active */)
+ {
+ int whichperm;
+ if (ci->status == T_MODIFIED)
+ whichperm = 3;
+ else if (ci->status == T_ADDED)
+ whichperm = 6;
+ else if (ci->status == T_REMOVED)
+ whichperm = 7;
+
+ if (!access_allowed (finfo->file, finfo->repository, ci->tag, whichperm,
+ NULL, NULL, 1))
+ {
+ if (stop_at_first_permission_denied)
+ error (1, 0, "permission denied for %s",
+ Short_Repository (finfo->repository));
+ else
+ error (0, 0, "permission denied for %s/%s",
+ Short_Repository (finfo->repository), finfo->file);
+
+ return (0);
+ }
+ }
+#endif
+
if (ci->status == T_MODIFIED)
{
if (finfo->rcs == NULL)
diff -r 6d093ac78afb -r 6586fdbbf33e external/gpl2/xcvs/dist/src/diff.c
--- a/external/gpl2/xcvs/dist/src/diff.c Thu Mar 08 20:47:45 2012 +0000
+++ b/external/gpl2/xcvs/dist/src/diff.c Thu Mar 08 20:48:02 2012 +0000
@@ -498,6 +498,46 @@
{
/* Skip all the following checks regarding the user file; we're
not using it. */
+
+/* cvsacl patch */
+#ifdef SERVER_SUPPORT
+ if (use_cvs_acl /* && server_active */)
+ {
+ if (diff_rev1)
+ {
+ if (!access_allowed (NULL, finfo->repository, diff_rev1, 5,
+ NULL, NULL, 1))
+ {
+ if (stop_at_first_permission_denied)
+ error (1, 0, "permission denied for %s",
+ Short_Repository (finfo->repository));
+ else
+ error (0, 0, "permission denied for %s/%s",
+ Short_Repository (finfo->repository),
+ finfo->file);
+
+ return (0);
+ }
+ }
+ if (diff_rev2)
+ {
+ if (!access_allowed (NULL, finfo->repository, diff_rev2, 5,
+ NULL, NULL, 1))
+ {
+ if (stop_at_first_permission_denied)
+ error (1, 0, "permission denied for %s",
+ Short_Repository (finfo->repository));
+ else
+ error (0, 0, "permission denied for %s/%s",
+ Short_Repository (finfo->repository),
+ finfo->file);
+
+ return (0);
+ }
+ }
+ }
+#endif
+
}
else if (vers->vn_user == NULL)
{
@@ -840,6 +880,40 @@
if (!isdir (dir))
return R_SKIP_ALL;
+/* cvsacl patch */
+#ifdef SERVER_SUPPORT
+ if (use_cvs_acl /* && server_active */)
+ {
+ if (diff_rev1)
+ {
+ if (!access_allowed (NULL, update_dir, diff_rev1, 5, NULL, NULL, 1))
+ {
+ if (stop_at_first_permission_denied)
+ error (1, 0, "permission denied for %s",
+ Short_Repository (update_dir));
+ else
+ error (0, 0, "permission denied for %s/%s",
+ Short_Repository (update_dir), update_dir);
+
+ return (0);
+ }
+ }
+ if (diff_rev2)
+ {
+ if (!access_allowed (NULL, update_dir, diff_rev2, 5, NULL, NULL, 1))
+ {
+ if (stop_at_first_permission_denied)
+ error (1, 0, "permission denied for %s",
+ Short_Repository (update_dir));
+ else
+ error (0, 0, "permission denied for %s/%s",
+ Short_Repository (update_dir), update_dir);
+
+ return (0);
+ }
+ }
+ }
+#endif
if (!quiet)
error (0, 0, "Diffing %s", update_dir);
return R_PROCESS;
diff -r 6d093ac78afb -r 6586fdbbf33e external/gpl2/xcvs/dist/src/remove.c
--- a/external/gpl2/xcvs/dist/src/remove.c Thu Mar 08 20:47:45 2012 +0000
+++ b/external/gpl2/xcvs/dist/src/remove.c Thu Mar 08 20:48:02 2012 +0000
@@ -241,6 +241,25 @@
{
char *fname;
+/* cvsacl patch */
+#ifdef SERVER_SUPPORT
+ if (use_cvs_acl /* && server_active */)
+ {
+ if (!access_allowed (finfo->file, finfo->repository, vers->tag, 7,
+ NULL, NULL, 1))
+ {
+ if (stop_at_first_permission_denied)
+ error (1, 0, "permission denied for %s",
+ Short_Repository (finfo->repository));
+ else
+ error (0, 0, "permission denied for %s/%s",
+ Short_Repository (finfo->repository), finfo->file);
+
+ return (0);
+ }
+ }
+#endif
+
/* Re-register it with a negative version number. */
fname = Xasprintf ("-%s", vers->vn_user);
Register (finfo->entries, finfo->file, fname, vers->ts_rcs,
Home |
Main Index |
Thread Index |
Old Index