summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1992-06-10 22:44:30 +0000
committerTheodore Tso <tytso@mit.edu>1992-06-10 22:44:30 +0000
commit02082d421c8e331da19b0ba349c93f0d54a49050 (patch)
treeedad5d635e199c178992af82507e9327e4df1dcf /src/lib
parente7a2b26cecf2dc7d3f83bcf001e12e6fd541a4d9 (diff)
downloadkrb5-02082d421c8e331da19b0ba349c93f0d54a49050.tar.gz
krb5-02082d421c8e331da19b0ba349c93f0d54a49050.tar.xz
krb5-02082d421c8e331da19b0ba349c93f0d54a49050.zip
Checked in jfc's changes to handle new principal type
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2295 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/krb5/ccache/file/fcc_write.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/lib/krb5/ccache/file/fcc_write.c b/src/lib/krb5/ccache/file/fcc_write.c
index e854e1a1c..766463ddd 100644
--- a/src/lib/krb5/ccache/file/fcc_write.c
+++ b/src/lib/krb5/ccache/file/fcc_write.c
@@ -73,28 +73,30 @@ krb5_fcc_write(id, buf, len)
* system errors
*/
+/* XXX TODO: write principal type to file XXX */
+
krb5_error_code
krb5_fcc_store_principal(id, princ)
krb5_ccache id;
krb5_principal princ;
{
- krb5_error_code ret;
- krb5_principal temp;
- krb5_int32 i, length = 0;
+ krb5_error_code ret;
+ krb5_int32 i, length;
- /* Count the number of components */
- temp = princ;
- while (*temp++)
- length += 1;
+ length = krb5_princ_size(princ);
- ret = krb5_fcc_store_int32(id, &length);
- CHECK(ret);
- for (i=0; i < length; i++) {
- ret = krb5_fcc_store_data(id, princ[i]);
- CHECK(ret);
- }
+ ret = krb5_fcc_store_int32(id, &length);
+ CHECK(ret);
- return KRB5_OK;
+ ret = krb5_fcc_store_data(id, krb5_princ_realm(princ));
+ CHECK(ret);
+
+ for (i=0; i < length; i++) {
+ ret = krb5_fcc_store_data(id, krb5_princ_component(princ, i));
+ CHECK(ret);
+ }
+
+ return KRB5_OK;
}
krb5_error_code