New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
9877 Want t_koptmgmt in kTLI, and 9872 #38
Conversation
NEX-8707 smb/server in 4.0.x does not accept username@hostname Reviewed by: Evan Layton <evan.layton@nexenta.com> Reviewed by: Gordon Ross <gordon.ross@nexenta.com> and: (JBK review)
Part of the following change: NEX-16824 SMB client connection setup rework Reviewed by: Evan Layton <evan.layton@nexenta.com> Reviewed by: Matt Barden <matt.barden@nexenta.com>
buf = strdup(tmp_user.lg_e_username); | ||
if (buf == NULL) | ||
goto errout; | ||
p = buf + (p - tmp_user.lg_e_username); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need a strtok() in the kernel. I'm assuming we don't have one already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can live with it as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, this is user space. Maybe just use strtok_r() instead of baking your own.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think strtok is the 'right tool' here. We already know, from strchr(), where in the string the character we want to overwrite is; Converting just the if-block to use strtok would just make us search the string for it again, and I don't see why we'd want to do that. And since we need to dup the string if we're going to modify it, we can't use strtok() to find the token in the first instance. I'd rather keep it as-is.
usr/src/cmd/smbsrv/smbd/smbd_logon.c
Outdated
@@ -193,7 +201,18 @@ smbd_user_auth_logon(smb_logon_t *user_info) | |||
token->tkn_audit_sid = entry->sa_audit_sid; | |||
} | |||
|
|||
if (buf != NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is unnecessary -- free(NULL) is safe in user space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, it would be cool if adt_end_session() had the same safety (nop if argument is NULL). Maybe it already does? I haven't looked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, adt_end_session is OK to call with NULL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as suggested.
ctlsize = sizeof (*opt_req) + optlen; | ||
ctlbuf = kmem_alloc(ctlsize, KM_SLEEP); | ||
|
||
/* LINTED E_BAD_PTR_CAST_ALIGN */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually prefer to cast through (void *) for this and avoid the LINTED complaints. That tends to satisfy other compiler warning systems too. But I'm also ok with this for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just copied from libnsl... (or somewhere, but I think that was it:)
I'm good with that answer
Get Outlook for Android<https://aka.ms/ghei36>
________________________________
From: mbarden <notifications@github.com>
Sent: Monday, October 8, 2018 11:56:28 AM
To: illumos/illumos-gate
Cc: gdamore; Comment
Subject: Re: [illumos/illumos-gate] 9877 Want t_koptmgmt in kTLI, and 9872 (#38)
@mbarden commented on this pull request.
________________________________
In usr/src/cmd/smbsrv/smbd/smbd_logon.c<#38 (comment)>:
@@ -109,7 +111,20 @@ smbd_user_auth_logon(smb_logon_t *user_info)
} else {
tmp_user.lg_e_username = tmp_user.lg_username;
}
- tmp_user.lg_e_domain = tmp_user.lg_domain;
+
+ /* Handle user@domain format. */
+ if (tmp_user.lg_domain[0] == '\0' &&
+ (p = strchr(tmp_user.lg_e_username, '@')) != NULL) {
+ buf = strdup(tmp_user.lg_e_username);
+ if (buf == NULL)
+ goto errout;
+ p = buf + (p - tmp_user.lg_e_username);
I don't think strtok is the 'right tool' here. We already know, from strchr(), where in the string the character we want to overwrite is; Converting just the if-block to use strtok would just make us search the string for it again, and I don't see why we'd want to do that. And since we need to dup the string if we're going to modify it, we can't use strtok() to find the token in the first instance. I'd rather keep it as-is.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#38 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABPDfUPgygwt5iJcXg2PyW4_1tR8v6s2ks5ui5_bgaJpZM4XNYXr>.
|
Anyone else? I'd like to RTI this. |
I think you should RTI it. |
Would like these integrated ahead of the rest of #37 so people can test that by just loading a new package.