~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/utility_functions/user.cc

  • Committer: Andrew Hutchings
  • Date: 2010-12-15 18:59:55 UTC
  • mto: This revision was merged to the branch mainline in revision 2006.
  • Revision ID: andrew@linuxjedi.co.uk-20101215185955-q12lkja8hdnpjqg7
Make the test look for drizzleadmin failure instead of success as this test is not possible to fix for success on our FreeBSD 8.0 box

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *  Copyright (C) 2010 Stewart Smith
6
6
 *
7
7
 *  This program is free software; you can redistribute it and/or modify
33
33
String *User::val_str(String *str)
34
34
{
35
35
  assert(fixed == 1);
36
 
  identifier::User::const_shared_ptr user= getSession().user();
37
 
  assert(user);
38
 
  if (user->username().empty())
 
36
  Session *session= current_session;
 
37
  if (session->getSecurityContext().getUser().empty())
39
38
  {
40
39
    null_value= 1;
41
40
    return 0;
42
41
  }
43
42
  else
44
43
  {
45
 
    str->copy(user->username().c_str(), user->username().length(), system_charset_info);
 
44
    str->copy(session->getSecurityContext().getUser().c_str(), session->getSecurityContext().getUser().length(), system_charset_info);
46
45
  }
47
46
  return str;
48
47
}