summaryrefslogtreecommitdiffstats
path: root/usr.bin/rdist/client.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2009-02-15 22:20:54 +0000
committerderaadt <deraadt@openbsd.org>2009-02-15 22:20:54 +0000
commit8e2339876dbe27b49651f58d624c1d3db2b77951 (patch)
tree64e0390503890181784e35007a685f2f4ec2c067 /usr.bin/rdist/client.c
parentshould fsck the raw device; spotted by frantisek holop and mentioned on (diff)
downloadwireguard-openbsd-8e2339876dbe27b49651f58d624c1d3db2b77951.tar.xz
wireguard-openbsd-8e2339876dbe27b49651f58d624c1d3db2b77951.zip
make rdist silently ignore special file types which cannot be moved
(well, if you turn on debug it will still tell you) from Tim van der Molen <tbvdm@xs4all.nl
Diffstat (limited to 'usr.bin/rdist/client.c')
-rw-r--r--usr.bin/rdist/client.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/usr.bin/rdist/client.c b/usr.bin/rdist/client.c
index 5742bb95e3a..f43b0fafd97 100644
--- a/usr.bin/rdist/client.c
+++ b/usr.bin/rdist/client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: client.c,v 1.20 2004/10/04 05:21:27 jsg Exp $ */
+/* $OpenBSD: client.c,v 1.21 2009/02/15 22:20:54 deraadt Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -38,7 +38,7 @@ static char RCSid[] __attribute__((__unused__)) =
"$From: client.c,v 1.13 1999/11/01 00:22:14 christos Exp $";
#else
static char RCSid[] __attribute__((__unused__)) =
-"$OpenBSD: client.c,v 1.20 2004/10/04 05:21:27 jsg Exp $";
+"$OpenBSD: client.c,v 1.21 2009/02/15 22:20:54 deraadt Exp $";
#endif
static char sccsid[] __attribute__((__unused__)) =
@@ -791,6 +791,22 @@ update(char *rname, opt_t opts, struct stat *statp)
debugmsg(DM_CALL, "update(%s, 0x%x, 0x%x)\n", rname, opts, statp);
+ switch (statp->st_mode & S_IFMT) {
+ case S_IFBLK:
+ debugmsg(DM_MISC, "%s is a block special; skipping\n", target);
+ return(US_NOTHING);
+ case S_IFCHR:
+ debugmsg(DM_MISC, "%s is a character special; skipping\n",
+ target);
+ return(US_NOTHING);
+ case S_IFIFO:
+ debugmsg(DM_MISC, "%s is a fifo; skipping\n", target);
+ return(US_NOTHING);
+ case S_IFSOCK:
+ debugmsg(DM_MISC, "%s is a socket; skipping\n", target);
+ return(US_NOTHING);
+ }
+
if (IS_ON(opts, DO_NOEXEC))
if (isexec(target, statp)) {
debugmsg(DM_MISC, "%s is an executable\n", target);
@@ -1093,7 +1109,7 @@ fullupdate(int u, char *target, opt_t opts, char *rname, int destdir,
/*
* Since we always send link info to the server
* so the server can determine if the remote link
- * is correct, we never get any acknowledge meant
+ * is correct, we never get any acknowledgement
* from the server whether the link was really
* updated or not.
*/