mirror of
https://github.com/opnsense/src.git
synced 2026-04-29 01:59:38 -04:00
Allow libufs(3) functions to operate on a regular file. This makes it possible to
use almost anything that uses libufs(3) against a file as an unprivileged user, e.g. tunefs(8) and dumpfs(8) against a makefs(8)-created image. Prodded by: kensmith
This commit is contained in:
parent
a4cf065a39
commit
990b6d05ab
2 changed files with 5 additions and 2 deletions
|
|
@ -108,7 +108,10 @@ again: if ((ret = stat(name, &st)) < 0) {
|
|||
*/
|
||||
name = oname;
|
||||
}
|
||||
if (ret >= 0 && S_ISCHR(st.st_mode)) {
|
||||
if (ret >= 0 && S_ISREG(st.st_mode)) {
|
||||
/* Possibly a disk image, give it a try. */
|
||||
;
|
||||
} else if (ret >= 0 && S_ISCHR(st.st_mode)) {
|
||||
/* This is what we need, do nothing. */
|
||||
;
|
||||
} else if ((fs = getfsfile(name)) != NULL) {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ and populate the structure pointed to by
|
|||
The disk is opened read-only.
|
||||
The specified
|
||||
.Fa name
|
||||
may be either a mountpoint, or a device name.
|
||||
may be either a mountpoint, a device name or a filesystem image.
|
||||
The
|
||||
.Fn ufs_disk_fillout
|
||||
function assumes there is a valid superblock and will fail if not,
|
||||
|
|
|
|||
Loading…
Reference in a new issue