Protect against target containing a '%' which might be misinterpreted
by err(3). PR: bin/3864
This commit is contained in:
parent
fae3ea2ced
commit
5b9062772d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28629
@ -35,13 +35,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
char copyright[] =
|
static const char copyright[] =
|
||||||
"@(#) Copyright (c) 1992, 1993, 1994\n\
|
"@(#) Copyright (c) 1992, 1993, 1994\n\
|
||||||
The Regents of the University of California. All rights reserved.\n";
|
The Regents of the University of California. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
|
#if 0
|
||||||
static char sccsid[] = "@(#)mount_union.c 8.5 (Berkeley) 3/27/94";
|
static char sccsid[] = "@(#)mount_union.c 8.5 (Berkeley) 3/27/94";
|
||||||
|
#else
|
||||||
|
static const char rcsid[] =
|
||||||
|
"$Id$";
|
||||||
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -127,7 +132,7 @@ main(argc, argv)
|
|||||||
errx(EX_OSERR, "union filesystem is not available");
|
errx(EX_OSERR, "union filesystem is not available");
|
||||||
|
|
||||||
if (mount(vfc.vfc_name, source, mntflags, &args))
|
if (mount(vfc.vfc_name, source, mntflags, &args))
|
||||||
err(EX_OSERR, target);
|
err(EX_OSERR, "%s", target);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,13 +35,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
char copyright[] =
|
static const char copyright[] =
|
||||||
"@(#) Copyright (c) 1992, 1993, 1994\n\
|
"@(#) Copyright (c) 1992, 1993, 1994\n\
|
||||||
The Regents of the University of California. All rights reserved.\n";
|
The Regents of the University of California. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
|
#if 0
|
||||||
static char sccsid[] = "@(#)mount_union.c 8.5 (Berkeley) 3/27/94";
|
static char sccsid[] = "@(#)mount_union.c 8.5 (Berkeley) 3/27/94";
|
||||||
|
#else
|
||||||
|
static const char rcsid[] =
|
||||||
|
"$Id$";
|
||||||
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -127,7 +132,7 @@ main(argc, argv)
|
|||||||
errx(EX_OSERR, "union filesystem is not available");
|
errx(EX_OSERR, "union filesystem is not available");
|
||||||
|
|
||||||
if (mount(vfc.vfc_name, source, mntflags, &args))
|
if (mount(vfc.vfc_name, source, mntflags, &args))
|
||||||
err(EX_OSERR, target);
|
err(EX_OSERR, "%s", target);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user