./configure
make
-based-on: 16b49716d55a50f2e985b879b720b2c53c892a3a
+based-on: a6bdf313f239cabfef445bc3658b79aec8a40c37
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
-@@ -40,7 +40,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
-@@ -128,7 +128,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
return ret ? ret : client_run(fd, fd, -1, argc, argv);
}
-@@ -207,7 +207,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;
}
{
int i, modlen;
char line[BIGPATHBUFLEN];
-@@ -293,6 +293,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;
}
if (strcmp(line,"@RSYNCD: OK") == 0)
break;
-@@ -561,7 +572,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() */
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
-@@ -665,6 +665,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
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.
+ *
+ 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);
+
+ 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);
+ 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);
+
+ 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);
+{
+ 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
-@@ -151,6 +151,7 @@ typedef struct {
- BOOL strict_modes;
- BOOL transfer_logging;
- BOOL use_chroot;
-+ BOOL use_gssapi;
- BOOL write_only;
- } local_vars;
-
-@@ -225,6 +226,7 @@ static const all_vars Defaults = {
- /* strict_modes; */ True,
- /* transfer_logging; */ False,
- /* use_chroot; */ True,
-+ /* use_gssapi; */ False,
- /* write_only; */ False,
- }
- };
-@@ -362,6 +364,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}
- };
-@@ -494,6 +497,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
-@@ -1410,7 +1410,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);
diff --git a/rsync.h b/rsync.h
--- a/rsync.h
+++ b/rsync.h
-@@ -472,6 +472,15 @@ enum delret {
+@@ -533,6 +533,15 @@ enum delret {
#define iconv_t int
#endif