Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Dec 2002 11:07:30 -0800 (PST)
From:      Nate Lawson <nate@root.org>
To:        Kirk McKusick <mckusick@FreeBSD.org>
Cc:        cvs-all@freebsd.org, cvs-committers@freebsd.org
Subject:   Re: cvs commit: src/sbin/dump dump.8 main.c
Message-ID:  <Pine.BSF.4.21.0212031055050.7407-100000@root.org>
In-Reply-To: <20021203182524.BA85337B4A9@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Minor comments, thx for doing this.

Does the creation of snapshots follow symlinks?  What happens if an
attacker creates /.dump_snapshot in /tmp and then root dumps /tmp?

On Tue, 3 Dec 2002, Kirk McKusick wrote:
> mckusick    2002/12/03 10:21:09 PST
> 
>   Modified files:
>     sbin/dump            dump.8 main.c 
>   Log:
>   Add the `L' option to dump to notify it that it is dumping a
>   live filesystem. To obtain a consistent dump image, dump takes
>   a snapshot of the filesystem and then does a dump of the snapshot.
>   The snapshot is removed when the dump is complete.
> 
> --- src/sbin/dump/main.c:1.42	Tue Nov 26 18:18:56 2002
> +++ src/sbin/dump/main.c	Tue Dec  3 10:21:09 2002
>
> +			if ((diskfd = open(snapname, O_RDONLY)) < 0) {
> +				unlink(snapname);
> +				errx(X_STARTUP, "Cannot open %s: %s\n",
> +				    snapname, strerror(errno));
> +			}
> +			unlink(snapname);

If call to open was before if, snapname could be unconditionally unlinked
before if() and the err case would be smaller.

>  	(void)strcpy(spcl.c_label, "none");
>  	(void)gethostname(spcl.c_host, NAMELEN);
>  	spcl.c_level = level - '0';
>  	spcl.c_type = TS_TAPE;
> -	if (!Tflag)
> -	        getdumptime();		/* /etc/dumpdates snarfed */
>  
>  	if (spcl.c_date == 0) {
>  		tmsg = "the epoch\n";
> @@ -323,6 +373,9 @@
>  		tmsg = ctime(&t);
>  	}
>  	msg("Date of this level %c dump: %s", level, tmsg);
> +
> +	if (!Tflag)
> +	        getdumptime();		/* /etc/dumpdates snarfed */
>  	if (spcl.c_ddate == 0) {
>  		tmsg = "the epoch\n";
>  	} else {

I don't see what this does?

-Nate


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0212031055050.7407-100000>