Fix failed hunks.
[rsync-patches.git] / kerberos.diff
index df3e1b8d4dbf5744de82733499277ac3d5c414a9..67f545c4cff38df4ee514f019c257ae988583007 100644 (file)
@@ -9,23 +9,23 @@ To use this patch, run these commands for a successful build:
     ./configure
     make
 
-based-on: c528f8d5c8aa7b16b20cda72a9f4119699890c28
+based-on: a6bdf313f239cabfef445bc3658b79aec8a40c37
 diff --git a/Makefile.in b/Makefile.in
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -45,7 +45,7 @@ OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
-       util.o util2.o main.o checksum.o match.o syscall.o log.o backup.o delete.o
+@@ -44,7 +44,7 @@ OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
+       util1.o util2.o main.o checksum.o match.o syscall.o log.o backup.o delete.o
  OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
-       fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
--OBJS3=progress.o pipe.o
-+OBJS3=progress.o pipe.o gss-auth.o
+       usage.o fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
+-OBJS3=progress.o pipe.o @ASM@
++OBJS3=progress.o pipe.o gss-auth.o @ASM@
  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 \
        popt/popthelp.o popt/poptparse.o
 diff --git a/clientserver.c b/clientserver.c
 --- a/clientserver.c
 +++ b/clientserver.c
-@@ -131,7 +131,7 @@ int start_socket_client(char *host, int remote_argc, char *remote_argv[],
+@@ -140,7 +140,7 @@ int start_socket_client(char *host, int remote_argc, char *remote_argv[],
        setup_iconv();
  #endif
  
@@ -34,7 +34,7 @@ diff --git a/clientserver.c b/clientserver.c
  
        return ret ? ret : client_run(fd, fd, -1, argc, argv);
  }
-@@ -210,7 +210,7 @@ static int exchange_protocols(int f_in, int f_out, char *buf, size_t bufsiz, int
+@@ -217,7 +217,7 @@ static int exchange_protocols(int f_in, int f_out, char *buf, size_t bufsiz, int
        return 0;
  }
  
@@ -43,7 +43,7 @@ diff --git a/clientserver.c b/clientserver.c
  {
        int i, modlen;
        char line[BIGPATHBUFLEN];
-@@ -296,6 +296,17 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
+@@ -328,6 +328,17 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char
                        continue;
                }
  
@@ -61,7 +61,7 @@ diff --git a/clientserver.c b/clientserver.c
                if (strcmp(line,"@RSYNCD: OK") == 0)
                        break;
  
-@@ -651,7 +662,12 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
+@@ -719,7 +730,12 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
        }
  
        read_only = lp_read_only(i); /* may also be overridden by auth_server() */
@@ -78,7 +78,7 @@ diff --git a/clientserver.c b/clientserver.c
 diff --git a/configure.ac b/configure.ac
 --- a/configure.ac
 +++ b/configure.ac
-@@ -774,6 +774,31 @@ if test x"$enable_iconv" != x"no"; then
+@@ -1010,6 +1010,31 @@ if test x"$enable_iconv" != x"no"; then
        AC_DEFINE(UTF8_CHARSET, "UTF-8", [String to pass to iconv() for the UTF-8 charset.])
  fi
  
@@ -110,11 +110,22 @@ diff --git a/configure.ac b/configure.ac
  AC_CACHE_CHECK([whether chown() modifies symlinks],rsync_cv_chown_modifies_symlink,[
    AC_RUN_IFELSE([AC_LANG_SOURCE([[
  #if HAVE_UNISTD_H
+diff --git a/daemon-parm.txt b/daemon-parm.txt
+--- a/daemon-parm.txt
++++ b/daemon-parm.txt
+@@ -61,6 +61,7 @@ BOOL reverse_lookup          True
+ BOOL  strict_modes            True
+ BOOL  transfer_logging        False
+ BOOL  use_chroot              True
++BOOL  use_gssapi              False
+ BOOL  write_only              False
+ BOOL3 munge_symlinks          Unset
 diff --git a/gss-auth.c b/gss-auth.c
 new file mode 100644
 --- /dev/null
 +++ b/gss-auth.c
-@@ -0,0 +1,342 @@
+@@ -0,0 +1,334 @@
 +/*
 + * GSSAPI authentication.
 + *
@@ -176,8 +187,6 @@ new file mode 100644
 +      OM_uint32 min_stat;
 +
 +      buffer = new_array(char, (strlen(host) + 2 + strlen(RSYNC_GSS_SERVICE)));
-+      if (!(buffer))
-+              out_of_memory("auth_gss_client");
 +
 +      sprintf(buffer, "%s@%s", RSYNC_GSS_SERVICE, host);
 +
@@ -307,8 +316,7 @@ new file mode 100644
 +      gss_buffer_desc gssname;
 +      OM_uint32 maj_stat, min_stat;
 +
-+      if (!(gssname.value = strdup(name)))
-+              out_of_memory("import_gss_name");
++      gssname.value = strdup(name);
 +      gssname.length = strlen(name) +1 ;
 +
 +      maj_stat = gss_import_name(&min_stat, &gssname, type, gss_name);
@@ -334,10 +342,8 @@ new file mode 100644
 +              return NULL;
 +      }
 +
-+      if (exported_name.length > 0) {
-+              if (!(exported = strdup(exported_name.value)))
-+                      out_of_memory("export_name");
-+      }
++      if (exported_name.length > 0)
++              exported = strdup(exported_name.value);
 +
 +      free_gss_buffer(&exported_name);
 +
@@ -430,10 +436,8 @@ new file mode 100644
 +              error_gss(maj_stat, min_stat, "canonizing name");
 +              return NULL;
 +      }
-+      if (exported_name.length > 0) {
-+              if (!(cn = strdup(exported_name.value)))
-+                      out_of_memory("auth_server");
-+      }
++      if (exported_name.length > 0)
++              cn = strdup(exported_name.value);
 +
 +      free_gss_name(&output_name);
 +      free_gss_buffer(&exported_name);
@@ -451,53 +455,17 @@ new file mode 100644
 +{
 +      token->length = read_int(fd);
 +      if (token->length > 0) {
-+              if (!(token->value = new_array(char, token->length)))
-+                      out_of_memory("recv_gss_token");
++              token->value = new_array(char, token->length);
 +              read_buf(fd, token->value, token->length);
 +      }
 +}
 +#endif /* GSSAPI_OPTION */
-diff --git a/loadparm.c b/loadparm.c
---- a/loadparm.c
-+++ b/loadparm.c
-@@ -194,6 +194,7 @@ typedef struct {
-       BOOL strict_modes;
-       BOOL transfer_logging;
-       BOOL use_chroot;
-+      BOOL use_gssapi;
-       BOOL write_only;
- } local_vars;
-@@ -311,6 +312,7 @@ static const all_vars Defaults = {
-  /* strict_modes; */          True,
-  /* transfer_logging; */      False,
-  /* use_chroot; */            True,
-+ /* use_gssapi; */            False,
-  /* write_only; */            False,
-  }
- };
-@@ -454,6 +456,7 @@ static struct parm_struct parm_table[] =
-  {"transfer logging",  P_BOOL,   P_LOCAL, &Vars.l.transfer_logging,    NULL,0},
-  {"uid",               P_STRING, P_LOCAL, &Vars.l.uid,                 NULL,0},
-  {"use chroot",        P_BOOL,   P_LOCAL, &Vars.l.use_chroot,          NULL,0},
-+ {"use gssapi",        P_BOOL,   P_LOCAL, &Vars.l.use_gssapi,          NULL,0},
-  {"write only",        P_BOOL,   P_LOCAL, &Vars.l.write_only,          NULL,0},
-  {NULL,                P_BOOL,   P_NONE,  NULL,                        NULL,0}
- };
-@@ -596,6 +599,7 @@ FN_LOCAL_BOOL(lp_reverse_lookup, reverse_lookup)
- FN_LOCAL_BOOL(lp_strict_modes, strict_modes)
- FN_LOCAL_BOOL(lp_transfer_logging, transfer_logging)
- FN_LOCAL_BOOL(lp_use_chroot, use_chroot)
-+FN_LOCAL_BOOL(lp_use_gssapi, use_gssapi)
- FN_LOCAL_BOOL(lp_write_only, write_only)
- /* Assign a copy of v to *s.  Handles NULL strings.  We don't worry
 diff --git a/main.c b/main.c
 --- a/main.c
 +++ b/main.c
-@@ -1537,7 +1537,7 @@ static int start_client(int argc, char *argv[])
+@@ -1577,7 +1577,7 @@ static int start_client(int argc, char *argv[])
         * remote shell command, we need to do the RSYNCD protocol first */
-       if (daemon_over_rsh) {
+       if (daemon_connection) {
                int tmpret;
 -              tmpret = start_inband_exchange(f_in, f_out, shell_user, remote_argc, remote_argv);
 +              tmpret = start_inband_exchange(f_in, f_out, shell_user, shell_machine, remote_argc, remote_argv);
@@ -507,7 +475,7 @@ diff --git a/main.c b/main.c
 diff --git a/rsync.h b/rsync.h
 --- a/rsync.h
 +++ b/rsync.h
-@@ -498,6 +498,15 @@ enum delret {
+@@ -533,6 +533,15 @@ enum delret {
  #define iconv_t int
  #endif