summaryrefslogtreecommitdiff
path: root/cifscreds.c
AgeCommit message (Collapse)AuthorFilesLines
2012-01-17cifscreds: change prefix on keys to "cifs:" instead of "cifscreds:"Jeff Layton1-6/+7
The "creds" portion seems redundant. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: make key_search use keyctl_searchJeff Layton1-45/+1
...which is much more efficient than walking the keyring by hand. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: make cifscreds use the "logon" key_typeJeff Layton1-5/+5
...and have it loosen the permissions to allow searching. There seems to be no clear way to make user keys unreadable, but still allow for them to be searched, so we'll need a new key_type that doesn't allow you to read the payload from userspace. That will be proposed in a separate kernel patch. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: use the session keyringJeff Layton1-1/+1
This seems like a reasonable change, but I'm willing to listen to arguments to the contrary... cifscreds currently hangs the keys off of the uid keyring. It seems more appropriate though that we require that each session have its own set. This might be particularly important in a containerized situation. If a user authenticates in one container, then we probably don't want to allow a user in another to "borrow" those creds. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: loosen allowed characters in domain namesJeff Layton1-5/+8
As Donald points out, NetBIOS domains are allowed more characters than the code currently allows. Change the test to one that checks for disallowed characters instead. Also, I can't find anything that says that '@' is not allowed in a username. Might as well allow that too. Worst case, the server will reject the username. Reported-by: Donald R. Gray Jr <donald.r.gray@gmail.com> Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: add --domain flagJeff Layton1-20/+44
...to indicate that the first argument is not a hostname but an NT domain name. If it's set, then treat the argument as a string literal. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: make username parameter optionalJeff Layton1-11/+28
...and use getopt_long to get it. If someone doesn't specify the username, use getusername() to get it. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: move option parsing into main()Jeff Layton1-32/+44
Having to parse options in every command routine is cumbersome and restrictive. Declare a struct to hold arguments, and then have the functions take that struct as an argument. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: make usage use "return" and have callers returnJeff Layton1-10/+11
...banish the use of exit(), which may be helpful in the future in the event that we eventually move some of this code into a library. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: make username part of value instead of descriptionJeff Layton1-19/+11
Change the payload to be "username:password". Since usernames can't contain ':', this is suitable delimiter. Also, create_description is just a sprintf now, so eliminate it. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: remove user parameter from create_descriptionJeff Layton1-8/+8
The username should be part of the key payload and not part of the description. Also, prefix the address with an "a:" in the description. Eventually we'll also need a "domain" key variant. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: eliminate domain parm from most functionsJeff Layton1-67/+18
Eventually we'll add this back in a different way. The domain and address should be exclusive of one another. IOW, we want the kernel to be able to find credentials for a specific address or for the domain of which the server is a member. Signed-off-by: Jeff Layton <jlayton@samba.org>
2012-01-17cifscreds: add unused attribute to argv parm in cifscreds_clearallJeff Layton1-1/+1
...to eliminate this warning: cifscreds.c: In function ‘cifscreds_clearall’: cifscreds.c:422:47: warning: unused parameter ‘argv’ Signed-off-by: Jeff Layton <jlayton@samba.org>
2010-08-20cifs-utils: infrastructure for stashing passwords in keyringIgor Druzhinin1-0/+582
It is a userspace part of a new infrastructure for stashing passwords in kernel keyring per user basis. The patch adds the "cifscreds" utility for management keys with credentials. Assembling of the utility from the distribution is possible with --enable-cifscreds=yes option of configure script. Signed-off-by: Igor Druzhinin <jaxbrigs@gmail.com>