summaryrefslogtreecommitdiff
path: root/usr/src/lib/libsmbfs/smb/ctx.c
diff options
context:
space:
mode:
authorGordon Ross <Gordon.Ross@Sun.COM>2009-12-16 15:03:38 -0500
committerGordon Ross <Gordon.Ross@Sun.COM>2009-12-16 15:03:38 -0500
commit02d09e03eb27f3a2dc299de704e45dae5173f43f (patch)
treed01a29c58a8a455627b355abb83addad11802bd6 /usr/src/lib/libsmbfs/smb/ctx.c
parentaab2fe4104e428e5213f84aee65b9905ec97cf9a (diff)
downloadillumos-joyent-02d09e03eb27f3a2dc299de704e45dae5173f43f.tar.gz
6650611 Attribute cache logic needs improvement
6876185 common I/F for net message build/parse in kernel vs user code 6891728 syslog shows: smbfs_close: error 9 closing /dirname 6906037 smbfs_mount() doesn't ASSERT the return value of smbfs_make_node() 6607536 the size of a dir on smbfs is not correct 6648146 smbfs should implement reclaim from node cache --HG-- rename : usr/src/lib/libsmbfs/smb/acl_conv.c => usr/src/common/smbclnt/smbfs_ntacl.c rename : usr/src/lib/libsmbfs/smb/acl_nt.h => usr/src/common/smbclnt/smbfs_ntacl.h
Diffstat (limited to 'usr/src/lib/libsmbfs/smb/ctx.c')
-rw-r--r--usr/src/lib/libsmbfs/smb/ctx.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/usr/src/lib/libsmbfs/smb/ctx.c b/usr/src/lib/libsmbfs/smb/ctx.c
index 04057ac334..40a62a3853 100644
--- a/usr/src/lib/libsmbfs/smb/ctx.c
+++ b/usr/src/lib/libsmbfs/smb/ctx.c
@@ -253,22 +253,30 @@ smb_ctx_init(struct smb_ctx *ctx)
ctx->ct_authflags = SMB_AT_DEFAULT;
ctx->ct_minauth = SMB_AT_DEFAULT;
- nb_ctx_setscope(ctx->ct_nb, "");
+ error = nb_ctx_setscope(ctx->ct_nb, "");
+ if (error)
+ return (error);
/*
* if the user name is not specified some other way,
* use the current user name (built-in default)
*/
if (getpwuid_r(getuid(), &pw, pwbuf, sizeof (pwbuf)) != NULL) {
- smb_ctx_setuser(ctx, pw.pw_name, 0);
+ error = smb_ctx_setuser(ctx, pw.pw_name, 0);
+ if (error)
+ return (error);
ctx->ct_home = strdup(pw.pw_name);
+ if (ctx->ct_home == NULL)
+ return (ENOMEM);
}
/*
* Set a built-in default domain (workgroup).
* Using the Windows/NT default for now.
*/
- smb_ctx_setdomain(ctx, "WORKGROUP", 0);
+ error = smb_ctx_setdomain(ctx, "WORKGROUP", 0);
+ if (error)
+ return (error);
return (error);
}
@@ -571,7 +579,7 @@ smb_ctx_parseunc(struct smb_ctx *ctx, const char *unc,
*/
if (strchr(tmp, '%'))
(void) unpercent(tmp);
- smb_ctx_setfullserver(ctx, tmp);
+ error = smb_ctx_setfullserver(ctx, tmp);
if (error)
goto out;
@@ -771,7 +779,7 @@ smb_ctx_setpassword(struct smb_ctx *ctx, const char *passwd, int from_cmd)
memset(ctx->ct_password, 0, sizeof (ctx->ct_password));
if (strncmp(passwd, "$$1", 3) == 0)
- smb_simpledecrypt(ctx->ct_password, passwd);
+ (void) smb_simpledecrypt(ctx->ct_password, passwd);
else
strlcpy(ctx->ct_password, passwd,
sizeof (ctx->ct_password));
@@ -1387,14 +1395,15 @@ smb_ctx_readrcsection(struct smb_ctx *ctx, const char *sname, int level)
if (p) {
/*
* "signing" was set in this section; override
- * the current signing settings.
+ * the current signing settings. Note:
+ * setsigning flags are: enable, require
*/
if (strcmp(p, "disabled") == 0) {
- smb_ctx_setsigning(ctx, FALSE, FALSE);
+ (void) smb_ctx_setsigning(ctx, FALSE, FALSE);
} else if (strcmp(p, "enabled") == 0) {
- smb_ctx_setsigning(ctx, TRUE, FALSE);
+ (void) smb_ctx_setsigning(ctx, TRUE, FALSE);
} else if (strcmp(p, "required") == 0) {
- smb_ctx_setsigning(ctx, TRUE, TRUE);
+ (void) smb_ctx_setsigning(ctx, TRUE, TRUE);
} else {
/*
* Unknown "signing" value.