From 489f0e16b96041b80620f9d1c29bc2f3d471fe11 Mon Sep 17 00:00:00 2001 From: jdolecek Date: Mon, 7 Apr 2003 12:36:26 +0000 Subject: [PATCH] fix a fatal pasto in -O parsing code - if only the 'cowner:cgroup' part would be specified (i.e. no '/' in the string), smb_parse_owner() would be called with NULL 'cp' with obvious results; call it with 'p' instead, so that the 'sowner:sgroup' is really optional as the code intended problem pointed out by Masao Uebayashi in private mail smb_parse_owner(): put the group/user name in apostrophes in error message, for readability --- dist/smbfs/lib/smb/ctx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/smbfs/lib/smb/ctx.c b/dist/smbfs/lib/smb/ctx.c index 6aa0fdcfb44f..81d84924c9b8 100644 --- a/dist/smbfs/lib/smb/ctx.c +++ b/dist/smbfs/lib/smb/ctx.c @@ -33,7 +33,7 @@ */ #include -__RCSID("$NetBSD: ctx.c,v 1.3 2003/04/04 08:05:32 jdolecek Exp $"); +__RCSID("$NetBSD: ctx.c,v 1.4 2003/04/07 12:36:26 jdolecek Exp $"); #include #include @@ -366,7 +366,7 @@ smb_parse_owner(char *pair, uid_t *uid, gid_t *gid) if (gr) { *gid = gr->gr_gid; } else - smb_error("Invalid group name %s, ignored", + smb_error("Invalid group name '%s', ignored", 0, cp); } } @@ -375,7 +375,7 @@ smb_parse_owner(char *pair, uid_t *uid, gid_t *gid) if (pw) { *uid = pw->pw_uid; } else - smb_error("Invalid user name %s, ignored", 0, pair); + smb_error("Invalid user name '%s', ignored", 0, pair); } endpwent(); return 0; @@ -412,7 +412,7 @@ smb_ctx_opt(struct smb_ctx *ctx, int opt, const char *arg) &ctx->ct_sh.ioc_group); } if (*p && error == 0) { - error = smb_parse_owner(cp, &ctx->ct_ssn.ioc_owner, + error = smb_parse_owner(p, &ctx->ct_ssn.ioc_owner, &ctx->ct_ssn.ioc_group); } free(p);