kern/106255: [msdosfs] : correct setting of archive flag

Rene Ladan r.c.ladan at gmail.com
Sun Dec 3 03:10:33 PST 2006


>Number:         106255
>Category:       kern
>Synopsis:       [msdosfs] : correct setting of archive flag
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 03 11:10:10 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Rene Ladan
>Release:        7.0 CURRENT 2006-11-26
>Organization:
>Environment:
FreeBSD s000655.campus.tue.nl 7.0-CURRENT FreeBSD 7.0-CURRENT #21: Mon Nov 27 17:53:03 CET 2006     root at s000655.campus.tue.nl:/usr/obj/usr/src-current/sys/RENE  i386

>Description:
The MSDOS file system has an archive bit in the flags field.  This bit roughly corresponds to the archive flag on the UFS file system.  However, it is set the wrong way around: the flag should be set when the bit is present, and cleared when the bit is absent.
>How-To-Repeat:
1. Mount an MSDOS file system with some files marked as archived, and some not.
2. List its files with 'ls -lo'
   The archive flag will turn up inversed.

>Fix:


Patch attached with submission follows:

--- msdosfs_vnops.c	Mon Nov  6 14:41:57 2006
+++ msdosfs_vnops.c.rene	Sun Dec  3 11:58:47 2006
@@ -352,7 +352,7 @@
 		vap->va_ctime = vap->va_mtime;
 	}
 	vap->va_flags = 0;
-	if ((dep->de_Attributes & ATTR_ARCHIVE) == 0)
+	if (dep->de_Attributes & ATTR_ARCHIVE)
 		vap->va_flags |= SF_ARCHIVED;
 	vap->va_gen = 0;
 	vap->va_blocksize = pmp->pm_bpcluster;

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list