+
+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;
+
+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;
+#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)
+ 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--) {
+ 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)
+{
+ 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
+ "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)
+{
+ 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)
+{
+ }
+}
+
-+/* 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] */
+
+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;
+
+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;
+ 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;
+ 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
+};
+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)
+{
#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;
}
}
-+#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 */