ALT Linux Bugzilla
– Attachment 3435 Details for
Bug 19544
Не работает аутентификация при вызове cifsmount с -o sec=krb5, если указывается ip-адрес или не каноническое имя сервера
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Новый патч
cifs.upcall-resolve-cname.patch (text/plain), 1.49 KB, created by
rlz
on 2009-04-09 14:26:35 MSD
(
hide
)
Description:
Новый патч
Filename:
MIME Type:
Creator:
rlz
Created:
2009-04-09 14:26:35 MSD
Size:
1.49 KB
patch
obsolete
>Author: Dmitry M. Maslennikov <rlz at altlinux.org> >diff --git a/samba/source/client/cifs.upcall.c b/samba/source/client/cifs.upcall.c >index 238b861..4461636 100644 >--- a/samba/source/client/cifs.upcall.c >+++ b/samba/source/client/cifs.upcall.c >@@ -209,6 +209,31 @@ cifs_resolver(const key_serial_t key, const char *key_descr) > return 0; > } > >+const char * >+cifs_get_cname(const char * name) >+{ >+ static char buf[NI_MAXHOST]; >+ struct addrinfo * info; >+ int ret = getaddrinfo(name, 0, 0, &info); >+ if(ret) >+ { >+ syslog(LOG_WARNING, "getaddrinfo: %s", >+ gai_strerror(ret)); >+ return NULL; >+ } >+ ret = getnameinfo(info->ai_addr, info->ai_addrlen, >+ buf, sizeof(buf), 0, 0, 0); >+ if(ret) >+ { >+ syslog(LOG_WARNING, "getnameinfo: %s", >+ gai_strerror(ret)); >+ freeaddrinfo(info); >+ return NULL; >+ } >+ freeaddrinfo(info); >+ return buf; >+} >+ > static void > usage(void) > { >@@ -316,8 +341,13 @@ int main(const int argc, char *const argv[]) > char *princ; > size_t len; > >+ const char * cname = cifs_get_cname(hostname); >+ if (!cname) { >+ rc = 1; >+ break; >+ } > /* for "cifs/" service name + terminating 0 */ >- len = strlen(hostname) + 5 + 1; >+ len = strlen(cname) + 5 + 1; > princ = SMB_XMALLOC_ARRAY(char, len); > if (!princ) { > rc = 1; >@@ -328,7 +358,7 @@ int main(const int argc, char *const argv[]) > } else { > strlcpy(princ, "host/", len); > } >- strlcpy(princ + 5, hostname, len - 5); >+ strlcpy(princ + 5, cname, len - 5); > > if (sectype == MS_KRB5) > oid = OID_KERBEROS5_OLD;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 19544
:
3434
| 3435