From 42d159821800ff240cc201c8fe07f575b9e8a62b Mon Sep 17 00:00:00 2001 From: Gordon Ross Date: Fri, 26 Mar 2010 20:19:35 -0400 Subject: 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 --- usr/src/lib/libsmbfs/smb/nb.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'usr/src/lib/libsmbfs/smb/nb.c') 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); } -- cgit v1.2.3