Re: bin/120784: [patch] mount(8): allow mount from fstab with 3rd party tools like ntfs-3g

[ Available lists | Index of freebsd-bugs | Month of Feb 2008 | Week of 18 Feb 2008 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Dominic Fandrey <LoN_Kamikaze@gmx.de>
Date
18 Feb 2008 21:13:55
Subject
Re: bin/120784: [patch] mount(8): allow mount from fstab with 3rd party tools like ntfs-3g
Message-ID
47B9EEA3.7020408@gmx.de

In reply to

[ Hide this part ]
Remko Lodder wrote:
> I couldn't read the .diff file, it was encoded.
>
> Can you submit it as plain text? possibly send it inline instead of
> attaching it?
>
> Thanks,
> remko
>

Sorry about that. The file appears to have arrived corrupted.

diff -Pur sbin/mount.orig/mount.c sbin/mount/mount.c
--- sbin/mount.orig/mount.c 2008-02-18 19:44:05.000000000 +0100
+++ sbin/mount/mount.c 2008-02-18 19:44:37.000000000 +0100
@@ -560,7 +560,12 @@
if (use_mountprog(vfstype)) {
ret = exec_mountprog(name, execname, argv);
} else {
- ret = mount_fs(vfstype, argc, argv);
+ ret = mount_fs(vfstype, argc, argv);
+ if (ret < 0) {
+ if (verbose)
+ warn("falling back to old style mount");
+ ret = exec_mountprog(name, execname, argv);
+ }
}

free(optbuf);
diff -Pur sbin/mount.orig/mount_fs.c sbin/mount/mount_fs.c
--- sbin/mount.orig/mount_fs.c 2008-02-18 19:44:05.000000000 +0100
+++ sbin/mount/mount_fs.c 2008-02-18 19:44:37.000000000 +0100
@@ -107,6 +107,11 @@
val = p + 1;
}
build_iovec(&iov, &iovlen, optarg, val, (size_t)-1);
+ // Repair arguments, in case they are required when
+ // falling back to the old style exec_mountprog.
+ if (p != NULL) {
+ *p = '=';
+ }
break;
case '?':
default:
@@ -131,8 +136,6 @@
build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));

ret = nmount(iov, iovlen, mntflags);
- if (ret < 0)
- err(1, "%s %s", dev, errmsg);

return (ret);
}



Elapsed time: 0.137 seconds