-/* $OpenBSD: extern.h,v 1.2 1996/06/23 14:19:10 deraadt Exp $ */
+/* $OpenBSD: extern.h,v 1.3 1997/02/25 02:27:28 millert Exp $ */
/* $NetBSD: extern.h,v 1.3 1995/03/21 09:02:16 cgd Exp $ */
/*-
int copy_link __P((FTSENT *, int));
int copy_special __P((struct stat *, int));
int setfile __P((struct stat *, int));
+int setlink __P((struct stat *));
void usage __P((void));
__END_DECLS
-/* $OpenBSD: utils.c,v 1.4 1997/02/24 20:43:27 millert Exp $ */
+/* $OpenBSD: utils.c,v 1.5 1997/02/25 02:27:28 millert Exp $ */
/* $NetBSD: utils.c,v 1.4 1995/08/02 07:17:02 jtc Exp $ */
/*-
#if 0
static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94";
#else
-static char rcsid[] = "$OpenBSD: utils.c,v 1.4 1997/02/24 20:43:27 millert Exp $";
+static char rcsid[] = "$OpenBSD: utils.c,v 1.5 1997/02/25 02:27:28 millert Exp $";
#endif
#endif /* not lint */
warn("symlink: %s", link);
return (1);
}
- return (pflag ? setfile(p->fts_statp, 0) : 0);
+ return (pflag ? setlink(p->fts_statp) : 0);
}
int
static struct timeval tv[2];
int rval = 0;
- /* Only change the owner for symbolic links. */
- if (S_ISLNK(fs->st_mode)) {
- if (lchown(to.p_path, fs->st_uid, fs->st_gid)) {
- if (errno != EPERM) {
- warn("lchown: %s", to.p_path);
- rval = 1;
- }
- }
- return (rval);
- }
-
fs->st_mode &= S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO;
TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atimespec);
return (rval);
}
+
+int
+setlink(fs)
+ register struct stat *fs;
+{
+
+ if (lchown(to.p_path, fs->st_uid, fs->st_gid)) {
+ if (errno != EPERM) {
+ warn("lchown: %s", to.p_path);
+ return (1);
+ }
+ }
+ return (0);
+}
+
+
void
usage()
{