Deleted Added
full compact
mount_smbfs.c (187583) mount_smbfs.c (250236)
1/*
2 * Copyright (c) 2000-2002, Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $Id: mount_smbfs.c,v 1.17 2002/04/10 04:17:51 bp Exp $
1/*
2 * Copyright (c) 2000-2002, Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $Id: mount_smbfs.c,v 1.17 2002/04/10 04:17:51 bp Exp $
33 * $FreeBSD: head/contrib/smbfs/mount_smbfs/mount_smbfs.c 187583 2009-01-22 08:29:39Z trhodes $
33 * $FreeBSD: head/contrib/smbfs/mount_smbfs/mount_smbfs.c 250236 2013-05-04 14:03:18Z davide $
34 */
35#include <sys/param.h>
36#include <sys/stat.h>
37#include <sys/errno.h>
38#include <sys/linker.h>
39#include <sys/mount.h>
40
41#include <stdio.h>

--- 35 unchanged lines hidden (view full) ---

77 struct stat st;
78#ifdef APPLE
79 extern void dropsuid();
80 extern int loadsmbvfs();
81#else
82 struct xvfsconf vfc;
83#endif
84 char *next;
34 */
35#include <sys/param.h>
36#include <sys/stat.h>
37#include <sys/errno.h>
38#include <sys/linker.h>
39#include <sys/mount.h>
40
41#include <stdio.h>

--- 35 unchanged lines hidden (view full) ---

77 struct stat st;
78#ifdef APPLE
79 extern void dropsuid();
80 extern int loadsmbvfs();
81#else
82 struct xvfsconf vfc;
83#endif
84 char *next;
85 int opt, error, mntflags, caseopt, dev;
85 int opt, error, mntflags, caseopt, fd;
86 uid_t uid;
87 gid_t gid;
88 mode_t dir_mode, file_mode;
89 char errmsg[255] = { 0 };
90
91 iov = NULL;
92 iovlen = 0;
86 uid_t uid;
87 gid_t gid;
88 mode_t dir_mode, file_mode;
89 char errmsg[255] = { 0 };
90
91 iov = NULL;
92 iovlen = 0;
93 dev = 0;
93 fd = 0;
94 uid = (uid_t)-1;
95 gid = (gid_t)-1;
96 caseopt = 0;
97 file_mode = 0;
98 dir_mode = 0;
99
100#ifdef APPLE
101 dropsuid();

--- 159 unchanged lines hidden (view full) ---

261 error = smb_ctx_resolve(ctx);
262 if (error)
263 exit(1);
264 error = smb_ctx_lookup(ctx, SMBL_SHARE, SMBLK_CREATE);
265 if (error) {
266 exit(1);
267 }
268
94 uid = (uid_t)-1;
95 gid = (gid_t)-1;
96 caseopt = 0;
97 file_mode = 0;
98 dir_mode = 0;
99
100#ifdef APPLE
101 dropsuid();

--- 159 unchanged lines hidden (view full) ---

261 error = smb_ctx_resolve(ctx);
262 if (error)
263 exit(1);
264 error = smb_ctx_lookup(ctx, SMBL_SHARE, SMBLK_CREATE);
265 if (error) {
266 exit(1);
267 }
268
269 dev = ctx->ct_fd;
269 fd = ctx->ct_fd;
270
271 build_iovec(&iov, &iovlen, "fstype", strdup("smbfs"), -1);
272 build_iovec(&iov, &iovlen, "fspath", mount_point, -1);
270
271 build_iovec(&iov, &iovlen, "fstype", strdup("smbfs"), -1);
272 build_iovec(&iov, &iovlen, "fspath", mount_point, -1);
273 build_iovec_argf(&iov, &iovlen, "dev", "%d", dev);
273 build_iovec_argf(&iov, &iovlen, "fd", "%d", fd);
274 build_iovec(&iov, &iovlen, "mountpoint", mount_point, -1);
275 build_iovec_argf(&iov, &iovlen, "uid", "%d", uid);
276 build_iovec_argf(&iov, &iovlen, "gid", "%d", gid);
277 build_iovec_argf(&iov, &iovlen, "file_mode", "%d", file_mode);
278 build_iovec_argf(&iov, &iovlen, "dir_mode", "%d", dir_mode);
279 build_iovec_argf(&iov, &iovlen, "caseopt", "%d", caseopt);
280 build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof errmsg);
281

--- 20 unchanged lines hidden ---
274 build_iovec(&iov, &iovlen, "mountpoint", mount_point, -1);
275 build_iovec_argf(&iov, &iovlen, "uid", "%d", uid);
276 build_iovec_argf(&iov, &iovlen, "gid", "%d", gid);
277 build_iovec_argf(&iov, &iovlen, "file_mode", "%d", file_mode);
278 build_iovec_argf(&iov, &iovlen, "dir_mode", "%d", dir_mode);
279 build_iovec_argf(&iov, &iovlen, "caseopt", "%d", caseopt);
280 build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof errmsg);
281

--- 20 unchanged lines hidden ---