Implement the move operation.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22093 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-12-03 12:44:40 +00:00
parent 8c9100dd86
commit 64cf3425d8

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 - 2004 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2007 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -767,6 +767,19 @@ fcc_end_cache_get(krb5_context context, krb5_cc_cursor cursor)
return 0;
}
static krb5_error_code
fcc_move(krb5_context context, krb5_ccache from, krb5_ccache to)
{
krb5_error_code ret = 0;
if (rename(FILENAME(from), FILENAME(to)) != 0) {
ret = errno;
krb5_set_error_string(context, "Rename of file failed: %s",
strerror(ret));
}
return ret;
}
/**
* Variable containing the FILE based credential cache implemention.
*
@@ -792,5 +805,6 @@ const krb5_cc_ops krb5_fcc_ops = {
fcc_get_version,
fcc_get_cache_first,
fcc_get_cache_next,
fcc_end_cache_get
fcc_end_cache_get,
fcc_move
};