summaryrefslogtreecommitdiff
path: root/usr/src/lib/libsmbfs
diff options
context:
space:
mode:
authorGordon Ross <Gordon.Ross@Sun.COM>2010-03-26 20:19:35 -0400
committerGordon Ross <Gordon.Ross@Sun.COM>2010-03-26 20:19:35 -0400
commit42d159821800ff240cc201c8fe07f575b9e8a62b (patch)
treea4e901af0d3640fb37060cb6a0a085bcb2fd18c5 /usr/src/lib/libsmbfs
parent1e81ac6e0a5d3782b6bdbcc7e2cbda4fda909ab9 (diff)
downloadillumos-joyent-42d159821800ff240cc201c8fe07f575b9e8a62b.tar.gz
6905120 mount -F smbfs as the Primary Administrator renders the mount point owned by root.
6912466 mount of share from Quantel server fails 6927024 Should defend against opens without closes 6935160 smbfs does not compile with gcc
Diffstat (limited to 'usr/src/lib/libsmbfs')
-rw-r--r--usr/src/lib/libsmbfs/smb/ctx.c10
-rw-r--r--usr/src/lib/libsmbfs/smb/nb.c18
2 files changed, 15 insertions, 13 deletions
diff --git a/usr/src/lib/libsmbfs/smb/ctx.c b/usr/src/lib/libsmbfs/smb/ctx.c
index 40a62a3853..d29ec7bf0b 100644
--- a/usr/src/lib/libsmbfs/smb/ctx.c
+++ b/usr/src/lib/libsmbfs/smb/ctx.c
@@ -33,7 +33,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -1253,6 +1253,14 @@ smb_ctx_get_tree(struct smb_ctx *ctx)
strlcpy(tcon->tc_sh.sh_name, ctx->ct_origshare,
sizeof (tcon->tc_sh.sh_name));
+ /*
+ * Share password (unused - no share-level security)
+ * MS-SMB 2.2.6 says this should be null terminated,
+ * and the length includes the null. Did bzero above,
+ * so just set length for the null.
+ */
+ tcon->tc_sh.sh_pwlen = 1;
+
/* The share "use" type. */
stype = smb_use_type_str(ctx->ct_shtype_req);
strlcpy(tcon->tc_sh.sh_type_req, stype,
diff --git a/usr/src/lib/libsmbfs/smb/nb.c b/usr/src/lib/libsmbfs/smb/nb.c
index 4957b88d2c..6a8eb8c2e4 100644
--- a/usr/src/lib/libsmbfs/smb/nb.c
+++ b/usr/src/lib/libsmbfs/smb/nb.c
@@ -33,7 +33,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -114,7 +114,6 @@ nb_ctx_create(struct nb_ctx **ctxpp)
if (ctx == NULL)
return (ENOMEM);
bzero(ctx, sizeof (struct nb_ctx));
- ctx->nb_flags = NBCF_NS_ENABLE | NBCF_BC_ENABLE;
*ctxpp = ctx;
return (0);
}
@@ -135,9 +134,9 @@ nb_ctx_setnbflags(struct nb_ctx *nb, int ns_ena, int bc_ena)
{
nb->nb_flags &= ~(NBCF_NS_ENABLE | NBCF_BC_ENABLE);
if (ns_ena) {
- nb->nb_flags = NBCF_NS_ENABLE;
+ nb->nb_flags |= NBCF_NS_ENABLE;
if (bc_ena)
- nb->nb_flags = NBCF_BC_ENABLE;
+ nb->nb_flags |= NBCF_BC_ENABLE;
}
}
@@ -284,16 +283,11 @@ nb_ctx_readrcsection(struct rcfile *rcfile, struct nb_ctx *ctx,
* have to get both boolean values first,
* either from settings or defaults.
*/
- nbns_enable = nbns_broadcast = -1; /* not set */
+ nbns_enable = nbns_broadcast = 1; /* defaults */
rc_getbool(rcfile, sname, "nbns_enable", &nbns_enable);
rc_getbool(rcfile, sname, "nbns_broadcast", &nbns_broadcast);
- if (nbns_enable >= 0 || nbns_broadcast >= 0) {
- if (nbns_enable < 0)
- nbns_enable = 1; /* default */
- if (nbns_broadcast < 0)
- nbns_broadcast = 1; /* default */
- nb_ctx_setnbflags(ctx, nbns_enable, nbns_broadcast);
- }
+ nb_ctx_setnbflags(ctx, nbns_enable, nbns_broadcast);
+
return (0);
}