diff options
author | Hans Insulander <hin@cvs.openbsd.org> | 2003-05-14 09:06:00 +0000 |
---|---|---|
committer | Hans Insulander <hin@cvs.openbsd.org> | 2003-05-14 09:06:00 +0000 |
commit | 3e440853e80c8e91c45776f32a22899172df175a (patch) | |
tree | b7c9907f3f085ebd8206ce8511de837ccd38d225 | |
parent | 8588540876fe4a62fe0d0fb41e3d208126670b90 (diff) |
New libkrb5, with a number of other krb5 related folded into one.
Not yet activated in the tree, that will be done later.
ok mho@
-rw-r--r-- | lib/libkrb5/Makefile | 26 | ||||
-rw-r--r-- | lib/libkrb5/Makefile.asn1.inc | 89 | ||||
-rw-r--r-- | lib/libkrb5/Makefile.common.inc | 23 | ||||
-rw-r--r-- | lib/libkrb5/Makefile.hdb.inc | 35 | ||||
-rw-r--r-- | lib/libkrb5/Makefile.kafs.inc | 23 | ||||
-rw-r--r-- | lib/libkrb5/Makefile.krb5.inc | 256 | ||||
-rw-r--r-- | lib/libkrb5/Makefile.roken.inc | 25 | ||||
-rw-r--r-- | lib/libkrb5/afssys_openbsd.c | 104 | ||||
-rw-r--r-- | lib/libkrb5/shlib_version | 2 |
9 files changed, 583 insertions, 0 deletions
diff --git a/lib/libkrb5/Makefile b/lib/libkrb5/Makefile new file mode 100644 index 00000000000..a0a368bee81 --- /dev/null +++ b/lib/libkrb5/Makefile @@ -0,0 +1,26 @@ +# $OpenBSD: Makefile,v 1.1 2003/05/14 09:05:59 hin Exp $ + +KRB5DIR= ${.CURDIR}/../../kerberosV +.include "Makefile.common.inc" + +LIB = newkrb5 + +.include "Makefile.asn1.inc" +.include "Makefile.hdb.inc" +.include "Makefile.kafs.inc" +.include "Makefile.roken.inc" +.include "Makefile.krb5.inc" + +includes: + pwd + @for i in $(INCLUDE_FILES); do \ + j="cmp -s $$i ${DESTDIR}/usr/include/kerberosV/$$i || \ + ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \ + $$i ${DESTDIR}/usr/include/kerberosV"; \ + echo $$j; \ + pwd; \ + eval "$$j"; \ + done + + +.include <bsd.lib.mk> diff --git a/lib/libkrb5/Makefile.asn1.inc b/lib/libkrb5/Makefile.asn1.inc new file mode 100644 index 00000000000..8fd7c36aaa0 --- /dev/null +++ b/lib/libkrb5/Makefile.asn1.inc @@ -0,0 +1,89 @@ +# $OpenBSD: Makefile.asn1.inc,v 1.1 2003/05/14 09:05:59 hin Exp $ + +.PATH: ${KRB5SRC}/lib/asn1 + +INCLUDE_FILES+= krb5_asn1.h asn1_err.h \ + ${KRB5SRC}/lib/asn1/{der.h,asn1-common.h} + +includes: krb5_asn1.h asn1_err.h + +.PATH: ${KRB5SRC}/lib/asn1 + +gen_files= \ + krb5_asn1.h \ + asn1_APOptions.c \ + asn1_AP_REP.c \ + asn1_AP_REQ.c \ + asn1_AS_REP.c \ + asn1_AS_REQ.c \ + asn1_Authenticator.c \ + asn1_AuthorizationData.c \ + asn1_CKSUMTYPE.c \ + asn1_Checksum.c \ + asn1_ETYPE_INFO.c \ + asn1_ETYPE_INFO_ENTRY.c \ + asn1_ENCTYPE.c \ + asn1_EncAPRepPart.c \ + asn1_EncASRepPart.c \ + asn1_EncKDCRepPart.c \ + asn1_EncKrbCredPart.c \ + asn1_EncKrbPrivPart.c \ + asn1_EncTGSRepPart.c \ + asn1_EncTicketPart.c \ + asn1_EncryptedData.c \ + asn1_EncryptionKey.c \ + asn1_HostAddress.c \ + asn1_HostAddresses.c \ + asn1_KDCOptions.c \ + asn1_KDC_REP.c \ + asn1_KDC_REQ.c \ + asn1_KDC_REQ_BODY.c \ + asn1_KRB_CRED.c \ + asn1_KRB_ERROR.c \ + asn1_KRB_PRIV.c \ + asn1_KRB_SAFE.c \ + asn1_KRB_SAFE_BODY.c \ + asn1_KerberosTime.c \ + asn1_KrbCredInfo.c \ + asn1_LastReq.c \ + asn1_LR_TYPE.c \ + asn1_MESSAGE_TYPE.c \ + asn1_METHOD_DATA.c \ + asn1_NAME_TYPE.c \ + asn1_PADATA_TYPE.c \ + asn1_PA_DATA.c \ + asn1_PA_ENC_TS_ENC.c \ + asn1_Principal.c \ + asn1_PrincipalName.c \ + asn1_Realm.c \ + asn1_TGS_REP.c \ + asn1_TGS_REQ.c \ + asn1_Ticket.c \ + asn1_TicketFlags.c \ + asn1_TransitedEncoding.c \ + asn1_UNSIGNED.c + +CLEANFILES+= ${gen_files} asn1_err.[ch] asn1_files + +BUILT_SOURCES= \ + ${gen_files} \ + asn1_err.h \ + asn1_err.c + +SRCS+= der_get.c \ + der_put.c \ + der_free.c \ + der_length.c \ + der_copy.c \ + ${BUILT_SOURCES} + +CFLAGS+= -I${KRB5SRC}/lib/asn1 + +asn1_err.h asn1_err.c: ${KRB5SRC}/lib/asn1/asn1_err.et + compile_et ${KRB5SRC}/lib/asn1/asn1_err.et + +$(gen_files): + asn1_compile ${KRB5SRC}/lib/asn1/k5.asn1 krb5_asn1 + for f in *.x; do mv $$f `echo $$f | sed s,.x$$,.c,g`; done + + diff --git a/lib/libkrb5/Makefile.common.inc b/lib/libkrb5/Makefile.common.inc new file mode 100644 index 00000000000..06e5f5c1fdd --- /dev/null +++ b/lib/libkrb5/Makefile.common.inc @@ -0,0 +1,23 @@ +# $OpenBSD: Makefile.common.inc,v 1.1 2003/05/14 09:05:59 hin Exp $ + +KRB5SRC = ${KRB5DIR}/src + +KRB4DIR = ${KRB5DIR}/../kerberosIV +KRB4SRC = ${KRB4DIR}/src + +CFLAGS += -DHAVE_CONFIG_H -DBINDIR=\"/usr/bin\" -DSBINDIR=\"/usr/sbin\"\ + -DLIBEXECDIR=\"/usr/libexec\" -DSYSCONFDIR=\"/etc/kerberosV\" \ + -I${DESTDIR}/usr/include/kerberosV \ + -I${DESTDIR}/usr/include/kerberosIV \ + -I${KRB5DIR}/include -I${KRB5SRC}/lib/roken\ + -I${KRB5SRC}/include -I${KRB4SRC}/lib/sl +CFLAGS+= -Wall + +.include <bsd.own.mk> # for 'NOPIC' definition +.if !defined(NOPIC) +CFLAGS += -DHAVE_DLOPEN +.endif + +.PATH: ${KRB5SRC}/man + +COM_ERR= -lcom_err_pic diff --git a/lib/libkrb5/Makefile.hdb.inc b/lib/libkrb5/Makefile.hdb.inc new file mode 100644 index 00000000000..5b97c4660f5 --- /dev/null +++ b/lib/libkrb5/Makefile.hdb.inc @@ -0,0 +1,35 @@ +# $OpenBSD: Makefile.hdb.inc,v 1.1 2003/05/14 09:05:59 hin Exp $ + +INCLUDE_FILES+= ${KRB5SRC}/lib/hdb/{hdb.h,hdb-protos.h,hdb-private.h} \ + hdb_err.h ${.CURDIR}/hdb_asn1.h + +includes: hdb_err.h hdb_asn1.h + +ASN1_SRC = asn1_Key.c asn1_Event.c asn1_HDBFlags.c asn1_hdb_entry.c \ + asn1_Salt.c hdb_asn1.h asn1_GENERATION.c + +SRCS+= ${ASN1_SRC} \ + keytab.c \ + hdb.c \ + common.c \ + db.c \ + mkey.c \ + ndbm.c \ + print.c \ + hdb_err.c \ + hdb_err.h + +${ASN1_SRC}: + asn1_compile ${KRB5SRC}/lib/hdb/hdb.asn1 hdb_asn1 + for f in *.x; do mv $$f `echo $$f | sed s,.x$$,.c,g`; done + +CLEANFILES+= hdb_err.[ch] ${ASN1_SRC} \ + hdb_asn1.[ch] ans1_files asn1.h asn1_files + +CFLAGS+=-I${KRB5SRC}/lib/hdb -I${KRB5SRC}/lib/asn1 + +.PATH: ${KRB5SRC}/lib/hdb + +hdb_err.c hdb_err.h: ${KRB5SRC}/lib/hdb/hdb_err.et + compile_et ${KRB5SRC}/lib/hdb/hdb_err.et + diff --git a/lib/libkrb5/Makefile.kafs.inc b/lib/libkrb5/Makefile.kafs.inc new file mode 100644 index 00000000000..4406a1addbe --- /dev/null +++ b/lib/libkrb5/Makefile.kafs.inc @@ -0,0 +1,23 @@ +# $OpenBSD: Makefile.kafs.inc,v 1.1 2003/05/14 09:05:59 hin Exp $ + +INCLUDE_FILES+= ${KRB5SRC}/lib/kafs/kafs.h + +CFLAGS += -I${KRB5SRC}/lib/kafs + +.PATH: ${KRB5SRC}/lib/kafs ${KRB5SRC}/man + +SRCS+= afssys_openbsd.c \ + afskrb5.c \ + common.c \ + kafs_locl.h \ + afssysdefs.h + +MAN+= kafs.3 +MLINKS+=kafs.3 k_hasafs.3 \ + kafs.3 k_pioctl.3 \ + kafs.3 k_unlog.3 \ + kafs.3 k_setpag.3 \ + kafs.3 k_afs_cell_of_file.3 \ + kafs.3 krb_afslog.3 \ + kafs.3 krb_afslog_uid.3 + diff --git a/lib/libkrb5/Makefile.krb5.inc b/lib/libkrb5/Makefile.krb5.inc new file mode 100644 index 00000000000..abad791dae5 --- /dev/null +++ b/lib/libkrb5/Makefile.krb5.inc @@ -0,0 +1,256 @@ +# $OpenBSD: Makefile.krb5.inc,v 1.1 2003/05/14 09:05:59 hin Exp $ + +INCLUDE_FILES+= ${KRB5SRC}/lib/krb5/{krb5.h,krb5-protos.h,krb5-private.h} \ + ${KRB5DIR}/include/krb5-types.h \ + krb5_err.h heim_err.h k524_err.h + +includes: krb5_err.h heim_err.h k524_err.h + +MAN+= krb5.conf.5 + +MAN+= krb5_init_context.3 +MLINKS+=krb5_init_context.3 krb5_free_context.3 + +MAN+= krb5_warn.3 +MLINKS+=krb5_warn.3 krb5_warnx.3 +MLINKS+=krb5_warn.3 krb5_vwarn.3 +MLINKS+=krb5_warn.3 krb5_vwarnx.3 +MLINKS+=krb5_warn.3 krb5_err.3 +MLINKS+=krb5_warn.3 krb5_errx.3 +MLINKS+=krb5_warn.3 krb5_verr.3 +MLINKS+=krb5_warn.3 krb5_verrx.3 +MLINKS+=krb5_warn.3 krb5_set_warn_dest.3 + +MAN+= krb5_425_conv_principal.3 +MLINKS+=krb5_425_conv_principal.3 krb5_425_conv_principal_ext.3 +MLINKS+=krb5_425_conv_principal.3 krb5_524_conv_principal.3 + +MAN+= krb5_appdefault.3 +MLINKS+=krb5_appdefault.3 krb5_appdefault_boolean.3 +MLINKS+=krb5_appdefault.3 krb5_appdefault_string.3 +MLINKS+=krb5_appdefault.3 krb5_appdefault_time.3 + +MAN+= krb5_build_principal.3 +MLINKS+=krb5_build_principal.3 krb5_build_principal_ext.3 +MLINKS+=krb5_build_principal.3 krb5_build_principal_va.3 +MLINKS+=krb5_build_principal.3 krb5_build_principal_va_ext.3 +MLINKS+=krb5_build_principal.3 krb5_make_principal.3 + +MAN+= krb5_config.3 +MLINKS+=krb5_config.3 krb5_config_get_bool_default.3 +MLINKS+=krb5_config.3 krb5_config_get_int_default.3 +MLINKS+=krb5_config.3 krb5_config_get_string_default.3 +MLINKS+=krb5_config.3 krb5_config_get_time_default.3 + +MAN+= krb5_openlog.3 +MLINKS+=krb5_openlog.3 krb5_initlog.3 +MLINKS+=krb5_openlog.3 krb5_closelog.3 +MLINKS+=krb5_openlog.3 krb5_addlog_dest.3 +MLINKS+=krb5_openlog.3 krb5_addlog_func.3 +MLINKS+=krb5_openlog.3 krb5_log.3 +MLINKS+=krb5_openlog.3 krb5_vlog.3 +MLINKS+=krb5_openlog.3 krb5_log_msg.3 +MLINKS+=krb5_openlog.3 krb5_vlog_msg.3 + +MAN+= krb5_sname_to_principal.3 +MLINKS+=krb5_sname_to_principal.3 krb5_sock_to_principal.3 + +MAN+= krb5_auth_context.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_init.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_free.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_setflags.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_getflags.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_setaddrs.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_setaddrs_from_fd.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_getaddrs.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_genaddrs.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_getkey.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_setkey.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_getuserkey.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_setuserkey.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_getlocalsubkey.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_setlocalsubkey.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_getremotesubkey.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_setremotesubkey.3 +MLINKS+=krb5_auth_context.3 krb5_auth_setcksumtype.3 +MLINKS+=krb5_auth_context.3 krb5_auth_getcksumtype.3 +MLINKS+=krb5_auth_context.3 krb5_auth_setkeytype.3 +MLINKS+=krb5_auth_context.3 krb5_auth_getkeytype.3 +MLINKS+=krb5_auth_context.3 krb5_auth_getlocalseqnumber.3 +MLINKS+=krb5_auth_context.3 krb5_auth_setlocalseqnumber.3 +MLINKS+=krb5_auth_context.3 krb5_auth_getremoteseqnumber.3 +MLINKS+=krb5_auth_context.3 krb5_auth_setremoteseqnumber.3 +MLINKS+=krb5_auth_context.3 krb5_auth_getauthenticator.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_getrcache.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_setrcache.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_initivector.3 +MLINKS+=krb5_auth_context.3 krb5_auth_con_setivector.3 + +MAN+= krb5_context.3 + +MAN+= krb5_create_checksum.3 +MLINKS+=krb5_create_checksum.3 krb5_checksum_is_collision_proof.3 +MLINKS+=krb5_create_checksum.3 krb5_checksum_is_keyed.3 +MLINKS+=krb5_create_checksum.3 krb5_checksumsize.3 +MLINKS+=krb5_create_checksum.3 krb5_verify_checksum.3 + +MAN+= krb5_crypto_init.3 +MLINKS+=krb5_crypto_init.3 krb5_crypto_destroy.3 + +MAN+= krb5_encrypt.3 +MLINKS+=krb5_encrypt.3 krb5_decrypt.3 +MLINKS+=krb5_encrypt.3 krb5_decrypt_EncryptedData.3 +MLINKS+=krb5_encrypt.3 krb5_encrypt_EncryptedData.3 + +MAN+= krb5_free_principal.3 + +MAN+= krb5_keytab.3 +MLINKS+=krb5_keytab.3 krb5_kt_ops.3 +MLINKS+=krb5_keytab.3 krb5_keytab_entry.3 +MLINKS+=krb5_keytab.3 krb5_kt_cursor.3 +MLINKS+=krb5_keytab.3 krb5_kt_add_entry.3 +MLINKS+=krb5_keytab.3 krb5_kt_close.3 +MLINKS+=krb5_keytab.3 krb5_kt_compare.3 +MLINKS+=krb5_keytab.3 krb5_kt_copy_entry_contents.3 +MLINKS+=krb5_keytab.3 krb5_kt_default.3 +MLINKS+=krb5_keytab.3 krb5_kt_default_name.3 +MLINKS+=krb5_keytab.3 krb5_kt_end_seq_get.3 +MLINKS+=krb5_keytab.3 krb5_kt_free_entry.3 +MLINKS+=krb5_keytab.3 krb5_kt_get_entry.3 +MLINKS+=krb5_keytab.3 krb5_kt_get_name.3 +MLINKS+=krb5_keytab.3 krb5_kt_next_entry.3 +MLINKS+=krb5_keytab.3 krb5_kt_read_service_key.3 +MLINKS+=krb5_keytab.3 krb5_kt_register.3 +MLINKS+=krb5_keytab.3 krb5_kt_remove_entry.3 +MLINKS+=krb5_keytab.3 krb5_kt_resolve.3 +MLINKS+=krb5_keytab.3 krb5_kt_start_seq_get.3 + +MAN+= krb5_parse_name.3 + +MAN+= krb5_unparse_name.3 + +MAN+= krb5_verify_user.3 +MLINKS+=krb5_verify_user.3 krb5_verify_user_lrealm.3 + +SRCS+= add_et_list.c \ + addr_families.c \ + aname_to_localname.c \ + appdefault.c \ + asn1_glue.c \ + auth_context.c \ + build_ap_req.c \ + build_auth.c \ + cache.c \ + changepw.c \ + codec.c \ + config_file.c \ + convert_creds.c \ + constants.c \ + context.c \ + copy_host_realm.c \ + crc.c \ + creds.c \ + crypto.c \ + data.c \ + expand_hostname.c \ + eai_to_heim_errno.c \ + error_string.c \ + fcache.c \ + free.c \ + free_host_realm.c \ + generate_seq_number.c \ + generate_subkey.c \ + get_addrs.c \ + get_cred.c \ + get_default_principal.c \ + get_default_realm.c \ + get_for_creds.c \ + get_host_realm.c \ + get_in_tkt.c \ + get_in_tkt_pw.c \ + get_in_tkt_with_keytab.c \ + get_in_tkt_with_skey.c \ + get_port.c \ + init_creds.c \ + init_creds_pw.c \ + keyblock.c \ + keytab.c \ + keytab_any.c \ + keytab_file.c \ + keytab_memory.c \ + keytab_krb4.c \ + keytab_keyfile.c \ + krbhst.c \ + kuserok.c \ + log.c \ + mcache.c \ + mk_error.c \ + mk_priv.c \ + mk_rep.c \ + mk_req.c \ + mk_req_ext.c \ + mk_safe.c \ + krb5_net_read.c \ + krb5_net_write.c \ + n-fold.c \ + padata.c \ + principal.c \ + prog_setup.c \ + prompter_posix.c \ + rd_cred.c \ + rd_error.c \ + rd_priv.c \ + rd_rep.c \ + rd_req.c \ + rd_safe.c \ + read_message.c \ + recvauth.c \ + replay.c \ + send_to_kdc.c \ + sendauth.c \ + set_default_realm.c \ + sock_principal.c \ + store.c \ + store_emem.c \ + store_fd.c \ + store_mem.c \ + ticket.c \ + time.c \ + transited.c \ + verify_init.c \ + verify_user.c \ + version.c \ + krb5_warn.c \ + write_message.c \ + krb5_err.c \ + heim_err.c \ + k524_err.c + +CLEANFILES+= krb5_err.[ch] heim_err.[ch] k524_err.[ch] + +.PATH: ${KRB5SRC}/lib/krb5 + +CFLAGS+=-I${KRB5SRC}/lib/krb5 -I${KRB5SRC}/lib/ \ + -I${KRB5SRC}/lib/asn1 -I../asn1 -I. \ + -DSHA1_CTX=SHA_CTX + +krb5_err.c krb5_err.h: ${KRB5SRC}/lib/krb5/krb5_err.et + compile_et ${KRB5SRC}/lib/krb5/krb5_err.et + +heim_err.c heim_err.h: ${KRB5SRC}/lib/krb5/heim_err.et + compile_et ${KRB5SRC}/lib/krb5/heim_err.et + +k524_err.c k524_err.h: ${KRB5SRC}/lib/krb5/k524_err.et + compile_et ${KRB5SRC}/lib/krb5/k524_err.et + +# There is a warn.c both in lib/roken and lib/krb5. +krb5_warn.c: + ln -sf ${KRB5SRC}/lib/krb5/warn.c krb5_warn.c +CLEANFILES+=krb5_warn.c + +# There is a net_write.c and net_read.c both in lib/roken and lib/krb5. +krb5_net_write.c: ${KRB5SRC}/lib/krb5/net_write.c + ln -sf ${KRB5SRC}/lib/krb5/net_write.c krb5_net_write.c +krb5_net_read.c: ${KRB5SRC}/lib/krb5/net_read.c + ln -sf ${KRB5SRC}/lib/krb5/net_read.c krb5_net_read.c +CLEANFILES+=krb5_net_{read,write}.c
\ No newline at end of file diff --git a/lib/libkrb5/Makefile.roken.inc b/lib/libkrb5/Makefile.roken.inc new file mode 100644 index 00000000000..ef57646dfe7 --- /dev/null +++ b/lib/libkrb5/Makefile.roken.inc @@ -0,0 +1,25 @@ +# $OpenBSD: Makefile.roken.inc,v 1.1 2003/05/14 09:05:59 hin Exp $ + +.PATH: ${KRB5SRC}/lib/roken + +SRCS+= strlwr.c \ + strupr.c \ + roken_net_write.c \ + roken_net_read.c \ + getarg.c \ + base64.c \ + issuid.c \ + parse_time.c \ + parse_units.c \ + strsep_copy.c \ + get_window_size.c \ + roken_gethostby.c \ + resolve.c \ + +# There is a net_write.c and net_read.c both in lib/roken and lib/krb5. +roken_net_write.c: ${KRB5SRC}/lib/roken/net_write.c + ln -sf ${KRB5SRC}/lib/roken/net_write.c roken_net_write.c +roken_net_read.c: ${KRB5SRC}/lib/roken/net_read.c + ln -sf ${KRB5SRC}/lib/roken/net_read.c roken_net_read.c + +CLEANFILES+=roken_net_{read,write}.c
\ No newline at end of file diff --git a/lib/libkrb5/afssys_openbsd.c b/lib/libkrb5/afssys_openbsd.c new file mode 100644 index 00000000000..95a63232cdc --- /dev/null +++ b/lib/libkrb5/afssys_openbsd.c @@ -0,0 +1,104 @@ +/* $OpenBSD: afssys_openbsd.c,v 1.1 2003/05/14 09:05:59 hin Exp $ */ +/* $KTH: afssys.c,v 1.57 1998/05/09 17:19:03 joda Exp $ */ + +/* + * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan + * (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: + * + * 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. + * + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the Kungliga Tekniska + * Högskolan and its contributors. + * + * 4. 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. + */ + +#include "kafs_locl.h" + +int +xfspioctl(int operation, char *a_pathP, + int a_opcode, struct ViceIoctl *a_paramsP, + int a_followSymlinks); + +int _kafs_debug; + +int +k_pioctl(char *a_path, + int o_opcode, + struct ViceIoctl *a_paramsP, + int a_followSymlinks) +{ + return xfspioctl(AFSCALL_PIOCTL, a_path, o_opcode, a_paramsP, + a_followSymlinks); +} + +int +k_afs_cell_of_file(const char *path, char *cell, int len) +{ + struct ViceIoctl parms; + + parms.in = NULL; + parms.in_size = 0; + parms.out = cell; + parms.out_size = len; + + return k_pioctl((char*)path, VIOC_FILE_CELL_NAME, &parms, 1); +} + +int +k_unlog(void) +{ + struct ViceIoctl parms; + + memset(&parms, 0, sizeof(parms)); + + return k_pioctl(0, VIOCUNLOG, &parms, 0); +} + +int +k_setpag(void) +{ + return xfspioctl(AFSCALL_SETPAG, NULL, 0, NULL, 0); +} + +int +k_hasafs(void) +{ + struct ViceIoctl parms; + + bzero(&parms, sizeof(struct ViceIoctl)); + + k_pioctl(NULL, VIOCSETTOK, &parms, 0); + + /* + * An ENOSYS means failure. Anything else is success (including EINVAL). + */ + + return errno != ENOSYS; +} diff --git a/lib/libkrb5/shlib_version b/lib/libkrb5/shlib_version new file mode 100644 index 00000000000..715ca914844 --- /dev/null +++ b/lib/libkrb5/shlib_version @@ -0,0 +1,2 @@ +major=5 +minor=2 |