~ubuntu-branches/ubuntu/natty/rsync/natty

« back to all changes in this revision

Viewing changes to clientserver.c

  • Committer: Bazaar Package Importer
  • Author(s): Paul Slootman
  • Date: 2010-01-05 12:50:44 UTC
  • mfrom: (1.1.10 upstream) (2.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100105125044-57c1mzdl1qjjp2v0
Tags: 3.0.7-1
* new upstream release.
* Use $DAEMON consistently in the init.d script. Also use RSYNC_PID_FILE and
  RSYNC_DEFAULTS_FILE while we're at it.
  closes:#558771
* Remove stop links, they serve no useful purpose. Also start it a bit later
  so that startup seems faster. (However, dependency-based boot sequencing
  may interfere with this.) Lintian override was necessary for omitting the
  stop scripts in 0 and 6.
  closes:#534577
* Add support for running rsync under ionice, via an entry in
  /etc/default/rsync .
  closes:#553458
* The --delete option displays a better message now when used without -d.
  closes:#544719

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
extern int logfile_format_has_o_or_i;
51
51
extern mode_t orig_umask;
52
52
extern char *bind_address;
53
 
extern char *sockopts;
54
53
extern char *config_file;
55
54
extern char *logfile_format;
56
55
extern char *files_from;
57
56
extern char *tmpdir;
58
57
extern struct chmod_mode_struct *chmod_modes;
59
58
extern struct filter_list_struct daemon_filter_list;
60
 
extern char curr_dir[];
61
59
#ifdef ICONV_OPTION
62
60
extern char *iconv_opt;
63
61
extern iconv_t ic_send, ic_recv;
722
720
                }
723
721
#endif
724
722
 
725
 
                if (setuid(uid)) {
 
723
                if (setuid(uid) < 0
 
724
#ifdef HAVE_SETEUID
 
725
                 || seteuid(uid) < 0
 
726
#endif
 
727
                ) {
726
728
                        rsyserr(FLOG, errno, "setuid %d failed", (int)uid);
727
729
                        io_printf(f_out, "@ERROR: setuid failed\n");
728
730
                        return -1;
856
858
         && (use_chroot ? lp_numeric_ids(i) != False : lp_numeric_ids(i) == True))
857
859
                numeric_ids = -1; /* Set --numeric-ids w/o breaking protocol. */
858
860
 
859
 
        if (lp_timeout(i) && lp_timeout(i) > io_timeout)
 
861
        if (lp_timeout(i) && (!io_timeout || lp_timeout(i) < io_timeout))
860
862
                set_io_timeout(lp_timeout(i));
861
863
 
862
864
        /* If we have some incoming/outgoing chmod changes, append them to