remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,34 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 1997 - 2008 Kungliga Tekniska Högskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "krb5_locl.h"
|
||||
@@ -90,17 +90,17 @@ _krb5_xlock(krb5_context context, int fd, krb5_boolean exclusive,
|
||||
case 0:
|
||||
break;
|
||||
case EINVAL: /* filesystem doesn't support locking, let the user have it */
|
||||
ret = 0;
|
||||
ret = 0;
|
||||
break;
|
||||
case EAGAIN:
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("timed out locking cache file %s", "file"),
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("timed out locking cache file %s", "file"),
|
||||
filename);
|
||||
break;
|
||||
default:
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("error locking cache file %s: %s",
|
||||
"file, error"),
|
||||
N_("error locking cache file %s: %s",
|
||||
"file, error"),
|
||||
filename, strerror(ret));
|
||||
break;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ _krb5_xunlock(krb5_context context, int fd)
|
||||
case 0:
|
||||
break;
|
||||
case EINVAL: /* filesystem doesn't support locking, let the user have it */
|
||||
ret = 0;
|
||||
ret = 0;
|
||||
break;
|
||||
default:
|
||||
krb5_set_error_message(context, ret,
|
||||
@@ -351,7 +351,7 @@ storage_set_flags(krb5_context context, krb5_storage *sp, int vno)
|
||||
case KRB5_FCC_FVNO_4:
|
||||
break;
|
||||
default:
|
||||
krb5_abortx(context,
|
||||
krb5_abortx(context,
|
||||
"storage_set_flags called with bad vno (%x)", vno);
|
||||
}
|
||||
krb5_storage_set_flags(sp, flags);
|
||||
@@ -377,7 +377,7 @@ fcc_open(krb5_context context,
|
||||
return ret;
|
||||
}
|
||||
rk_cloexec(fd);
|
||||
|
||||
|
||||
if((ret = fcc_lock(context, id, fd, exclusive)) != 0) {
|
||||
close(fd);
|
||||
return ret;
|
||||
@@ -397,12 +397,12 @@ fcc_initialize(krb5_context context,
|
||||
char *filename = f->filename;
|
||||
|
||||
unlink (filename);
|
||||
|
||||
|
||||
ret = fcc_open(context, id, &fd, O_RDWR | O_CREAT | O_EXCL | O_BINARY | O_CLOEXEC, 0600);
|
||||
if(ret)
|
||||
return ret;
|
||||
{
|
||||
krb5_storage *sp;
|
||||
krb5_storage *sp;
|
||||
sp = krb5_storage_emem();
|
||||
krb5_storage_set_eof_code(sp, KRB5_CC_END);
|
||||
if(context->fcache_vno != 0)
|
||||
@@ -509,7 +509,7 @@ init_fcc (krb5_context context,
|
||||
ret = fcc_open(context, id, &fd, O_RDONLY | O_BINARY | O_CLOEXEC, 0);
|
||||
if(ret)
|
||||
return ret;
|
||||
|
||||
|
||||
sp = krb5_storage_from_fd(fd);
|
||||
if(sp == NULL) {
|
||||
krb5_clear_error_string(context);
|
||||
@@ -521,7 +521,7 @@ init_fcc (krb5_context context,
|
||||
if(ret != 0) {
|
||||
if(ret == KRB5_CC_END) {
|
||||
ret = ENOENT;
|
||||
krb5_set_error_message(context, ret,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("Empty credential cache file: %s", ""),
|
||||
FILENAME(id));
|
||||
} else
|
||||
@@ -553,7 +553,7 @@ init_fcc (krb5_context context,
|
||||
ret = krb5_ret_int16 (sp, &length);
|
||||
if(ret) {
|
||||
ret = KRB5_CC_FORMAT;
|
||||
krb5_set_error_message(context, ret,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("Error reading tag length in "
|
||||
"cache file: %s", ""), FILENAME(id));
|
||||
goto out;
|
||||
@@ -574,7 +574,7 @@ init_fcc (krb5_context context,
|
||||
ret = krb5_ret_int16 (sp, &data_len);
|
||||
if(ret) {
|
||||
ret = KRB5_CC_FORMAT;
|
||||
krb5_set_error_message(context, ret,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("Error reading dlength "
|
||||
"in cache file: %s",""),
|
||||
FILENAME(id));
|
||||
@@ -585,9 +585,9 @@ init_fcc (krb5_context context,
|
||||
ret = krb5_ret_int32 (sp, &context->kdc_sec_offset);
|
||||
if(ret) {
|
||||
ret = KRB5_CC_FORMAT;
|
||||
krb5_set_error_message(context, ret,
|
||||
krb5_set_error_message(context, ret,
|
||||
N_("Error reading kdc_sec in "
|
||||
"cache file: %s", ""),
|
||||
"cache file: %s", ""),
|
||||
FILENAME(id));
|
||||
goto out;
|
||||
}
|
||||
@@ -633,7 +633,7 @@ init_fcc (krb5_context context,
|
||||
}
|
||||
*ret_sp = sp;
|
||||
*ret_fd = fd;
|
||||
|
||||
|
||||
return 0;
|
||||
out:
|
||||
if(sp != NULL)
|
||||
@@ -684,7 +684,7 @@ fcc_get_first (krb5_context context,
|
||||
}
|
||||
memset(*cursor, 0, sizeof(struct fcc_cursor));
|
||||
|
||||
ret = init_fcc (context, id, &FCC_CURSOR(*cursor)->sp,
|
||||
ret = init_fcc (context, id, &FCC_CURSOR(*cursor)->sp,
|
||||
&FCC_CURSOR(*cursor)->fd);
|
||||
if (ret) {
|
||||
free(*cursor);
|
||||
@@ -787,7 +787,7 @@ fcc_get_version(krb5_context context,
|
||||
{
|
||||
return FCACHE(id)->version;
|
||||
}
|
||||
|
||||
|
||||
struct fcache_iter {
|
||||
int first;
|
||||
};
|
||||
@@ -801,7 +801,7 @@ fcc_get_cache_first(krb5_context context, krb5_cc_cursor *cursor)
|
||||
if (iter == NULL) {
|
||||
krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
|
||||
return ENOMEM;
|
||||
}
|
||||
}
|
||||
iter->first = 1;
|
||||
*cursor = iter;
|
||||
return 0;
|
||||
@@ -823,7 +823,7 @@ fcc_get_cache_next(krb5_context context, krb5_cc_cursor cursor, krb5_ccache *id)
|
||||
|
||||
fn = krb5_cc_default_name(context);
|
||||
if (strncasecmp(fn, "FILE:", 5) != 0) {
|
||||
ret = _krb5_expand_default_cc_name(context,
|
||||
ret = _krb5_expand_default_cc_name(context,
|
||||
KRB5_DEFAULT_CCNAME_FILE,
|
||||
&expandedfn);
|
||||
if (ret)
|
||||
@@ -832,7 +832,7 @@ fcc_get_cache_next(krb5_context context, krb5_cc_cursor cursor, krb5_ccache *id)
|
||||
ret = krb5_cc_resolve(context, fn, id);
|
||||
if (expandedfn)
|
||||
free(expandedfn);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -870,7 +870,7 @@ fcc_move(krb5_context context, krb5_ccache from, krb5_ccache to)
|
||||
|
||||
unlink(FILENAME(to));
|
||||
|
||||
ret = fcc_open(context, to, &fd2,
|
||||
ret = fcc_open(context, to, &fd2,
|
||||
O_WRONLY | O_CREAT | O_EXCL | O_BINARY | O_CLOEXEC, 0600);
|
||||
if(ret)
|
||||
goto out1;
|
||||
@@ -916,14 +916,14 @@ fcc_move(krb5_context context, krb5_ccache from, krb5_ccache to)
|
||||
krb5_storage_free(sp);
|
||||
fcc_unlock(context, fd);
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static krb5_error_code
|
||||
fcc_default_name(krb5_context context, char **str)
|
||||
{
|
||||
return _krb5_expand_default_cc_name(context,
|
||||
return _krb5_expand_default_cc_name(context,
|
||||
KRB5_DEFAULT_CCNAME_FILE,
|
||||
str);
|
||||
}
|
||||
|
Reference in New Issue
Block a user