Re-add the code to automatically load the smbfs.ko module if necessary.
We can't realy on the mount(2) system call to do it for us here because smb_lib_init() needs the module and we call it before mount(). The old code has been slightly modified to not use the getvfsent(3) API which is now retired. Noticed by: many
This commit is contained in:
parent
4456263490
commit
56cb1e8cca
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=130789
@ -35,6 +35,7 @@
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/errno.h>
|
#include <sys/errno.h>
|
||||||
|
#include <sys/linker.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -75,6 +76,8 @@ main(int argc, char *argv[])
|
|||||||
#ifdef APPLE
|
#ifdef APPLE
|
||||||
extern void dropsuid();
|
extern void dropsuid();
|
||||||
extern int loadsmbvfs();
|
extern int loadsmbvfs();
|
||||||
|
#else
|
||||||
|
struct xvfsconf vfc;
|
||||||
#endif
|
#endif
|
||||||
char *next;
|
char *next;
|
||||||
int opt, error, mntflags, caseopt;
|
int opt, error, mntflags, caseopt;
|
||||||
@ -97,9 +100,16 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
#ifdef APPLE
|
#ifdef APPLE
|
||||||
error = loadsmbvfs();
|
error = loadsmbvfs();
|
||||||
|
#else
|
||||||
|
error = getvfsbyname(SMBFS_VFSNAME, &vfc);
|
||||||
|
if (error) {
|
||||||
|
if (kldload(SMBFS_VFSNAME))
|
||||||
|
err(EX_OSERR, "kldload("SMBFS_VFSNAME")");
|
||||||
|
error = getvfsbyname(SMBFS_VFSNAME, &vfc);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (error)
|
if (error)
|
||||||
errx(EX_OSERR, "SMB filesystem is not available");
|
errx(EX_OSERR, "SMB filesystem is not available");
|
||||||
#endif
|
|
||||||
|
|
||||||
if (smb_lib_init() != 0)
|
if (smb_lib_init() != 0)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user