Print this page
NEX-17457 kernel share list fails to be updated after fs import
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
NEX-9808 SMB3 persistent handles
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-9808 SMB3 persistent handles
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
NEX-10098 Disabling SMB server service does not change the sharestate of a smb share to “offline”.
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
NEX-4083 Upstream changes from illumos 5917 and 5995
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
NEX-2188 Browsing top level share produces RPC error 1728
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/cmd/smbsrv/fksmbd/fksmbd_shr.c
+++ new/usr/src/cmd/smbsrv/fksmbd/fksmbd_shr.c
1 1 /*
2 2 * This file and its contents are supplied under the terms of the
|
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
3 3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 4 * You may only use this file in accordance with the terms of version
5 5 * 1.0 of the CDDL.
6 6 *
7 7 * A full copy of the text of the CDDL should have accompanied this
8 8 * source. A copy of the CDDL is also available via the Internet at
9 9 * http://www.illumos.org/license/CDDL.
10 10 */
11 11
12 12 /*
13 - * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
13 + * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
14 14 */
15 15
16 16 /*
17 17 * Replace the smb_shr_load() function in libmlsvc, because
18 18 * fksmbd doesn't want the real shares known by libshare,
19 19 * instead preferring its own (fake) list of shares.
20 20 */
21 21
22 22 #include <sys/types.h>
23 23
24 24
25 25 #include <errno.h>
26 26 #include <stdio.h>
27 27 #include <stdlib.h>
28 28 #include <strings.h>
29 29 #include <syslog.h>
30 30 #include <libshare.h>
31 31 #include <unistd.h>
32 32 #include <note.h>
33 33
34 34 #include <smbsrv/libsmb.h>
35 35 #include <smbsrv/libsmbns.h>
36 36 #include <smbsrv/libmlsvc.h>
37 37 #include <smbsrv/smb_share.h>
38 38 #include <smbsrv/smb.h>
39 39
40 40 static void
41 41 new_share(char *name, char *path, char *comment, int flags)
42 42 {
43 43 smb_share_t si;
44 44
45 45 bzero(&si, sizeof (si));
46 46 (void) strlcpy(si.shr_name, name, MAXNAMELEN);
47 47 (void) strlcpy(si.shr_path, path, MAXPATHLEN);
48 48 (void) strlcpy(si.shr_cmnt, comment, SMB_SHARE_CMNT_MAX);
49 49 si.shr_flags = flags;
50 50 if (smb_shr_add(&si) != 0) {
51 51 syslog(LOG_ERR, "failed to add test share: %s",
52 52 si.shr_name);
53 53 }
54 54 }
55 55
56 56 /*
57 57 * This function loads a list of shares from a text file, where
58 58 * each line of the file contains:
59 59 * name path comment
60 60 *
61 61 * This is only for fksmbd, for testing.
62 62 */
63 63 void
64 64 shr_load_file(char *shr_file)
65 65 {
66 66 char linebuf[1024];
67 67 FILE *fp;
68 68 char *p;
69 69 char *name, *path, *comment;
70 70
71 71 fp = fopen(shr_file, "r");
72 72 if (fp == NULL) {
73 73 perror(shr_file);
74 74 return;
75 75 }
76 76
77 77 while ((p = fgets(linebuf, sizeof (linebuf), fp)) != NULL) {
78 78
79 79 name = p;
80 80 p = strpbrk(p, " \t\n");
81 81 if (p == NULL)
82 82 continue;
83 83 *p++ = '\0';
84 84
85 85 path = p;
86 86 p = strpbrk(p, " \t\n");
87 87 if (p == NULL)
88 88 comment = "";
89 89 else {
90 90 *p++ = '\0';
91 91
92 92 comment = p;
93 93 p = strchr(p, '\n');
94 94 if (p != NULL)
95 95 *p++ = '\0';
96 96 }
97 97 new_share(name, path, comment, 0);
98 98 }
99 99 (void) fclose(fp);
100 100 }
101 101
102 102 /*ARGSUSED*/
103 103 void *
104 104 smb_shr_load(void *args)
105 105 {
106 106 char *shr_file;
107 107 _NOTE(ARGUNUSED(args))
|
↓ open down ↓ |
84 lines elided |
↑ open up ↑ |
108 108
109 109 /*
110 110 * Not loading the real shares in fksmbd because that
111 111 * tries to enable the network/smb/server service.
112 112 * Also, we won't generally have access to everything
113 113 * in the real shares, because fksmbd runs (only) with
114 114 * the credentials of the user who runs it.
115 115 */
116 116 new_share("test", "/var/smb/test", "fksmbd test share",
117 117 SMB_SHRF_GUEST_OK);
118 + new_share("testca", "/var/smb/test", "fksmbd test CA share",
119 + SMB_SHRF_CA);
118 120
119 121 /* Allow creating lots of shares for testing. */
120 122 shr_file = getenv("FKSMBD_SHARE_FILE");
121 123 if (shr_file != NULL)
122 124 shr_load_file(shr_file);
123 125
124 126 return (NULL);
127 +}
128 +
129 +void
130 +smb_shr_load_execinfo()
131 +{
132 +}
133 +
134 +void
135 +smb_shr_unload()
136 +{
125 137 }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX