summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs/denode.h
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1994-12-27 12:37:36 +0000
committerbde <bde@FreeBSD.org>1994-12-27 12:37:36 +0000
commit1587b568dd32b6f0f1d6cc5e282a606459d7ee2e (patch)
treeadf9bcdb7a70ae862914612112ca8fbaee09e226 /sys/fs/msdosfs/denode.h
parent94497e0a34c7b774c88ebe2d120a83d82e6361f9 (diff)
downloadFreeBSD-src-1587b568dd32b6f0f1d6cc5e282a606459d7ee2e.zip
FreeBSD-src-1587b568dd32b6f0f1d6cc5e282a606459d7ee2e.tar.gz
Fix panic for `cp -p' by root to an msdos file system. Improve handling
of attributes so that `cp -p' to an msdos file system can succeed under favourable circumstances (no uid or gid changes and no nonzero flags except SF_ARCHIVED). msdosfs_vnops.c: The in-core inode flags were confused with the on-disk inode flags, so chflags() clobbered the lock flag and caused a panic. denode.h, msdosfs_denode.c, msdosfs_vnops.c: Support the msdosfs archive attibute (ATTR_ARCHIVE) by mapping it to the complement of the SF_ARCHIVED flag and setting the ATTR_ARCHIVE bit when a file's modification time is set (but not when a file's permissions are set; this is the standard wrong DOS behaviour). denode.h, msdosfs_denode.c: Remove the DE_UPDAT() macro. It was only used once, and the corresponding macro in ufs has already been removed. denode.h: Don't change the timestamp for directories in DE_TIMES() (be consistent with deupdat()). msdosfs_vnops.c: Handle chown() better: return EPERM instead of EINVAL if there are insufficient permissions; otherwise, allow null changes.
Diffstat (limited to 'sys/fs/msdosfs/denode.h')
-rw-r--r--sys/fs/msdosfs/denode.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/fs/msdosfs/denode.h b/sys/fs/msdosfs/denode.h
index dce8fd6..a45994b 100644
--- a/sys/fs/msdosfs/denode.h
+++ b/sys/fs/msdosfs/denode.h
@@ -1,4 +1,4 @@
-/* $Id: denode.h,v 1.1 1994/09/19 15:41:38 dfr Exp $ */
+/* $Id: denode.h,v 1.2 1994/12/12 12:35:40 bde Exp $ */
/* $NetBSD: denode.h,v 1.8 1994/08/21 18:43:49 ws Exp $ */
/*-
@@ -199,16 +199,16 @@ struct denode {
#define VTODE(vp) ((struct denode *)(vp)->v_data)
#define DETOV(de) ((de)->de_vnode)
-#define DE_UPDAT(dep, t, waitfor) \
- if ((dep)->de_flag & (DE_MODIFIED | DE_UPDATE)) \
- (void) deupdat((dep), (t), (waitfor));
-
#define DE_TIMES(dep, t) \
if ((dep)->de_flag & DE_UPDATE) { \
- struct timespec DE_TIMES_ts; \
- (dep)->de_flag |= DE_MODIFIED; \
- TIMEVAL_TO_TIMESPEC((t), &DE_TIMES_ts); \
- unix2dostime(&DE_TIMES_ts, &(dep)->de_Date, &(dep)->de_Time); \
+ if (!((dep)->de_Attributes & ATTR_DIRECTORY)) { \
+ struct timespec DE_TIMES_ts; \
+ (dep)->de_flag |= DE_MODIFIED; \
+ TIMEVAL_TO_TIMESPEC((t), &DE_TIMES_ts); \
+ unix2dostime(&DE_TIMES_ts, &(dep)->de_Date, \
+ &(dep)->de_Time); \
+ (dep)->de_Attributes |= ATTR_ARCHIVE; \
+ } \
(dep)->de_flag &= ~DE_UPDATE; \
}
OpenPOWER on IntegriCloud