summaryrefslogtreecommitdiff
path: root/source3/lib/afs.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-15 14:19:52 -0800
committerJeremy Allison <jra@samba.org>2007-11-15 14:19:52 -0800
commit68be9a820059ee96dd26c527efd7c14e679d3f2c (patch)
treec3c853a01013fc7977ab02a31e673fe17b4135e6 /source3/lib/afs.c
parent8e1b0f81c27dc332560f19de27fb86ac96c59775 (diff)
downloadsamba-68be9a820059ee96dd26c527efd7c14e679d3f2c.tar.gz
samba-68be9a820059ee96dd26c527efd7c14e679d3f2c.tar.bz2
samba-68be9a820059ee96dd26c527efd7c14e679d3f2c.zip
More pstring removal. This one was tricky. I had to add
one horror (pstring_clean_name()) which will have to remain until I've removed all pstrings from the client code. Jeremy. (This used to be commit 1ea3ac80146b83c2522b69e7747c823366a2b47d)
Diffstat (limited to 'source3/lib/afs.c')
-rw-r--r--source3/lib/afs.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/lib/afs.c b/source3/lib/afs.c
index 35f213fd08..dadd83d513 100644
--- a/source3/lib/afs.c
+++ b/source3/lib/afs.c
@@ -213,10 +213,10 @@ bool afs_login(connection_struct *conn)
extern userdom_struct current_user_info;
extern struct current_user current_user;
DATA_BLOB ticket;
- pstring afs_username;
- char *cell;
+ char *afs_username = NULL;
+ char *cell = NULL;
bool result;
- char *ticket_str;
+ char *ticket_str = NULL;
const DOM_SID *user_sid;
struct ClearToken ct;
@@ -229,7 +229,13 @@ bool afs_login(connection_struct *conn)
afs_username, sizeof(afs_username));
user_sid = &current_user.nt_user_token->user_sids[0];
- pstring_sub(afs_username, "%s", sid_string_static(user_sid));
+ afs_username = talloc_string_sub(talloc_tos(),
+ lp_afs_username_map(),
+ "%s",
+ sid_string_static(user_sid));
+ if (!afs_username) {
+ return false;
+ }
/* The pts command always generates completely lower-case user
* names. */
@@ -240,13 +246,13 @@ bool afs_login(connection_struct *conn)
if (cell == NULL) {
DEBUG(1, ("AFS username doesn't contain a @, "
"could not find cell\n"));
- return False;
+ return false;
}
*cell = '\0';
cell += 1;
- DEBUG(10, ("Trying to log into AFS for user %s@%s\n",
+ DEBUG(10, ("Trying to log into AFS for user %s@%s\n",
afs_username, cell));
if (!afs_createtoken(afs_username, cell, &ticket, &ct))