X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/acac1f5c6f04c55f5d1f0cddec4fa308673f0892..2909586ede1934c36e43e176909c36998279b2a2:/tls.c diff --git a/tls.c b/tls.c index 1976d952..97b713be 100644 --- a/tls.c +++ b/tls.c @@ -5,8 +5,9 @@ * Copyright (C) 2003-2007 Wayne Davison * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -88,7 +89,12 @@ static int stat_xattr(const char *fname, STRUCT_STAT *fst) exit(1); } - fst->st_mode = from_wire_mode(mode); +#if _S_IFLNK != 0120000 + if ((mode & (_S_IFMT)) == 0120000) + mode = (mode & ~(_S_IFMT)) | _S_IFLNK; +#endif + fst->st_mode = mode; + fst->st_rdev = MAKEDEV(rdev_major, rdev_minor); fst->st_uid = uid; fst->st_gid = gid;