1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12 /*
13 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
14 */
15
16 /*
17 * Replace the smb_shr_load() function in libmlsvc, because
18 * fksmbd doesn't want the real shares known by libshare,
19 * instead preferring its own (fake) list of shares.
20 */
21
22 #include <sys/types.h>
23
24
25 #include <errno.h>
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <strings.h>
29 #include <syslog.h>
30 #include <libshare.h>
31 #include <unistd.h>
32 #include <note.h>
33
98 }
99 (void) fclose(fp);
100 }
101
102 /*ARGSUSED*/
103 void *
104 smb_shr_load(void *args)
105 {
106 char *shr_file;
107 _NOTE(ARGUNUSED(args))
108
109 /*
110 * Not loading the real shares in fksmbd because that
111 * tries to enable the network/smb/server service.
112 * Also, we won't generally have access to everything
113 * in the real shares, because fksmbd runs (only) with
114 * the credentials of the user who runs it.
115 */
116 new_share("test", "/var/smb/test", "fksmbd test share",
117 SMB_SHRF_GUEST_OK);
118
119 /* Allow creating lots of shares for testing. */
120 shr_file = getenv("FKSMBD_SHARE_FILE");
121 if (shr_file != NULL)
122 shr_load_file(shr_file);
123
124 return (NULL);
125 }
|
1 /*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12 /*
13 * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
14 */
15
16 /*
17 * Replace the smb_shr_load() function in libmlsvc, because
18 * fksmbd doesn't want the real shares known by libshare,
19 * instead preferring its own (fake) list of shares.
20 */
21
22 #include <sys/types.h>
23
24
25 #include <errno.h>
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <strings.h>
29 #include <syslog.h>
30 #include <libshare.h>
31 #include <unistd.h>
32 #include <note.h>
33
98 }
99 (void) fclose(fp);
100 }
101
102 /*ARGSUSED*/
103 void *
104 smb_shr_load(void *args)
105 {
106 char *shr_file;
107 _NOTE(ARGUNUSED(args))
108
109 /*
110 * Not loading the real shares in fksmbd because that
111 * tries to enable the network/smb/server service.
112 * Also, we won't generally have access to everything
113 * in the real shares, because fksmbd runs (only) with
114 * the credentials of the user who runs it.
115 */
116 new_share("test", "/var/smb/test", "fksmbd test share",
117 SMB_SHRF_GUEST_OK);
118 new_share("testca", "/var/smb/test", "fksmbd test CA share",
119 SMB_SHRF_CA);
120
121 /* Allow creating lots of shares for testing. */
122 shr_file = getenv("FKSMBD_SHARE_FILE");
123 if (shr_file != NULL)
124 shr_load_file(shr_file);
125
126 return (NULL);
127 }
128
129 void
130 smb_shr_load_execinfo()
131 {
132 }
133
134 void
135 smb_shr_unload()
136 {
137 }
|