cifs: allow multiuser mounts with authtypes besides krb5
cover cifs: allow multiuser mounts with authtypes besides krb5
When the multiuser mount code was initially introduced for cifs, I limited it to sec=krb5 auth. When a new user walks into a mount, we have no way to prompt for a username and password from the kernel, so the only auth type we could support was krb5.
This patchset extends the code to allow other auth types to use multiuser mounts. The idea here is for users to put their username and password for a particular server or domain into the keyring. The kernel can then look for that key and use those credentials to establish a session on the user's behalf.
Because of the quirkiness of keyring permissions, this patchset adds a new key type that does not allow the keys to be read from userspace. That should prevent compromise of the credentials by someone walking up to the user's machine while she is away at lunch.
The userspace tool to stash keys in the keyring is already in cifs-utils, but the current form will not work with this version of the kernel patchset. A patchset that updates the tool to be suitable for this purpose will follow.
Jeff Layton (3):
keys: add a "secret" key type
cifs: sanitize username handling
cifs: fetch credentials out of keyring for non-krb5 auth multiuser
mounts
fs/cifs/cifs_spnego.c | 10 ++- fs/cifs/cifsencrypt.c | 11 ++- fs/cifs/connect.c | 195 ++++++++++++++++++++++++++++++++++++++---- include/keys/user-type.h | 3 +- security/keys/internal.h | 1 + security/keys/key.c | 1 + security/keys/user_defined.c | 17 ++++ 7 files changed, 214 insertions(+), 24 deletions(-)
Signature · 1 line
1.7.7.4
PATCH 1/3 keys: add a "secret" key type
In reply to a message not in the archiveFor CIFS, we want to be able to store NTLM credentials (aka username and password) in the keyring. We do not, however want to allow users to fetch those keys back out of the keyring since that would be a security risk.
Unfortunately, due to the nuances of key permission bits, it's not possible to do this. We need to grant search permissions so the kernel can find these keys, but that also implies permissions to read the payload.
Resolve this by adding a new key_type. This key type is essentially the same as key_type_user, but does not define a .read op. This prevents the payload from ever being visible from userspace.
--- include/keys/user-type.h | 3 ++- security/keys/internal.h | 1 + security/keys/key.c | 1 + security/keys/user_defined.c | 17 +++++++++++++++++ 4 files changed, 21 insertions(+), 1 deletions(-)
include/keys/user-type.h +2 -1
@@ -17,7 +17,7 @@/*****************************************************************************/ /* -* the payload for a key of type "user" +* the payload for a key of type "user" or "secret" * - once filled in and attached to a key: * - the payload struct is invariant may not be changed, only replaced * - the payload must be read with RCU procedures or with the key semaphore
@@ -33,6 +33,7 @@ struct user_key_payload { };extern struct key_type key_type_user; +extern struct key_type key_type_secret;extern int user_instantiate (struct key *key,const void *data,size_t datalen);extern int user_update (struct key *key,const void *data,size_t datalen);
security/keys/internal.h +1 -0
@@ -33,6 +33,7 @@extern struct key_type key_type_dead;extern struct key_type key_type_user; +extern struct key_type key_type_secret;/*****************************************************************************/ /*
security/keys/key.c +1 -0
@@ -996,6 +996,7 @@ void __init key_init(void)list_add_tail (&key_type_keyring.link, &key_types_list);list_add_tail (&key_type_dead.link, &key_types_list);list_add_tail (&key_type_user.link, &key_types_list); +list_add_tail (&key_type_secret.link, &key_types_list);/* record the root user tracking */ rb_link_node(&root_key_user.node,
security/keys/user_defined.c +17 -0
@@ -36,6 +36,23 @@ struct key_type key_type_user = {EXPORT_SYMBOL_GPL (key_type_user);/* +* This key type is essentially the same as key_type_user, but it does +* not define a .read op. This is suitable for storing information in +* the keyring that you do not want to be readable from userspace. For +* instance, passwords or secret encryption keys. +*/ +struct key_type key_type_secret = { + .name ="secret" , + .instantiate = user_instantiate, + .update = user_update, + .match = user_match, + .revoke = user_revoke, + .destroy = user_destroy, + .describe = user_describe, +}; +EXPORT_SYMBOL_GPL (key_type_secret); + +/* * instantiate a user defined key */ int user_instantiate (struct key *key,const void *data,size_t datalen)
Signature · 1 line
1.7.7.4
PATCH 2/3 cifs: sanitize username handling
In reply to a message not in the archiveCurrently, it's not very clear whether you're allowed to have a NULL vol->username or ses->user_name. Some places check for it and some don't.
Make it clear that a NULL pointer is OK in these fields, and ensure that all the callers check for that.
--- fs/cifs/cifs_spnego.c | 10 +++++++--- fs/cifs/cifsencrypt.c | 11 ++++++++--- fs/cifs/connect.c | 19 ++++++++++++------- 3 files changed, 27 insertions(+), 13 deletions(-)
fs/cifs/cifs_spnego.c +7 -3
@@ -113,9 +113,11 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)MAX_MECH_STR_LEN +UID_KEY_LEN + (sizeof (uid_t) *2 ) +CREDUID_KEY_LEN + (sizeof (uid_t) *2 ) + -USER_KEY_LEN +strlen (sesInfo->user_name) +PID_KEY_LEN + (sizeof (pid_t) *2 ) +1 ; +if (sesInfo->user_name) + desc_len =USER_KEY_LEN +strlen (sesInfo->user_name); + spnego_key =ERR_PTR (-ENOMEM ); description =kzalloc (desc_len,GFP_KERNEL );if (description ==NULL )
@@ -152,8 +154,10 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo) dp = description +strlen (description);sprintf (dp,";creduid=0x%x" , sesInfo->cred_uid); - dp = description +strlen (description); -sprintf (dp,";user=%s" , sesInfo->user_name); +if (sesInfo->user_name) { + dp = description +strlen (description); +sprintf (dp,";user=%s" , sesInfo->user_name); + } dp = description +strlen (description);sprintf (dp,";pid=0x%x" , current->pid);
fs/cifs/cifsencrypt.c +8 -3
@@ -420,15 +420,20 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash, }/* convert ses->user_name to unicode and uppercase */ - len =strlen (ses->user_name); + len = ses->user_name ?strlen (ses->user_name) :0 ; user =kmalloc (2 + (len *2 ),GFP_KERNEL );if (user ==NULL ) {cERROR (1 ,"calc_ntlmv2_hash: user mem alloc failure\n" ); rc = -ENOMEM ;return rc; } - len =cifs_strtoUCS ((__le16 *)user, ses->user_name, len, nls_cp); -UniStrupr (user); + +if (len) { + len =cifs_strtoUCS ((__le16 *)user, ses->user_name, len, nls_cp); +UniStrupr (user); + }else { +memset (user,'\0' ,2 ); + } rc =crypto_shash_update (&ses->server->secmech.sdeschmacmd5->shash, (char *)user,2 * len);
fs/cifs/connect.c +12 -7
@@ -1997,10 +1997,16 @@ static int match_session(struct cifs_ses *ses, struct smb_vol *vol)return 0 ;break ;default : +/* NULL username means anonymous session */ +if (ses->user_name ==NULL ) { +if (!vol->nullauth) +return 0 ; +break ; + } +/* anything else takes username/password */ -if (ses->user_name ==NULL ) -return 0 ; -if (strncmp (ses->user_name, vol->username, +if (strncmp (ses->user_name, + vol->username ? vol->username:"" ,MAX_USERNAME_SIZE ))return 0 ; if (strlen(vol->username) != 0 &&
@@ -3152,10 +3158,9 @@ cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,return -EINVAL ;if (volume_info->nullauth) { -cFYI (1 ,"null user" ); - volume_info->username =kzalloc (1 ,GFP_KERNEL ); -if (volume_info->username ==NULL ) -return -ENOMEM ; +cFYI (1 ,"Anonymous login" ); +kfree (volume_info->username); + volume_info->username =NULL ; }else if (volume_info->username) {/* BB fixme parse for domain name here */ cFYI (1 ,"Username: %s" , volume_info->username);
Signature · 1 line
1.7.7.4
PATCH 3/3 cifs: fetch credentials out of keyring for non-krb5 auth multiuser mounts
In reply to a message not in the archiveFix up multiuser mounts to set the secType and set the username and password from the key payload in the vol info for non-krb5 auth types.
Look for a key of type "secret" with a description of "cifs:a:<server address>" or "cifs:d:<domainname>". If that's found, then scrape the username and password out of the key payload and use that to create a new user session.
Finally, don't have the code enforce krb5 auth on multiuser mounts, but do require a kernel with keys support.
--- fs/cifs/connect.c | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 166 insertions(+), 10 deletions(-)
fs/cifs/connect.c +166 -10
@@ -38,6 +38,7 @@#include <asm/processor.h> #include <linux/inet.h> #include <linux/module.h> +#include <keys/user-type.h> #include <net/ipv6.h> #include "cifspdu.h" #include "cifsglob.h"
@@ -1594,11 +1595,14 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, } } -if (vol->multiuser && !(vol->secFlg &CIFSSEC_MAY_KRB5 )) { -cERROR (1 ,"Multiuser mounts currently require krb5 " -"authentication!" ); +#ifndef CONFIG_KEYS +/* Muliuser mounts require CONFIG_KEYS support */ +if (vol->multiuser) { +cERROR (1 ,"Multiuser mounts require kernels with " +"CONFIG_KEYS enabled." ); goto cifs_parse_mount_err; } +#endif if (vol->UNCip ==NULL ) vol->UNCip = &vol->UNC[2 ];
@@ -2061,6 +2065,133 @@ cifs_put_smb_ses(struct cifs_ses *ses)cifs_put_tcp_session (server); } +#ifdef CONFIG_KEYS + +/* strlen("cifs:a:") + INET6_ADDRSTRLEN + 1 */ +#define CIFSCREDS_DESC_SIZE (7 + INET6_ADDRSTRLEN + 1) + +/* Populate username and pw fields from keyring if possible */ +static int +cifs_set_cifscreds (struct smb_vol *vol,struct cifs_ses *ses) +{ +int rc =0 ; +char *desc, *delim, *payload; +ssize_t len; +struct key *key; +struct TCP_Server_Info *server = ses->server; +struct sockaddr_in *sa; +struct sockaddr_in6 *sa6; +struct user_key_payload *upayload; + + desc =kmalloc (CIFSCREDS_DESC_SIZE ,GFP_KERNEL ); +if (!desc) +return -ENOMEM ; + +/* try to find an address key first */ +switch (server->dstaddr.ss_family) { +case AF_INET : + sa = (struct sockaddr_in *)&server->dstaddr; +sprintf (desc,"cifs:a:%pI4" , &sa->sin_addr.s_addr); +break ; +case AF_INET6 : + sa6 = (struct sockaddr_in6 *)&server->dstaddr; +sprintf (desc,"cifs:a:%pI6c" , &sa6->sin6_addr.s6_addr); +break ; +default : +cFYI (1 ,"Bad ss_family (%hu)" , server->dstaddr.ss_family); + rc = -EINVAL ; + goto out_err; + } + +cFYI (1 ,"%s: desc=%s" , __func__, desc); + key =request_key (&key_type_secret, desc,"" ); +if (IS_ERR (key)) { +if (!ses->domainName) { +cFYI (1 ,"domainName is NULL" ); + rc =PTR_ERR (key); + goto out_err; + } + +/* didn't work, try to find a domain key */ +sprintf (desc,"cifs:d:%s" , ses->domainName); +cFYI (1 ,"%s: desc=%s" , __func__, desc); + key =request_key (&key_type_secret, desc,"" ); +if (IS_ERR (key)) { + rc =PTR_ERR (key); + goto out_err; + } + } + +down_read (&key->sem); + upayload = key->payload.data; +if (IS_ERR_OR_NULL (upayload)) { + rc =PTR_ERR (key); + goto out_key_put; + } + +/* find first : in payload */ + payload = (char *)upayload->data; + delim =strnchr (payload, upayload->datalen,':' ); +cFYI (1 ,"payload=%s" , payload); +if (!delim) { +cFYI (1 ,"Unable to find ':' in payload (datalen=%d)" , + upayload->datalen); + rc = -EINVAL ; + goto out_key_put; + } + + len = delim - payload; +if (len >MAX_USERNAME_SIZE || len <=0 ) { +cFYI (1 ,"Bad value from username search (len=%ld)" , len); + rc = -EINVAL ; + goto out_key_put; + } + + vol->username =kstrndup (payload, len,GFP_KERNEL ); +if (!vol->username) { +cFYI (1 ,"Unable to allocate %ld bytes for username" , len); + rc = -ENOMEM ; + goto out_key_put; + } +cFYI (1 ,"username=%s" , vol->username); + + len = key->datalen - (len +1 ); +if (len >MAX_PASSWORD_SIZE || len <=0 ) { +cFYI (1 ,"Bad len for password search (len=%ld)" , len); + rc = -EINVAL ; +kfree (vol->username); + vol->username =NULL ; + goto out_key_put; + } + + ++delim; + vol->password =kstrndup (delim, len,GFP_KERNEL ); +if (!vol->password) { +cFYI (1 ,"Unable to allocate %ld bytes for password" , len); + rc = -ENOMEM ; +kfree (vol->username); + vol->username =NULL ; + goto out_key_put; + } +cFYI (1 ,"password=%s" , vol->password); + +out_key_put: +up_read (&key->sem); +key_put (key); +out_err: +kfree (desc); +cFYI (1 ,"%s: returning %d" , __func__, rc); +return rc; +} +#else /* ! CONFIG_KEYS */ +static inline int +cifs_set_cifscreds (struct smb_vol *vol __attribute__((unused)), +struct cifs_ses *ses __attribute__((unused))) +{ +return -ENOSYS ; +} +#endif /* CONFIG_KEYS */ +static bool warned_on_ntlm;/* globals init to false automatically */ static struct cifs_ses *
@@ -3678,16 +3809,38 @@ int cifs_setup_session(unsigned int xid, struct cifs_ses *ses,return rc; } +static int +cifs_set_vol_auth (struct smb_vol *vol,struct cifs_ses *ses) +{ +switch (ses->server->secType) { +case Kerberos: + vol->secFlg =CIFSSEC_MUST_KRB5 ; +return 0 ; +case NTLMv2: + vol->secFlg =CIFSSEC_MUST_NTLMV2 ; +break ; +case NTLM : + vol->secFlg =CIFSSEC_MUST_NTLM ; +break ; +case RawNTLMSSP: + vol->secFlg =CIFSSEC_MAY_NTLMSSP ; +break ; +case LANMAN : + vol->secFlg =CIFSSEC_MAY_LANMAN ; +break ; + } + +return cifs_set_cifscreds (vol, ses); +} +static struct cifs_tcon *cifs_construct_tcon (struct cifs_sb_info *cifs_sb,uid_t fsuid) { +int rc;struct cifs_tcon *master_tcon =cifs_sb_master_tcon (cifs_sb);struct cifs_ses *ses;struct cifs_tcon *tcon =NULL ;struct smb_vol *vol_info; -char username[28 ];/* big enough for "krb50x" + hex of ULONG_MAX 6+16 */ -/* We used to have this as MAX_USERNAME which is */ -/* way too big now (256 instead of 32) */ vol_info =kzalloc (sizeof (*vol_info),GFP_KERNEL );if (vol_info ==NULL ) {
@@ -3695,8 +3848,6 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) goto out; } -snprintf (username,sizeof (username),"krb50x%x" , fsuid); - vol_info->username = username; vol_info->local_nls = cifs_sb->local_nls; vol_info->linux_uid = fsuid; vol_info->cred_uid = fsuid;
@@ -3706,8 +3857,11 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) vol_info->local_lease = master_tcon->local_lease; vol_info->no_linux_ext = !master_tcon->unix_ext; -/* FIXME: allow for other secFlg settings */ - vol_info->secFlg =CIFSSEC_MUST_KRB5 ; + rc =cifs_set_vol_auth (vol_info, master_tcon->ses); +if (rc) { + tcon =ERR_PTR (rc); + goto out; + }/* get a reference for the same TCP session */ spin_lock (&cifs_tcp_ses_lock);
@@ -3730,6 +3884,8 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid)if (ses->capabilities &CAP_UNIX )reset_cifs_unix_caps (0 , tcon,NULL , vol_info); out: +kfree (vol_info->username); +kfree (vol_info->password);kfree (vol_info);return tcon;
Signature · 1 line
1.7.7.4
Re: [PATCH 2/3] cifs: sanitize username handling
In reply to a message not in the archiveQuoted 24 lines · Jeff Layton
Currently, it's not very clear whether you're allowed to have a NULL
vol->usernameorses->user_name. Some places check for it and some don't.Make it clear that a NULL pointer is OK in these fields, and ensure that all the callers check for that.
Signed-off-by Jeff Layton <[email protected]>---
fs/cifs/cifs_spnego.c | 10 +++++++---
fs/cifs/cifsencrypt.c | 11 ++++++++---
fs/cifs/connect.c | 19 ++++++++++++-------3 files changed, 27 insertions(+), 13 deletions(-)fs/cifs/cifs_spnego.c +0
-0@@ -113,9 +113,11 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)
MAX_MECH_STR_LEN+
UID_KEY_LEN+ (sizeof(uid_t)* 2) +CREDUID_KEY_LEN+ (sizeof(uid_t)* 2) +
- USER_KEY_LEN +strlen(sesInfo->user_name)+PID_KEY_LEN+ (sizeof(pid_t)* 2) + 1;
Quoted 2 lines
+ if (
sesInfo->user_name)
+desc_len=USER_KEY_LEN+strlen(sesInfo->user_name);
should this be += instead of =
Quoted 90 lines
+
spnego_key =ERR_PTR(-ENOMEM); description =kzalloc(desc_len, GFP_KERNEL); if (description == NULL)fs/cifs/cifs_spnego.c +4
-2@@ -152,8 +154,10 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo) dp = description + strlen(description); sprintf(dp, ";creduid=0x%x", sesInfo->cred_uid); - dp = description + strlen(description); - sprintf(dp, ";user=%s", sesInfo->user_name); + if (sesInfo->user_name) { + dp = description + strlen(description); + sprintf(dp, ";user=%s", sesInfo->user_name); + } dp = description + strlen(description); sprintf(dp, ";pid=0x%x", current->pid);fs/cifs/cifsencrypt.c +8
-3@@ -420,15 +420,20 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash, } /* convert ses->user_name to unicode and uppercase */ - len = strlen(ses->user_name); + len = ses->user_name ? strlen(ses->user_name) : 0; user = kmalloc(2 + (len * 2), GFP_KERNEL); if (user == NULL) { cERROR(1, "calc_ntlmv2_hash: user mem alloc failure\n"); rc = -ENOMEM; return rc; } - len = cifs_strtoUCS((__le16 *)user, ses->user_name, len, nls_cp); - UniStrupr(user); + + if (len) { + len = cifs_strtoUCS((__le16 *)user, ses->user_name, len, nls_cp); + UniStrupr(user); + } else { + memset(user, '\0', 2); + } rc = crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash, (char *)user, 2 * len);fs/cifs/connect.c +0
-0@@ -1997,10 +1997,16 @@ static int match_session(struct cifs_ses *ses, struct smb_vol *vol) return 0; break;default:
+ /* NULL username means anonymous session */
+ if (ses->user_name== NULL) {
+ if (!vol->nullauth)
+ return 0;
+ break;
+ }
+
/* anything else takes username/password */
- if (ses->user_name== NULL)
- return 0;
- if (strncmp(ses->user_name,vol->username,
+ if (strncmp(ses->user_name,
+vol->username?vol->username: "",MAX_USERNAME_SIZE)) return 0;
if (strlen(vol->username)!= 0 &&fs/cifs/connect.c +3
-5@@ -3152,10 +3158,9 @@ cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data, return -EINVAL; if (volume_info->nullauth) { - cFYI(1, "null user"); - volume_info->username = kzalloc(1, GFP_KERNEL); - if (volume_info->username == NULL) - return -ENOMEM; + cFYI(1, "Anonymous login"); + kfree(volume_info->username); + volume_info->username = NULL; } else if (volume_info->username) { /* BB fixme parse for domain name here */ cFYI(1, "Username: %s", volume_info->username); --1.7.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] cifs: sanitize username handling
In reply to a message not in the archiveQuoted 25 lines · On Fri, 6 Jan 2012 09:55:11 -0600 Shirish Pargaonkar…
Quoted 24 lines · Jeff Layton
Currently, it's not very clear whether you're allowed to have a NULL
vol->usernameorses->user_name. Some places check for it and some don't.Make it clear that a NULL pointer is OK in these fields, and ensure that all the callers check for that.
Signed-off-by Jeff Layton <[email protected]>---
fs/cifs/cifs_spnego.c | 10 +++++++---
fs/cifs/cifsencrypt.c | 11 ++++++++---
fs/cifs/connect.c | 19 ++++++++++++-------3 files changed, 27 insertions(+), 13 deletions(-)fs/cifs/cifs_spnego.c +0
-0@@ -113,9 +113,11 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo)
MAX_MECH_STR_LEN+
UID_KEY_LEN+ (sizeof(uid_t)* 2) +CREDUID_KEY_LEN+ (sizeof(uid_t)* 2) +
- USER_KEY_LEN +strlen(sesInfo->user_name)+PID_KEY_LEN+ (sizeof(pid_t)* 2) + 1;
Quoted 5 lines
Quoted 2 lines
+ if (
sesInfo->user_name)
+desc_len=USER_KEY_LEN+strlen(sesInfo->user_name);should this be += instead of =
Oof, yeah -- good catch. I'll fix for the next respin.
Quoted 90 lines
Quoted 90 lines
+
spnego_key =ERR_PTR(-ENOMEM); description =kzalloc(desc_len, GFP_KERNEL); if (description == NULL)fs/cifs/cifs_spnego.c +4
-2@@ -152,8 +154,10 @@ cifs_get_spnego_key(struct cifs_ses *sesInfo) dp = description + strlen(description); sprintf(dp, ";creduid=0x%x", sesInfo->cred_uid); - dp = description + strlen(description); - sprintf(dp, ";user=%s", sesInfo->user_name); + if (sesInfo->user_name) { + dp = description + strlen(description); + sprintf(dp, ";user=%s", sesInfo->user_name); + } dp = description + strlen(description); sprintf(dp, ";pid=0x%x", current->pid);fs/cifs/cifsencrypt.c +8
-3@@ -420,15 +420,20 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash, } /* convert ses->user_name to unicode and uppercase */ - len = strlen(ses->user_name); + len = ses->user_name ? strlen(ses->user_name) : 0; user = kmalloc(2 + (len * 2), GFP_KERNEL); if (user == NULL) { cERROR(1, "calc_ntlmv2_hash: user mem alloc failure\n"); rc = -ENOMEM; return rc; } - len = cifs_strtoUCS((__le16 *)user, ses->user_name, len, nls_cp); - UniStrupr(user); + + if (len) { + len = cifs_strtoUCS((__le16 *)user, ses->user_name, len, nls_cp); + UniStrupr(user); + } else { + memset(user, '\0', 2); + } rc = crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash, (char *)user, 2 * len);fs/cifs/connect.c +0
-0@@ -1997,10 +1997,16 @@ static int match_session(struct cifs_ses *ses, struct smb_vol *vol) return 0; break;default:
+ /* NULL username means anonymous session */
+ if (ses->user_name== NULL) {
+ if (!vol->nullauth)
+ return 0;
+ break;
+ }
+
/* anything else takes username/password */
- if (ses->user_name== NULL)
- return 0;
- if (strncmp(ses->user_name,vol->username,
+ if (strncmp(ses->user_name,
+vol->username?vol->username: "",MAX_USERNAME_SIZE)) return 0;
if (strlen(vol->username)!= 0 &&fs/cifs/connect.c +3
-5@@ -3152,10 +3158,9 @@ cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data, return -EINVAL; if (volume_info->nullauth) { - cFYI(1, "null user"); - volume_info->username = kzalloc(1, GFP_KERNEL); - if (volume_info->username == NULL) - return -ENOMEM; + cFYI(1, "Anonymous login"); + kfree(volume_info->username); + volume_info->username = NULL; } else if (volume_info->username) { /* BB fixme parse for domain name here */ cFYI(1, "Username: %s", volume_info->username); --1.7.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Jeff Layton <[email protected]>
Re: [PATCH 3/3] cifs: fetch credentials out of keyring for non-krb5 auth multiuser mounts
In reply to a message not in the archiveQuoted 33 lines · Jeff Layton
Fix up multiuser mounts to set the secType and set the username and password from the key payload in the vol info for non-krb5 auth types.
Look for a key of type "secret" with a description of "cifs:a:<server address>" or "cifs:d:<domainname>". If that's found, then scrape the username and password out of the key payload and use that to create a new user session.
Finally, don't have the code enforce krb5 auth on multiuser mounts, but do require a kernel with keys support.
Signed-off-by Jeff Layton <[email protected]>---
fs/cifs/connect.c | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++---1 files changed, 166 insertions(+), 10 deletions(-)fs/cifs/connect.c +1
-1@@ -38,6 +38,7 @@ #include <asm/processor.h> #include <linux/inet.h> #include <linux/module.h> +#include <keys/user-type.h> #include <net/ipv6.h> #include "cifspdu.h" #include "cifsglob.h"@@ -1594,11 +1595,14 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, } } - if (vol->multiuser && !(vol->secFlg & CIFSSEC_MAY_KRB5)) {
fs/cifs/connect.c cifs_parse_mount_options(const char *mountdata, const char *devname, · line 1605
Quoted 10 lines
fs/cifs/connect.c +6
-2- cERROR(1, "Multiuser mounts currently require krb5 " - "authentication!"); +#ifndef CONFIG_KEYS + /* Muliuser mounts require CONFIG_KEYS support */ + if (vol->multiuser) { + cERROR(1, "Multiuser mounts require kernels with " + "CONFIG_KEYS enabled."); goto cifs_parse_mount_err; } +#endif
Will this break existing setups when those users update kernel and/or update cifs module?
Quoted 106 lines
fs/cifs/connect.c +99
-0if (vol->UNCip == NULL) vol->UNCip = &vol->UNC[2];@@ -2061,6 +2065,133 @@ cifs_put_smb_ses(struct cifs_ses *ses) cifs_put_tcp_session(server); } +#ifdef CONFIG_KEYS + +/* strlen("cifs:a:") + INET6_ADDRSTRLEN + 1 */ +#define CIFSCREDS_DESC_SIZE (7 + INET6_ADDRSTRLEN + 1) + +/* Populate username and pw fields from keyring if possible */ +static int +cifs_set_cifscreds (struct smb_vol *vol,struct cifs_ses *ses) +{ + int rc = 0; + char *desc, *delim, *payload; + ssize_t len; + struct key *key; + struct TCP_Server_Info *server = ses->server; + struct sockaddr_in *sa; + struct sockaddr_in6 *sa6; + struct user_key_payload *upayload; + + desc = kmalloc(CIFSCREDS_DESC_SIZE, GFP_KERNEL); + if (!desc) + return -ENOMEM; + + /* try to find an address key first */ + switch (server->dstaddr.ss_family) { + case AF_INET: + sa = (struct sockaddr_in *)&server->dstaddr; + sprintf(desc, "cifs:a:%pI4", &sa->sin_addr.s_addr); + break; + case AF_INET6: + sa6 = (struct sockaddr_in6 *)&server->dstaddr; + sprintf(desc, "cifs:a:%pI6c", &sa6->sin6_addr.s6_addr); + break; + default: + cFYI(1, "Bad ss_family (%hu)", server->dstaddr.ss_family); + rc = -EINVAL; + goto out_err; + } + + cFYI(1, "%s: desc=%s", __func__, desc); + key = request_key(&key_type_secret, desc, ""); + if (IS_ERR(key)) { + if (!ses->domainName) { + cFYI(1, "domainName is NULL"); + rc = PTR_ERR(key); + goto out_err; + } + + /* didn't work, try to find a domain key */ + sprintf(desc, "cifs:d:%s", ses->domainName); + cFYI(1, "%s: desc=%s", __func__, desc); + key = request_key(&key_type_secret, desc, ""); + if (IS_ERR(key)) { + rc = PTR_ERR(key); + goto out_err; + } + } + + down_read(&key->sem); + upayload = key->payload.data; + if (IS_ERR_OR_NULL(upayload)) { + rc = PTR_ERR(key); + goto out_key_put; + } + + /* find first : in payload */ + payload = (char *)upayload->data; + delim = strnchr(payload, upayload->datalen, ':'); + cFYI(1, "payload=%s", payload); + if (!delim) { + cFYI(1, "Unable to find ':' in payload (datalen=%d)", + upayload->datalen); + rc = -EINVAL; + goto out_key_put; + } + + len = delim - payload; + if (len > MAX_USERNAME_SIZE || len <= 0) { + cFYI(1, "Bad value from username search (len=%ld)", len); + rc = -EINVAL; + goto out_key_put; + } + + vol->username = kstrndup(payload, len, GFP_KERNEL); + if (!vol->username) { + cFYI(1, "Unable to allocate %ld bytes for username", len); + rc = -ENOMEM; + goto out_key_put; + } + cFYI(1, "username=%s", vol->username); + + len = key->datalen - (len + 1); + if (len > MAX_PASSWORD_SIZE || len <= 0) { + cFYI(1, "Bad len for password search (len=%ld)", len); + rc = -EINVAL; + kfree(vol->username); + vol->username = NULL; + goto out_key_put; + } +
fs/cifs/connect.c cifs_put_smb_ses(struct cifs_ses *ses) · line 2176
Quoted 10 lines
fs/cifs/connect.c +10
-0+ ++delim; + vol->password = kstrndup(delim, len, GFP_KERNEL); + if (!vol->password) { + cFYI(1, "Unable to allocate %ld bytes for password", len); + rc = -ENOMEM; + kfree(vol->username); + vol->username = NULL; + goto out_key_put; + } + cFYI(1, "password=%s", vol->password);
I would be wary of printing the password.
Quoted 102 lines
fs/cifs/connect.c +18
-0+ +out_key_put: + up_read(&key->sem); + key_put(key); +out_err: + kfree(desc); + cFYI(1, "%s: returning %d", __func__, rc); + return rc; +} +#else /* ! CONFIG_KEYS */ +static inline int +cifs_set_cifscreds (struct smb_vol *vol __attribute__((unused)), + struct cifs_ses *ses __attribute__((unused))) +{ + return -ENOSYS; +} +#endif /* CONFIG_KEYS */ +static bool
warned_on_ntlm; /* globals init to false automatically */static struct
cifs_ses*fs/cifs/connect.c +24
-0@@ -3678,16 +3809,38 @@ int cifs_setup_session(unsigned int xid, struct cifs_ses *ses, return rc; } +static int +cifs_set_vol_auth (struct smb_vol *vol,struct cifs_ses *ses) +{ + switch(ses->server->secType) { + case Kerberos: + vol->secFlg = CIFSSEC_MUST_KRB5; + return 0; + case NTLMv2: + vol->secFlg = CIFSSEC_MUST_NTLMV2; + break; + case NTLM: + vol->secFlg = CIFSSEC_MUST_NTLM; + break; + case RawNTLMSSP: + vol->secFlg = CIFSSEC_MAY_NTLMSSP; + break; + case LANMAN: + vol->secFlg = CIFSSEC_MAY_LANMAN; + break; + } + + return cifs_set_cifscreds(vol, ses); +} +static struct
cifs_tcon*
cifs_construct_tcon(structcifs_sb_info*cifs_sb,uid_tfsuid)
{
+ int rc;
structcifs_tcon*master_tcon=cifs_sb_master_tcon(cifs_sb); structcifs_ses*ses;
structcifs_tcon*tcon = NULL;
structsmb_vol*vol_info;
- char username[28]; /* big enough for "krb50x" + hex ofULONG_MAX6+16 */
- /* We used to have this asMAX_USERNAMEwhich is */
- /* way too big now (256 instead of 32) */vol_info =
kzalloc(sizeof(*vol_info), GFP_KERNEL); if (vol_info== NULL) {fs/cifs/connect.c +5
-4@@ -3695,8 +3848,6 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) goto out; } - snprintf(username, sizeof(username), "krb50x%x", fsuid); - vol_info->username = username; vol_info->local_nls = cifs_sb->local_nls; vol_info->linux_uid = fsuid; vol_info->cred_uid = fsuid;@@ -3706,8 +3857,11 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) vol_info->local_lease = master_tcon->local_lease; vol_info->no_linux_ext = !master_tcon->unix_ext; - /* FIXME: allow for other secFlg settings */ - vol_info->secFlg = CIFSSEC_MUST_KRB5; + rc = cifs_set_vol_auth(vol_info, master_tcon->ses); + if (rc) { + tcon = ERR_PTR(rc); + goto out; + } /* get a reference for the same TCP session */ spin_lock(&cifs_tcp_ses_lock);@@ -3730,6 +3884,8 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) if (ses->capabilities & CAP_UNIX) reset_cifs_unix_caps(0, tcon, NULL, vol_info);out:
+kfree(vol_info->username);
+kfree(vol_info->password);
kfree(vol_info);return tcon;
--
1.7.7.4--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Jeff Layton
When the multiuser mount code was initially introduced for cifs, I limited it to sec=krb5 auth. When a new user walks into a mount, we have no way to prompt for a username and password from the kernel, so the only auth type we could support was krb5.
This patchset extends the code to allow other auth types to use multiuser mounts. The idea here is for users to put their username and password for a particular server or domain into the keyring. The kernel
Would users be able to put their username for a particular domain name and server address as well as server name?
Was not clear from the description whether it was just the server address or name as well!
Quoted 35 lines
can then look for that key and use those credentials to establish a session on the user's behalf.
Because of the quirkiness of keyring permissions, this patchset adds a new key type that does not allow the keys to be read from userspace. That should prevent compromise of the credentials by someone walking up to the user's machine while she is away at lunch.
The userspace tool to stash keys in the keyring is already in cifs-utils, but the current form will not work with this version of the kernel patchset. A patchset that updates the tool to be suitable for this purpose will follow.
Jeff Layton (3):
keys: add a "secret" key type
cifs: sanitize username handling
cifs: fetch credentials out of keyring for non-krb5 auth multiuser mountsfs/cifs/cifs_spnego.c | 10 ++-
fs/cifs/cifsencrypt.c | 11 ++-
fs/cifs/connect.c | 195 ++++++++++++++++++++++++++++++++++++++----include/keys/user-type.h| 3 +-
security/keys/internal.h | 1 +
security/keys/key.c | 1 +security/keys/user_defined.c| 17 ++++7 files changed, 214 insertions(+), 24 deletions(-)--
1.7.7.4--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] cifs: fetch credentials out of keyring for non-krb5 auth multiuser mounts
In reply to a message not in the archiveQuoted 33 lines · On Fri, 6 Jan 2012 11:16:32 -0600 Shirish Pargaonkar…
Quoted 32 lines · Jeff Layton
Fix up multiuser mounts to set the secType and set the username and password from the key payload in the vol info for non-krb5 auth types.
Look for a key of type "secret" with a description of "cifs:a:<server address>" or "cifs:d:<domainname>". If that's found, then scrape the username and password out of the key payload and use that to create a new user session.
Finally, don't have the code enforce krb5 auth on multiuser mounts, but do require a kernel with keys support.
Signed-off-by Jeff Layton <[email protected]>---
fs/cifs/connect.c | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++---1 files changed, 166 insertions(+), 10 deletions(-)fs/cifs/connect.c +1
-0@@ -38,6 +38,7 @@ #include <asm/processor.h> #include <linux/inet.h> #include <linux/module.h> +#include <keys/user-type.h> #include <net/ipv6.h> #include "cifspdu.h" #include "cifsglob.h"@@ -1594,11 +1595,14 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, } }
Quoted 15 lines
fs/cifs/connect.c cifs_parse_mount_options(const char *mountdata, const char *devname, · line 1605
Quoted 11 lines
fs/cifs/connect.c +6
-3- if (vol->multiuser && !(vol->secFlg & CIFSSEC_MAY_KRB5)) { - cERROR(1, "Multiuser mounts currently require krb5 " - "authentication!"); +#ifndef CONFIG_KEYS + /* Muliuser mounts require CONFIG_KEYS support */ + if (vol->multiuser) { + cERROR(1, "Multiuser mounts require kernels with " + "CONFIG_KEYS enabled."); goto cifs_parse_mount_err; } +#endif Will this break existing setups when those users update kernel and/or update cifs module?
No. Why would it? You need keys support for krb5 auth.
Quoted 110 lines
Quoted 110 lines
fs/cifs/connect.c +103
-0if (vol->UNCip == NULL) vol->UNCip = &vol->UNC[2];@@ -2061,6 +2065,133 @@ cifs_put_smb_ses(struct cifs_ses *ses) cifs_put_tcp_session(server); } +#ifdef CONFIG_KEYS + +/* strlen("cifs:a:") + INET6_ADDRSTRLEN + 1 */ +#define CIFSCREDS_DESC_SIZE (7 + INET6_ADDRSTRLEN + 1) + +/* Populate username and pw fields from keyring if possible */ +static int +cifs_set_cifscreds (struct smb_vol *vol,struct cifs_ses *ses) +{ + int rc = 0; + char *desc, *delim, *payload; + ssize_t len; + struct key *key; + struct TCP_Server_Info *server = ses->server; + struct sockaddr_in *sa; + struct sockaddr_in6 *sa6; + struct user_key_payload *upayload; + + desc = kmalloc(CIFSCREDS_DESC_SIZE, GFP_KERNEL); + if (!desc) + return -ENOMEM; + + /* try to find an address key first */ + switch (server->dstaddr.ss_family) { + case AF_INET: + sa = (struct sockaddr_in *)&server->dstaddr; + sprintf(desc, "cifs:a:%pI4", &sa->sin_addr.s_addr); + break; + case AF_INET6: + sa6 = (struct sockaddr_in6 *)&server->dstaddr; + sprintf(desc, "cifs:a:%pI6c", &sa6->sin6_addr.s6_addr); + break; + default: + cFYI(1, "Bad ss_family (%hu)", server->dstaddr.ss_family); + rc = -EINVAL; + goto out_err; + } + + cFYI(1, "%s: desc=%s", __func__, desc); + key = request_key(&key_type_secret, desc, ""); + if (IS_ERR(key)) { + if (!ses->domainName) { + cFYI(1, "domainName is NULL"); + rc = PTR_ERR(key); + goto out_err; + } + + /* didn't work, try to find a domain key */ + sprintf(desc, "cifs:d:%s", ses->domainName); + cFYI(1, "%s: desc=%s", __func__, desc); + key = request_key(&key_type_secret, desc, ""); + if (IS_ERR(key)) { + rc = PTR_ERR(key); + goto out_err; + } + } + + down_read(&key->sem); + upayload = key->payload.data; + if (IS_ERR_OR_NULL(upayload)) { + rc = PTR_ERR(key); + goto out_key_put; + } + + /* find first : in payload */ + payload = (char *)upayload->data; + delim = strnchr(payload, upayload->datalen, ':'); + cFYI(1, "payload=%s", payload); + if (!delim) { + cFYI(1, "Unable to find ':' in payload (datalen=%d)", + upayload->datalen); + rc = -EINVAL; + goto out_key_put; + } + + len = delim - payload; + if (len > MAX_USERNAME_SIZE || len <= 0) { + cFYI(1, "Bad value from username search (len=%ld)", len); + rc = -EINVAL; + goto out_key_put; + } + + vol->username = kstrndup(payload, len, GFP_KERNEL); + if (!vol->username) { + cFYI(1, "Unable to allocate %ld bytes for username", len); + rc = -ENOMEM; + goto out_key_put; + } + cFYI(1, "username=%s", vol->username); + + len = key->datalen - (len + 1); + if (len > MAX_PASSWORD_SIZE || len <= 0) { + cFYI(1, "Bad len for password search (len=%ld)", len); + rc = -EINVAL; + kfree(vol->username); + vol->username = NULL; + goto out_key_put; + } + + ++delim; + vol->password = kstrndup(delim, len, GFP_KERNEL); + if (!vol->password) { + cFYI(1, "Unable to allocate %ld bytes for password", len);
Quoted 9 lines
fs/cifs/connect.c cifs_put_smb_ses(struct cifs_ses *ses) · line 2176
Quoted 6 lines
fs/cifs/connect.c +6
-0+ rc = -ENOMEM; + kfree(vol->username); + vol->username = NULL; + goto out_key_put; + } + cFYI(1, "password=%s", vol->password);I would be wary of printing the password.
Good point. I had that in there when I was debugging this, but I think I can remove it now.
Quoted 37 lines
Quoted 37 lines
fs/cifs/connect.c +18
-0+ +out_key_put: + up_read(&key->sem); + key_put(key); +out_err: + kfree(desc); + cFYI(1, "%s: returning %d", __func__, rc); + return rc; +} +#else /* ! CONFIG_KEYS */ +static inline int +cifs_set_cifscreds (struct smb_vol *vol __attribute__((unused)), + struct cifs_ses *ses __attribute__((unused))) +{ + return -ENOSYS; +} +#endif /* CONFIG_KEYS */ +static bool
warned_on_ntlm; /* globals init to false automatically */static struct
cifs_ses*fs/cifs/connect.c +12
-0@@ -3678,16 +3809,38 @@ int cifs_setup_session(unsigned int xid, struct cifs_ses *ses, return rc; } +static int +cifs_set_vol_auth (struct smb_vol *vol,struct cifs_ses *ses) +{ + switch(ses->server->secType) { + case Kerberos: + vol->secFlg = CIFSSEC_MUST_KRB5; + return 0; + case NTLMv2: + vol->secFlg = CIFSSEC_MUST_NTLMV2; + break; + case NTLM: + vol->secFlg = CIFSSEC_MUST_NTLM;
Quoted 8 lines
fs/cifs/connect.c int cifs_setup_session(unsigned int xid, struct cifs_ses *ses, · line 3831
Quoted 8 lines
fs/cifs/connect.c +8
-0+ break; + case RawNTLMSSP: + vol->secFlg = CIFSSEC_MAY_NTLMSSP; + break; + case LANMAN: + vol->secFlg = CIFSSEC_MAY_LANMAN; + break; + }
Also, since we're critiquing this patch, the MAYs above should probably be MUSTs.
Quoted 57 lines
Quoted 57 lines
fs/cifs/connect.c +4
-0+ + return cifs_set_cifscreds(vol, ses); +} +static struct
cifs_tcon*
cifs_construct_tcon(structcifs_sb_info*cifs_sb,uid_tfsuid)
{
+ int rc;
structcifs_tcon*master_tcon=cifs_sb_master_tcon(cifs_sb); structcifs_ses*ses;
structcifs_tcon*tcon = NULL;
structsmb_vol*vol_info;
- char username[28]; /* big enough for "krb50x" + hex ofULONG_MAX6+16 */
- /* We used to have this asMAX_USERNAMEwhich is */
- /* way too big now (256 instead of 32) */vol_info =
kzalloc(sizeof(*vol_info), GFP_KERNEL); if (vol_info== NULL) {fs/cifs/connect.c +5
-4@@ -3695,8 +3848,6 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) goto out; } - snprintf(username, sizeof(username), "krb50x%x", fsuid); - vol_info->username = username; vol_info->local_nls = cifs_sb->local_nls; vol_info->linux_uid = fsuid; vol_info->cred_uid = fsuid;@@ -3706,8 +3857,11 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) vol_info->local_lease = master_tcon->local_lease; vol_info->no_linux_ext = !master_tcon->unix_ext; - /* FIXME: allow for other secFlg settings */ - vol_info->secFlg = CIFSSEC_MUST_KRB5; + rc = cifs_set_vol_auth(vol_info, master_tcon->ses); + if (rc) { + tcon = ERR_PTR(rc); + goto out; + } /* get a reference for the same TCP session */ spin_lock(&cifs_tcp_ses_lock);@@ -3730,6 +3884,8 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid) if (ses->capabilities & CAP_UNIX) reset_cifs_unix_caps(0, tcon, NULL, vol_info);out:
+kfree(vol_info->username);
+kfree(vol_info->password);
kfree(vol_info);return tcon;
--
1.7.7.4--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 6 lines · On Fri, 6 Jan 2012 11:21:44 -0600 Shirish Pargaonkar…
Quoted 5 lines · Jeff Layton
When the multiuser mount code was initially introduced for cifs, I limited it to sec=krb5 auth. When a new user walks into a mount, we have no way to prompt for a username and password from the kernel, so the only auth type we could support was krb5.
Quoted 9 lines
Quoted 3 lines
This patchset extends the code to allow other auth types to use multiuser mounts. The idea here is for users to put their username and password for a particular server or domain into the keyring. The kernel
Would users be able to put their username for a particular domain name and server address as well as server name?
Was not clear from the description whether it was just the server address or name as well!
You can add keys a particular host or NT domain name. If it's a host key, then the userspace tool will add a key for each address that it resolves for the hostname. For a domain key, it's treated as a string literal and the kernel will use the domain= mount option to construct the key description.
Quoted 35 lines
Quoted 35 lines
can then look for that key and use those credentials to establish a session on the user's behalf.
Because of the quirkiness of keyring permissions, this patchset adds a new key type that does not allow the keys to be read from userspace. That should prevent compromise of the credentials by someone walking up to the user's machine while she is away at lunch.
The userspace tool to stash keys in the keyring is already in cifs-utils, but the current form will not work with this version of the kernel patchset. A patchset that updates the tool to be suitable for this purpose will follow.
Jeff Layton (3):
keys: add a "secret" key type
cifs: sanitize username handling
cifs: fetch credentials out of keyring for non-krb5 auth multiuser mountsfs/cifs/cifs_spnego.c | 10 ++-
fs/cifs/cifsencrypt.c | 11 ++-
fs/cifs/connect.c | 195 ++++++++++++++++++++++++++++++++++++++----include/keys/user-type.h| 3 +-
security/keys/internal.h | 1 +
security/keys/key.c | 1 +security/keys/user_defined.c| 17 ++++7 files changed, 214 insertions(+), 24 deletions(-)--
1.7.7.4--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Jeff Layton <[email protected]>
2012/1/6 Jeff Layton <[email protected]>:
Quoted 6 lines
Quoted 5 lines
Would users be able to put their username for a particular domain name and server address as well as server name?
Was not clear from the description whether it was just the server address or name as well!
Quoted 6 lines
You can add keys a particular host or NT domain name. If it's a host key, then the userspace tool will add a key for each address that it resolves for the hostname. For a domain key, it's treated as a string literal and the kernel will use the domain= mount option to construct the key description.
"You can add keys... "
How?? Userspace tool?
I will test this.
Stef
Quoted 15 lines · On Tue, 10 Jan 2012 16:06:16 +0100 Stef Bon…
2012/1/6 Jeff Layton <[email protected]>:
Quoted 6 lines
Quoted 5 lines
Would users be able to put their username for a particular domain name and server address as well as server name?
Was not clear from the description whether it was just the server address or name as well!Quoted 6 lines
You can add keys a particular host or NT domain name. If it's a host key, then the userspace tool will add a key for each address that it resolves for the hostname. For a domain key, it's treated as a string literal and the kernel will use the domain= mount option to construct the key description.
Quoted 4 lines
"You can add keys... "
How?? Userspace tool?
Yes, the cifscreds utility in the cifs-utils package. However the one currently in cifs-utils needs changes before it will work with this. That's what the cifscreds patch series is all about.
Quoted 2 lines
I will test this.
Thanks,
Signature · 1 line
Jeff Layton <[email protected]>