*** sharutils-4.2.1/doc/remsync.texi --- sharutils-4.2.1/doc/remsync.texi *************** *** 8,11 **** --- 8,15 ---- @ifinfo + + @direntry + * remsync: (remsync). Synchronize remote files (sharutils). + @end direntry This file documents the @code{remsync} command and friends, which have the purpose of synchronizing remote directory trees using email. *** sharutils-4.2.1/doc/sharutils.texi --- sharutils-4.2.1/doc/sharutils.texi *************** *** 16,31 **** @ifinfo ! @format ! START-INFO-DIR-ENTRY * Shar utilities: (sharutils). GNU shar utilities. ! * mail-files: (sharutils)mail-files invocation. Send files to remote site. ! * mailshar: (sharutils)mailshar invocation. Make and send a shell archive. ! * remsync: (sharutils)remsync invocation. Synchronize remote files. ! * shar: (sharutils)shar invocation. Make a shell archive. ! * unshar: (sharutils)unshar invocation. Explode a shell archive. ! * uudecode: (sharutils)uudecode invocation. Restore file from 7-bits. ! * uuencode: (sharutils)uuencode invocation. Force binary file to 7-bits. ! END-INFO-DIR-ENTRY ! @end format @end ifinfo --- 16,22 ---- @ifinfo ! @direntry * Shar utilities: (sharutils). GNU shar utilities. ! @end direntry @end ifinfo --- sharutils-4.2.1/src/uudecode.c +++ sharutils-4.2.1/src/uudecode.c @@ -81,6 +81,9 @@ /* Single character decode. */ #define DEC(Char) (((Char) - ' ') & 077) +#if !defined S_ISLNK && defined S_IFLNK +# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#endif static int read_stduu (inname) @@ -279,6 +282,7 @@ char buf[2 * BUFSIZ]; char *outname; int do_base64 = 0; + struct stat attr; /* Search for header line. */ @@ -337,6 +341,23 @@ } } + /* Check out file if it exists */ + if (strcmp (outname, "/dev/stdout") != 0 && strcmp (outname, "-") != 0 + && !access(outname, F_OK)) { + if (lstat(outname, &attr) == -1) { + error (0, errno, _("cannot access %s"), outname); + return 1; + } + if (S_ISFIFO(attr.st_mode)){ + error (0, errno, _("denied writing FIFO (%s)"), outname); + return 1; + } + if (S_ISLNK(attr.st_mode)) { + error (0, errno, _("not following symlink (%s)"), outname); + return 1; + } + } + /* Create output file and set mode. */ if (strcmp (outname, "/dev/stdout") != 0 && strcmp (outname, "-") != 0