- Tweaked some comments.
authorWayne Davison <wayned@samba.org>
Tue, 17 May 2005 14:56:12 +0000 (14:56 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 17 May 2005 14:56:12 +0000 (14:56 +0000)
- Use "#ifdef" when checking SUPPORT_ACLS.

acls.diff

index ed90dc9..c76b53b 100644 (file)
--- a/acls.diff
+++ b/acls.diff
@@ -82,8 +82,8 @@ ACLs to a non-ACL-supporting disk should complain.
 +
 +static void expand_rsync_acl(rsync_acl *racl)
 +{
-+      /* first time through, 0 <= 0, so list is expanded:
-+       * diabolical, rsync guys! */
++      /* First time through, 0 <= 0, so list is expanded.
++       * (Diabolical, rsync guys!) */
 +      if (racl->malloced <= racl->count) {
 +              rsync_ace *new_ptr;
 +              size_t new_size = racl->malloced + 10;
@@ -247,8 +247,8 @@ ACLs to a non-ACL-supporting disk should complain.
 +
 +static void expand_rsync_acl_list(rsync_acl_list *racl_list)
 +{
-+      /* first time through, 0 <= 0, so list is expanded:
-+       * diabolical, rsync guys! */
++      /* First time through, 0 <= 0, so list is expanded.
++       * (Diabolical, rsync guys!) */
 +      if (racl_list->malloced <= racl_list->count) {
 +              rsync_acl *new_ptr;
 +              size_t new_size;
@@ -274,8 +274,8 @@ ACLs to a non-ACL-supporting disk should complain.
 +#if 0
 +static void free_rsync_acl_list(rsync_acl_list *racl_list)
 +{
-+      /* run this in reverse, so references are freed before referents, */
-+      /* although not currently necessary */
++      /* Run this in reverse, so references are freed before referents,
++       * although not currently necessary. */
 +      while (racl_list->count--) {
 +              rsync_acl *racl = &racl_list->racls[racl_list->count];
 +              if (racl)
@@ -295,9 +295,9 @@ ACLs to a non-ACL-supporting disk should complain.
 +      int *match = (type == SMB_ACL_TYPE_ACCESS) ?
 +                      &access_match : &default_match;
 +      size_t count = racl_list->count;
-+      /* if this is the first time through or we didn't match the last
++      /* If this is the first time through or we didn't match the last
 +       * time, then start at the end of the list, which should be the
-+       * best place to start hunting */
++       * best place to start hunting. */
 +      if (*match == -1)
 +              *match = racl_list->count - 1;
 +      while (count--) {
@@ -310,12 +310,12 @@ ACLs to a non-ACL-supporting disk should complain.
 +      return *match;
 +}
 +
-+/* the general strategy with the tag_type <-> character mapping is that
++/* The general strategy with the tag_type <-> character mapping is that
 + * lowercase implies that no qualifier follows, where uppercase does.
-+ * same sorta thing for the acl type (access or default) itself, but
++ * A similar idiom for the acl type (access or default) itself, but
 + * lowercase in this instance means there's no ACL following, so the
 + * ACL is a repeat, so the receiver should reuse the last of the same
-+ * type ACL */
++ * type ACL. */
 +
 +static void send_rsync_acl(int f, const rsync_acl *racl)
 +{
@@ -353,9 +353,9 @@ ACLs to a non-ACL-supporting disk should complain.
 +              write_byte(f, race->access);
 +              if (isupper((int)ch)) {
 +                      write_int(f, race->id);
-+                      /* FIXME: sorta wasteful. we should maybe buffer as
++                      /* FIXME: sorta wasteful: we should maybe buffer as
 +                       * many ids as max(ACL_USER + ACL_GROUP) objects to
-+                       * keep from making so many calls */
++                       * keep from making so many calls. */
 +                      if (ch == 'U')
 +                              add_uid(race->id);
 +                      else
@@ -374,8 +374,8 @@ ACLs to a non-ACL-supporting disk should complain.
 +              "unknown SMB_ACL_TYPE_T";
 +}
 +
-+/* generate the ACL(s) for this flist entry;
-+ * ACL(s) are either sent or cleaned-up by send_acl() below */
++/* Generate the ACL(s) for this flist entry;
++ * ACL(s) are either sent or cleaned-up by send_acl() below. */
 +
 +BOOL make_acl(const struct file_struct *file, const char *fname)
 +{
@@ -404,8 +404,8 @@ ACLs to a non-ACL-supporting disk should complain.
 +      return True;
 +}
 +
-+/* send the make_acl()-generated ACLs for this flist entry,
-+ * or clean up after an flist entry that's not being sent (f == -1) */
++/* Send the make_acl()-generated ACLs for this flist entry,
++ * or clean up after an flist entry that's not being sent (f == -1). */
 +
 +void send_acl(const struct file_struct *file, int f)
 +{
@@ -438,7 +438,7 @@ ACLs to a non-ACL-supporting disk should complain.
 +      }
 +}
 +
-+/* the below stuff is only used by the receiver */
++/* The below stuff is only used by the receiver: */
 +
 +/* structure to hold index to rsync_acl_list member corresponding to
 + * flist->files[i] */
@@ -467,8 +467,8 @@ ACLs to a non-ACL-supporting disk should complain.
 +
 +static void expand_file_acl_index_list(file_acl_index_list *fileaclidx_list)
 +{
-+      /* first time through, 0 <= 0, so list is expanded:
-+       * diabolical, rsync guys! */
++      /* First time through, 0 <= 0, so list is expanded.
++       * (Diabolical, rsync guys!) */
 +      if (fileaclidx_list->malloced <= fileaclidx_list->count) {
 +              file_acl_index *new_ptr;
 +              size_t new_size;
@@ -521,8 +521,8 @@ ACLs to a non-ACL-supporting disk should complain.
 +
 +static void expand_smb_acl_list(smb_acl_list *sacl_list)
 +{
-+      /* first time through, 0 <= 0, so list is expanded:
-+       * diabolical, rsync guys! */
++      /* First time through, 0 <= 0, so list is expanded.
++       * (Diabolical, rsync guys!) */
 +      if (sacl_list->malloced <= sacl_list->count) {
 +              SMB_ACL_T *new_ptr;
 +              size_t new_size;
@@ -942,8 +942,8 @@ ACLs to a non-ACL-supporting disk should complain.
 +      return ret;
 +}
 +
-+/* stuff for redirecting calls to set_acl() from set_perms()
-+ * for keep_backup() */
++/* Stuff for redirecting calls to set_acl() from set_perms()
++ * for keep_backup(). */
 +static const struct file_struct *backup_orig_file = NULL;
 +static const char null_string[] = "";
 +static const char *backup_orig_fname = null_string;
@@ -1090,10 +1090,10 @@ ACLs to a non-ACL-supporting disk should complain.
 +      return updated;
 +}
 +
-+/* enumeration functions for uid mapping */
++/* Enumeration functions for uid mapping: */
 +
-+/* context -- one and only one. should be cycled through once on uid mapping
-+ * and once on gid mapping */
++/* Context -- one and only one.  Should be cycled through once on uid
++ * mapping and once on gid mapping. */
 +static rsync_acl_list *_enum_racl_lists[] = {
 +      &_rsync_acl_lists[0], &_rsync_acl_lists[1], NULL
 +};
@@ -1102,8 +1102,8 @@ ACLs to a non-ACL-supporting disk should complain.
 +static size_t enum_racl_index = 0;
 +static size_t enum_race_index = 0;
 +
-+/* this returns the next tag_type id from the given acl for the next entry,
-+ * or it returns 0 if there are no more tag_type ids in the acl */
++/* This returns the next tag_type id from the given acl for the next entry,
++ * or it returns 0 if there are no more tag_type ids in the acl. */
 +
 +static id_t next_ace_id(SMB_ACL_TAG_T tag_type, const rsync_acl *racl)
 +{
@@ -4723,8 +4723,8 @@ ACLs to a non-ACL-supporting disk should complain.
  #endif
  
 +      /* If this is a directory, SET_ACL() will be called on the cleanup
-+       * receive_generator() pass--if we called it here, we might clobber
-+       * writability on the directory. everything else is OK to do now. */
++       * receive_generator() pass (if we called it here, we might clobber
++       * writability on the directory). Everything else is OK to do now. */
 +      if (!S_ISDIR(st->st_mode)) {
 +              if (SET_ACL(fname, file) == 0)
 +                      updated = 1;
@@ -5132,14 +5132,14 @@ ACLs to a non-ACL-supporting disk should complain.
                }
        }
  
-+#if SUPPORT_ACLS
++#ifdef SUPPORT_ACLS
 +      if (preserve_acls && !numeric_ids) {
 +              id_t id;
-+              /* the enumerations don't return 0 except to flag the last
-+               * entry, since uidlist doesn't munge 0 anyway */
-+              while ((id = next_acl_uid(flist)))
++              /* The enumerations don't return 0 except to flag the last
++               * entry, since uidlist doesn't munge 0 anyway. */
++              while ((id = next_acl_uid(flist)) != 0)
 +                      acl_uid_map(match_uid(id));
-+              while ((id = next_acl_gid(flist)))
++              while ((id = next_acl_gid(flist)) != 0)
 +                      acl_gid_map(match_gid(id));
 +      }
 +#endif /* SUPPORT_ACLS */