Got rid of two compiler warnings.
[rsync/rsync-patches.git] / acls.diff
index 561d4c0..67d7327 100644 (file)
--- a/acls.diff
+++ b/acls.diff
@@ -33,8 +33,8 @@ ACLs to a non-ACL-supporting disk should complain.
  OBJS3=progress.o pipe.o
  DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
  popt_OBJS=popt/findme.o  popt/popt.o  popt/poptconfig.o \
---- orig/acls.c        2004-10-20 06:36:04
-+++ acls.c     2004-10-20 06:36:04
+--- orig/acls.c        2005-05-12 23:30:45
++++ acls.c     2005-05-12 23:30:45
 @@ -0,0 +1,1130 @@
 +/* -*- c-file-style: "linux" -*-
 +   Copyright (C) Andrew Tridgell 1996
@@ -60,7 +60,7 @@ ACLs to a non-ACL-supporting disk should complain.
 +#include "rsync.h"
 +#include "lib/sysacls.h"
 +
-+#if SUPPORT_ACLS
++#ifdef SUPPORT_ACLS
 +
 +extern int preserve_acls;
 +extern int am_root;
@@ -1193,9 +1193,9 @@ ACLs to a non-ACL-supporting disk should complain.
        free(file);
  
        if (verbose > 1) {
---- orig/configure.in  2005-03-16 02:19:29
+--- orig/configure.in  2005-05-10 23:47:12
 +++ configure.in       2004-08-19 19:53:27
-@@ -467,6 +467,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no
+@@ -478,6 +478,11 @@ if test x"$ac_cv_func_strcasecmp" = x"no
      AC_CHECK_LIB(resolv, strcasecmp)
  fi
  
@@ -1207,7 +1207,7 @@ ACLs to a non-ACL-supporting disk should complain.
  dnl At the moment we don't test for a broken memcmp(), because all we
  dnl need to do is test for equality, not comparison, and it seems that
  dnl every platform has a memcmp that can do at least that.
-@@ -713,6 +718,77 @@ AC_SUBST(OBJ_RESTORE)
+@@ -734,6 +739,77 @@ AC_SUBST(OBJ_RESTORE)
  AC_SUBST(CC_SHOBJ_FLAG)
  AC_SUBST(BUILD_POPT)
  
@@ -1285,18 +1285,18 @@ ACLs to a non-ACL-supporting disk should complain.
  AC_CONFIG_FILES([Makefile lib/dummy zlib/dummy popt/dummy shconfig])
  AC_OUTPUT
  
---- orig/flist.c       2005-03-16 02:19:29
+--- orig/flist.c       2005-04-28 15:56:50
 +++ flist.c    2005-03-16 02:24:11
-@@ -970,6 +970,8 @@ static struct file_struct *send_file_nam
+@@ -974,6 +974,8 @@ static struct file_struct *send_file_nam
        file = make_file(fname, flist, f == -2 ? SERVER_FILTERS : ALL_FILTERS);
        if (!file)
                return NULL;
 +      if (!MAKE_ACL(file, fname))
-+              return;
++              return NULL;
  
-       maybe_emit_filelist_progress(flist);
+       maybe_emit_filelist_progress(flist->count + flist_count_offset);
  
-@@ -978,6 +980,10 @@ static struct file_struct *send_file_nam
+@@ -982,6 +984,10 @@ static struct file_struct *send_file_nam
        if (file->basename[0]) {
                flist->files[flist->count++] = file;
                send_file_entry(file, f, base_flags);
@@ -1307,7 +1307,7 @@ ACLs to a non-ACL-supporting disk should complain.
        }
        return file;
  }
-@@ -1304,6 +1310,8 @@ struct file_list *recv_file_list(int f)
+@@ -1308,6 +1314,8 @@ struct file_list *recv_file_list(int f)
                        flags |= read_byte(f) << 8;
                file = receive_file_entry(flist, flags, f);
  
@@ -1316,7 +1316,7 @@ ACLs to a non-ACL-supporting disk should complain.
                if (S_ISREG(file->mode))
                        stats.total_size += file->length;
  
-@@ -1326,6 +1334,8 @@ struct file_list *recv_file_list(int f)
+@@ -1330,6 +1338,8 @@ struct file_list *recv_file_list(int f)
  
        clean_flist(flist, relative_paths, 1);
  
@@ -1325,21 +1325,21 @@ ACLs to a non-ACL-supporting disk should complain.
        if (f >= 0) {
                /* Now send the uid/gid list. This was introduced in
                 * protocol version 15 */
---- orig/generator.c   2005-03-29 01:05:12
-+++ generator.c        2005-03-11 11:18:22
-@@ -711,6 +711,10 @@ static void recv_generator(char *fname, 
+--- orig/generator.c   2005-04-28 16:26:28
++++ generator.c        2005-05-12 23:34:00
+@@ -720,6 +720,10 @@ static void recv_generator(char *fname, 
                if (set_perms(fname, file, statret ? NULL : &st, 0)
                    && verbose && code && f_out != -1)
                        rprintf(code, "%s/\n", safe_fname(fname));
-+#if SUPPORT_ACLS
++#ifdef SUPPORT_ACLS
 +              if (f_out == -1)
 +                      SET_ACL(fname, file);
 +#endif
                if (delete_during && f_out != -1 && !phase && dry_run < 2
                    && (file->flags & FLAG_DEL_HERE))
                        delete_in_dir(the_file_list, fname, file);
---- orig/lib/sysacls.c 2004-10-20 15:35:58
-+++ lib/sysacls.c      2004-10-20 15:35:58
+--- orig/lib/sysacls.c 2005-05-12 23:22:36
++++ lib/sysacls.c      2005-05-12 23:22:36
 @@ -0,0 +1,3217 @@
 +/* 
 +   Unix SMB/CIFS implementation.
@@ -1545,7 +1545,7 @@ ACLs to a non-ACL-supporting disk should complain.
 +      return acl_free(the_acl);
 +}
 +
-+int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype)
++int sys_acl_free_qualifier(void *qual, UNUSED(SMB_ACL_TAG_T tagtype))
 +{
 +      return acl_free(qual);
 +}
@@ -4425,49 +4425,49 @@ ACLs to a non-ACL-supporting disk should complain.
 +
 +#else /* No ACLs. */
 +
-+int sys_acl_get_entry( SMB_ACL_T the_acl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
++int sys_acl_get_entry(UNUSED(SMB_ACL_T the_acl), UNUSED(int entry_id), UNUSED(SMB_ACL_ENTRY_T *entry_p))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_get_tag_type( SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p)
++int sys_acl_get_tag_type(UNUSED(SMB_ACL_ENTRY_T entry_d), UNUSED(SMB_ACL_TAG_T *tag_type_p))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_get_permset( SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p)
++int sys_acl_get_permset(UNUSED(SMB_ACL_ENTRY_T entry_d), UNUSED(SMB_ACL_PERMSET_T *permset_p))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d)
++void *sys_acl_get_qualifier(UNUSED(SMB_ACL_ENTRY_T entry_d))
 +{
 +      errno = ENOSYS;
 +      return NULL;
 +}
 +
-+SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type)
++SMB_ACL_T sys_acl_get_file(UNUSED(const char *path_p), UNUSED(SMB_ACL_TYPE_T type))
 +{
 +      errno = ENOSYS;
 +      return (SMB_ACL_T)NULL;
 +}
 +
-+SMB_ACL_T sys_acl_get_fd(int fd)
++SMB_ACL_T sys_acl_get_fd(UNUSED(int fd))
 +{
 +      errno = ENOSYS;
 +      return (SMB_ACL_T)NULL;
 +}
 +
-+int sys_acl_clear_perms(SMB_ACL_PERMSET_T permset)
++int sys_acl_clear_perms(UNUSED(SMB_ACL_PERMSET_T permset))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_add_perm( SMB_ACL_PERMSET_T permset, SMB_ACL_PERM_T perm)
++int sys_acl_add_perm( UNUSED(SMB_ACL_PERMSET_T permset), UNUSED(SMB_ACL_PERM_T perm))
 +{
 +      errno = ENOSYS;
 +      return -1;
@@ -4479,79 +4479,79 @@ ACLs to a non-ACL-supporting disk should complain.
 +      return (permset & perm) ? 1 : 0;
 +}
 +
-+char *sys_acl_to_text( SMB_ACL_T the_acl, ssize_t *plen)
++char *sys_acl_to_text(UNUSED(SMB_ACL_T the_acl), UNUSED(ssize_t *plen))
 +{
 +      errno = ENOSYS;
 +      return NULL;
 +}
 +
-+int sys_acl_free_text(char *text)
++int sys_acl_free_text(UNUSED(char *text))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+SMB_ACL_T sys_acl_init( int count)
++SMB_ACL_T sys_acl_init(UNUSED(int count))
 +{
 +      errno = ENOSYS;
 +      return NULL;
 +}
 +
-+int sys_acl_create_entry( SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
++int sys_acl_create_entry(UNUSED(SMB_ACL_T *pacl), UNUSED(SMB_ACL_ENTRY_T *pentry))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_set_tag_type( SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype)
++int sys_acl_set_tag_type(UNUSED(SMB_ACL_ENTRY_T entry), UNUSED(SMB_ACL_TAG_T tagtype))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_set_qualifier( SMB_ACL_ENTRY_T entry, void *qual)
++int sys_acl_set_qualifier(UNUSED(SMB_ACL_ENTRY_T entry), UNUSED(void *qual))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_set_permset( SMB_ACL_ENTRY_T entry, SMB_ACL_PERMSET_T permset)
++int sys_acl_set_permset(UNUSED(SMB_ACL_ENTRY_T entry), UNUSED(SMB_ACL_PERMSET_T permset))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_valid( SMB_ACL_T theacl )
++int sys_acl_valid(UNUSED(SMB_ACL_T theacl))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_set_file( const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
++int sys_acl_set_file(UNUSED(const char *name), UNUSED(SMB_ACL_TYPE_T acltype), UNUSED(SMB_ACL_T theacl))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_set_fd( int fd, SMB_ACL_T theacl)
++int sys_acl_set_fd(UNUSED(int fd), UNUSED(SMB_ACL_T theacl))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_delete_def_file(const char *name)
++int sys_acl_delete_def_file(UNUSED(const char *name))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_free_acl(SMB_ACL_T the_acl) 
++int sys_acl_free_acl(UNUSED(SMB_ACL_T the_acl))
 +{
 +      errno = ENOSYS;
 +      return -1;
 +}
 +
-+int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype)
++int sys_acl_free_qualifier(UNUSED(void *qual), UNUSED(SMB_ACL_TAG_T tagtype))
 +{
 +      errno = ENOSYS;
 +      return -1;
@@ -4597,8 +4597,8 @@ ACLs to a non-ACL-supporting disk should complain.
    next;
  }
  
---- orig/options.c     2005-03-28 20:56:55
-+++ options.c  2005-02-14 02:46:05
+--- orig/options.c     2005-05-10 15:32:58
++++ options.c  2005-05-12 23:34:38
 @@ -44,6 +44,7 @@ int keep_dirlinks = 0;
  int copy_links = 0;
  int preserve_links = 0;
@@ -4607,7 +4607,7 @@ ACLs to a non-ACL-supporting disk should complain.
  int preserve_perms = 0;
  int preserve_devices = 0;
  int preserve_uid = 0;
-@@ -179,6 +180,7 @@ static void print_rsync_version(enum log
+@@ -180,6 +181,7 @@ static void print_rsync_version(enum log
        char const *got_socketpair = "no ";
        char const *have_inplace = "no ";
        char const *hardlinks = "no ";
@@ -4615,7 +4615,7 @@ ACLs to a non-ACL-supporting disk should complain.
        char const *links = "no ";
        char const *ipv6 = "no ";
        STRUCT_STAT *dumstat;
-@@ -195,6 +197,10 @@ static void print_rsync_version(enum log
+@@ -196,6 +198,10 @@ static void print_rsync_version(enum log
        hardlinks = "";
  #endif
  
@@ -4626,7 +4626,7 @@ ACLs to a non-ACL-supporting disk should complain.
  #ifdef SUPPORT_LINKS
        links = "";
  #endif
-@@ -209,9 +215,9 @@ static void print_rsync_version(enum log
+@@ -210,9 +216,9 @@ static void print_rsync_version(enum log
                "Copyright (C) 1996-2005 by Andrew Tridgell and others\n");
        rprintf(f, "<http://rsync.samba.org/>\n");
        rprintf(f, "Capabilities: %d-bit files, %ssocketpairs, "
@@ -4638,7 +4638,7 @@ ACLs to a non-ACL-supporting disk should complain.
  
        /* Note that this field may not have type ino_t.  It depends
         * on the complicated interaction between largefile feature
-@@ -281,6 +287,7 @@ void usage(enum logcode F)
+@@ -282,6 +288,7 @@ void usage(enum logcode F)
    rprintf(F," -H, --hard-links            preserve hard links\n");
    rprintf(F," -K, --keep-dirlinks         treat symlinked dir on receiver as dir\n");
    rprintf(F," -p, --perms                 preserve permissions\n");
@@ -4646,7 +4646,7 @@ ACLs to a non-ACL-supporting disk should complain.
    rprintf(F," -o, --owner                 preserve owner (root only)\n");
    rprintf(F," -g, --group                 preserve group\n");
    rprintf(F," -D, --devices               preserve devices (root only)\n");
-@@ -405,6 +412,7 @@ static struct poptOption long_options[] 
+@@ -409,6 +416,7 @@ static struct poptOption long_options[] 
    {"no-whole-file",    0,  POPT_ARG_VAL,    &whole_file, 0, 0, 0 },
    {"copy-unsafe-links",0,  POPT_ARG_NONE,   &copy_unsafe_links, 0, 0, 0 },
    {"perms",           'p', POPT_ARG_NONE,   &preserve_perms, 0, 0, 0 },
@@ -4654,12 +4654,12 @@ ACLs to a non-ACL-supporting disk should complain.
    {"owner",           'o', POPT_ARG_NONE,   &preserve_uid, 0, 0, 0 },
    {"group",           'g', POPT_ARG_NONE,   &preserve_gid, 0, 0, 0 },
    {"devices",         'D', POPT_ARG_NONE,   &preserve_devices, 0, 0, 0 },
-@@ -863,6 +871,24 @@ int parse_arguments(int *argc, const cha
+@@ -882,6 +890,24 @@ int parse_arguments(int *argc, const cha
                        basis_dir[basis_dir_cnt++] = (char *)arg;
                        break;
  
 +              case 'A':
-+#if SUPPORT_ACLS
++#ifdef SUPPORT_ACLS
 +                      preserve_acls = 1;
 +                      preserve_perms = 1;
 +#else
@@ -4679,7 +4679,7 @@ ACLs to a non-ACL-supporting disk should complain.
                default:
                        /* A large opt value means that set_refuse_options()
                         * turned this option off. */
-@@ -1265,6 +1291,8 @@ void server_options(char **args,int *arg
+@@ -1286,6 +1312,8 @@ void server_options(char **args,int *arg
  
        if (preserve_hard_links)
                argstr[x++] = 'H';
@@ -4705,19 +4705,23 @@ ACLs to a non-ACL-supporting disk should complain.
        if (verbose > 1 && flags & PERMS_REPORT) {
                enum logcode code = daemon_log_format_has_i || dry_run
                                  ? FCLIENT : FINFO;
---- orig/rsync.h       2005-03-28 20:56:55
-+++ rsync.h    2004-07-03 20:11:58
-@@ -639,6 +639,40 @@ struct stats {
+--- orig/rsync.h       2005-05-03 17:11:01
++++ rsync.h    2005-05-12 23:32:56
+@@ -638,6 +638,44 @@ struct stats {
  #include "lib/permstring.h"
  #include "lib/addrinfo.h"
  
-+#define SUPPORT_ACLS HAVE_POSIX_ACLS|HAVE_UNIXWARE_ACLS|HAVE_SOLARIS_ACLS|\
-+              HAVE_HPUX_ACLS|HAVE_IRIX_ACLS|HAVE_AIX_ACLS|HAVE_TRU64_ACLS
++#if HAVE_POSIX_ACLS|HAVE_UNIXWARE_ACLS|HAVE_SOLARIS_ACLS|\
++    HAVE_HPUX_ACLS|HAVE_IRIX_ACLS|HAVE_AIX_ACLS|HAVE_TRU64_ACLS
++#define SUPPORT_ACLS 1
++#endif
 +
-+#define ACLS_NEED_MASK HAVE_UNIXWARE_ACLS|HAVE_SOLARIS_ACLS|HAVE_HPUX_ACLS
++#if HAVE_UNIXWARE_ACLS|HAVE_SOLARIS_ACLS|HAVE_HPUX_ACLS
++#define ACLS_NEED_MASK 1
++#endif
 +
-+#if SUPPORT_ACLS
-+#if HAVE_SYS_ACL_H
++#ifdef SUPPORT_ACLS
++#ifdef HAVE_SYS_ACL_H
 +#include <sys/acl.h>
 +#endif
 +#define MAKE_ACL(file, fname)                 make_acl(file, fname)
@@ -4748,9 +4752,9 @@ ACLs to a non-ACL-supporting disk should complain.
  #include "proto.h"
  
  /* We have replacement versions of these if they're missing. */
---- orig/rsync.yo      2005-03-28 20:56:55
+--- orig/rsync.yo      2005-05-10 23:47:12
 +++ rsync.yo   2004-07-03 20:11:58
-@@ -316,6 +316,7 @@ to the detailed description below for a 
+@@ -317,6 +317,7 @@ to the detailed description below for a 
   -H, --hard-links            preserve hard links
   -K, --keep-dirlinks         treat symlinked dir on receiver as dir
   -p, --perms                 preserve permissions
@@ -4758,8 +4762,8 @@ ACLs to a non-ACL-supporting disk should complain.
   -o, --owner                 preserve owner (root only)
   -g, --group                 preserve group
   -D, --devices               preserve devices (root only)
-@@ -625,6 +626,11 @@ source file's permissions and the umask 
- other files (including updated files) retain their existing permissions
+@@ -629,6 +630,11 @@ based on the source file's permissions, 
+ umask setting
  (which is the same behavior as other file-copy utilities, such as cp).
  
 +dit(bf(-A, --acls)) This option causes rsync to update the remote