From joshua@green.shallow.net  Sat Apr 13 08:09:45 2002
Return-Path: <joshua@green.shallow.net>
Received: from green.shallow.net (c16486.smelb1.vic.optusnet.com.au [210.49.224.105])
	by hub.freebsd.org (Postfix) with ESMTP id C6B1937B405
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 13 Apr 2002 08:09:44 -0700 (PDT)
Received: by green.shallow.net (Postfix, from userid 1001)
	id 9B2673E42; Sun, 14 Apr 2002 01:09:41 +1000 (EST)
Message-Id: <20020413150941.9B2673E42@green.shallow.net>
Date: Sun, 14 Apr 2002 01:09:41 +1000 (EST)
From: Joshua Goodall <joshua@roughtrade.net>
Reply-To: Joshua Goodall <joshua@roughtrade.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: fflagstostr and strtofflags don't recognise snapshots
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         37038
>Category:       bin
>Synopsis:       fflagstostr and strtofflags don't recognise snapshots
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 13 08:10:02 PDT 2002
>Closed-Date:    Tue Apr 16 04:03:54 PDT 2002
>Last-Modified:  Tue Apr 16 04:03:54 PDT 2002
>Originator:     Joshua Goodall
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD gold.shallow.net 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Sat Apr 13 22:44:01 EST 2002 joshua@green.shallow.net:/usr/obj/usr/current/sys/GENERIC i386
>Description:

strtofflags and (more usefully) fflagstostr don't recognise SF_SNAPSHOT.
As a result, ls -lo doesn't distinguish a snapshot file.

>How-To-Repeat:

root@gold:~# mount -u -o snapshot /.snap1 /
root@gold:~# ls -lo /.snap1
-r---------  1 root  wheel  - 1782579200 Apr 14 10:24 /.snap 

>Fix:

n.b. xinstall (included in the build bootstrap toolchain) uses
strtofflags.c, so we have to check for the definition of SF_SNAPSHOT
to avoid breaking world.

After this is committed, you'll see

root@gold:~# ls -lo /.snap1
-r---------  1 root  wheel  snapshot 1782579200 Apr 14 10:24 /.snap 


Index: lib/libc/gen/strtofflags.c
===================================================================
RCS file: /cvs/src/lib/libc/gen/strtofflags.c,v
retrieving revision 1.20
diff -u -r1.20 strtofflags.c
--- lib/libc/gen/strtofflags.c	8 Feb 2002 09:34:17 -0000	1.20
+++ lib/libc/gen/strtofflags.c	13 Apr 2002 03:13:24 -0000
@@ -61,6 +61,9 @@
 	{ "nosimmutable",	SF_IMMUTABLE,	0 },
 	{ "nosunlnk",		SF_NOUNLINK,	0 },
 	{ "nosunlink",		SF_NOUNLINK,	0 },
+#ifdef SF_SNAPSHOT
+	{ "nosnapshot",		SF_SNAPSHOT,	0 },
+#endif
 	{ "nouappnd",		UF_APPEND,	0 },
 	{ "nouappend",		UF_APPEND,	0 },
 	{ "nouchg",		UF_IMMUTABLE,	0 },
>Release-Note:
>Audit-Trail:

From: Joshua Goodall <joshua@roughtrade.net>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/37038: fflagstostr and strtofflags don't recognise snapshots
Date: Sun, 14 Apr 2002 02:09:04 +1000

 On Sun, Apr 14, 2002 at 01:09:41AM +1000, I wrote to -bugs:
 > root@gold:~# mount -u -o snapshot /.snap1 /
 > root@gold:~# ls -lo /.snap1
 > -r---------  1 root  wheel  - 1782579200 Apr 14 10:24 /.snap
 
 Oops, thinko. That should of course read:
 
 root@gold:~# mount -u -o snapshot /.snap1 /
 root@gold:~# ls -lo /.snap1
 -r---------  1 root  wheel  - 1782579200 Apr 14 10:24 /.snap1
 
 > root@gold:~# ls -lo /.snap1
 > -r---------  1 root  wheel  snapshot 1782579200 Apr 14 10:24 /.snap 
 
 similarly,
 
 root@gold:~# ls -lo /.snap1
 -r---------  1 root  wheel  snapshot 1782579200 Apr 14 10:24 /.snap1
 
 error only in examples, fix is unchanged.
 
 Joshua
 
State-Changed-From-To: open->closed 
State-Changed-By: joe 
State-Changed-When: Tue Apr 16 04:03:42 PDT 2002 
State-Changed-Why:  
Committed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37038 
>Unformatted:
