git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add dkms_version conditional
[zfs.git]
/
lib
/
libshare
/
smb.c
diff --git
a/lib/libshare/smb.c
b/lib/libshare/smb.c
index
e34d142
..
a545bfb
100644
(file)
--- a/
lib/libshare/smb.c
+++ b/
lib/libshare/smb.c
@@
-423,7
+423,15
@@
static const sa_share_ops_t smb_shareops = {
static boolean_t
smb_available(void)
{
static boolean_t
smb_available(void)
{
- /* TODO: Sanity check NET_CMD_PATH and SHARE_DIR */
+ struct stat statbuf;
+
+ if (lstat(SHARE_DIR, &statbuf) != 0 ||
+ !S_ISDIR(statbuf.st_mode))
+ return B_FALSE;
+
+ if (access(NET_CMD_PATH, F_OK) != 0)
+ return B_FALSE;
+
return B_TRUE;
}
return B_TRUE;
}