summaryrefslogtreecommitdiff
path: root/usr/src/lib/libsmbfs/smb/nb.c
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/smb/nb.c
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/smb/nb.c')
-rw-r--r--usr/src/lib/libsmbfs/smb/nb.c18
1 files changed, 6 insertions, 12 deletions
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);
}